Does the ipSecurity section in web.config works with Azure App Services?
What are the steps to get a simple IP address blocking (black list) set up with a web app hosted on Azure?
App Service provides UX for this under Networking > Ip Restrictions
From here you can block a specic ip address or a range of address:
If you want to do it through web.config you will need to use XDT Transforms
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<security>
<ipSecurity xdt:Transform="RemoveAttributes(allowUnlisted)">
<add ipAddress="204.79.197.200" allowed="true" xdt:Transform="Insert"/>
</ipSecurity>
</security>
</system.webServer>
</configuration>
You can read more about XDT transforms and app service here: https://github.com/projectkudu/kudu/wiki/Xdt-transform-samples
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With