Hello Eddie Vincent
I understand you're interested in creating a custom rule in the Azure Application Gateway WAF using PowerShell. Please refer to the following documents for more details:
https://free.blessedness.top/en-us/azure/web-application-firewall/ag/configure-waf-custom-rules
https://free.blessedness.top/en-us/azure/web-application-firewall/ag/create-custom-waf-rules
If you want to block a specific custom response code or body in the WAF policy settings, you can use the following resource:
https://free.blessedness.top/en-us/azure/web-application-firewall/ag/configure-custom-response-code
You can also configure single rules directly through the portal. If you need to deny a specific request body, please review the relevant scenario in the documentation and let me know your results.
Based on your requirements, you can implement custom rules to block specific IP addresses by entering the IP address in the match variable field. Geo location-based blocking is also possible.
If a default rule is blocking something in your environment and you want to allow it, you can use the exclusion option.
check the below document:
Hope the above answer helps! Please let us know do you have any further queries.
Please do not forget to “up-vote” wherever the information provided helps you, this can be beneficial to other community members.