0

I was trying to enable/disable the ApplicationGateway WAF rules using Postman's rest API.

enter image description here

I tried to disable the rules 200003 and 200004 using rest API.

I was using the below URL for the REST API

https://management.azure.com/subscriptions/{{subscriptionId}}/resourceGroups/AppGatewayRG/providers/Microsoft.Network/applicationGateways/tvsapplicationgateway?api-version=2020-11-01

In the request body, I was using the below JSON code

  {
    "location": "eastus",
    "properties": {
    "webApplicationFirewallConfiguration": {
        "enabled": true,
        "firewallMode": "Prevention",
        "ruleSetType": "OWASP",
        "ruleSetVersion": "3.2",
        "disabledRuleGroups": ["General"],
         "rules": [200003,200004],
         "requestBodyCheck": true,
         "maxRequestBodySizeInKb": 128,
         "fileUploadLimitInMb": 100,
         "exclusions": []
    }
  }
}

But when I execute it using Postman I get the error

enter image description here

I could find the following definition from the Azure doc site, but I am not sure how to use it in the Request header https://learn.microsoft.com/en-us/rest/api/application-gateway/application-gateways/create-or-update?tabs=HTTP#applicationgatewayfirewalldisabledrulegroup

1 Answer 1

0

Can you try with the following request body:

{
    "location": "eastus",
    "properties": {
    "webApplicationFirewallConfiguration": {
        "enabled": true,
        "firewallMode": "Prevention",
        "ruleSetType": "OWASP",
        "ruleSetVersion": "3.2",
        "disabledRuleGroups": [{
            "ruleGroupName": "General",
            "rules": [200003,200004]
        }],
         "requestBodyCheck": true,
         "maxRequestBodySizeInKb": 128,
         "fileUploadLimitInMb": 100,
         "exclusions": []
    }
  }
}

Reference: https://learn.microsoft.com/en-us/rest/api/application-gateway/application-gateways/create-or-update?tabs=HTTP#applicationgatewaywebapplicationfirewallconfiguration

Sign up to request clarification or add additional context in comments.

3 Comments

Getting an "InternalServerError" with this
Can you try with “2023-05-01” API version?
getting the same error "InternalServerError"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.