Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
With Managed Rule 2.x versions, you have to define an additional property called, "ruleSetAction".
This is also visible in the UI/Portal.
For 2.x:
For 1.x:
So, basically, your "managedRuleSets" property becomes,
"managedRuleSets": [
{
"ruleSetType": "Microsoft_DefaultRuleSet",
"ruleSetVersion": "2.1",
"ruleSetAction" : "Block",
"ruleGroupOverrides": []
}
]
The supported values are
- Block
- Log
- Redirect
Also,
- You should be able to do this via Azure Portal as well.
- Refer : Create a WAF policy
Kindly let us know if this helps or you need further assistance on this issue.
Thanks,
Kapil
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.