How to update an existing WAF Policy using Azure REST API?

Mrudhula Raya 0 Reputation points
2023-08-19T11:52:24.17+00:00

Hi,

I'm trying to update an existing WAF Policy with a new custom rule using Logic Apps using this API - https://video2.skills-academy.com/en-us/rest/api/frontdoor/webapplicationfirewall/policies/create-or-update. But I keep getting this same error as shown below, I haven't given SKU value in my request body.

Can I get any sample request & response for the update endpoint? I'm using a Standard tier FrontDoor, API Version is as given in the image. This is my Body (sample request taken from the link above) -

{
  "location": "Global",
  "properties": {
    "customRules": {
      "rules": [
        {
          "action": "Block",
          "matchConditions": [
            {
              "matchValue": [
                "192.168.1.0/23",
                "10.0.0.0/23"
              ],
              "matchVariable": "RemoteAddr",
              "operator": "IPMatch"
            }
          ],
          "name": "Rule123",
          "priority": 10,
          "rateLimitThreshold": 1000,
          "ruleType": "RateLimitRule"
        }
      ]
    },
    "policySettings": {
      "customBlockResponseBody": "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==",
      "enabledState": "Enabled",
      "mode": "Prevention",
      "redirectUrl": "http://www.bing.com",
      "requestBodyCheck": "Disabled"
    }
  }
}

Screenshot 2023-08-19 at 5.13.24 PM

I am able to create a new WAF Policy using this endpoint but I need the Update feature. Any help would be fantastic. Thanks!!

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
677 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,133 questions
Azure Web Application Firewall
{count} votes

1 answer

Sort by: Most helpful
  1. VenkateshDodda-MSFT 20,696 Reputation points Microsoft Employee
    2023-08-21T12:49:27.7966667+00:00

    @Mrudhula Raya Thanks for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.

    To test this behavior, I have created a consumption-based logic enabled managed identity(assigned contributor role at resource group level) and thereby calling above create or update front door policies Rest API in HTTP action (using above shared JSON body), able to create and update the existing Front Door WAF policy without any issues.

    Could you please re-try the operation, if you are facing the issue help us with the complete error message, failure run id, logic app name and also which actions, triggers that you are using in your workflow to check and assist you further.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.