skip to Main Content

I am managing an Azure App Service and need to add some IP addresses to the whitelist (under Network settings). We need to whitelist the IPs from a monitoring service which includes rather a lot of IP addresses (571 to be precise). Azure App Services have a limit of 512 IP addresses. What is the easiest way to get around this? Currently, our IP addresses are administered via a deployment script so we are not adding those IPs by hand.

2

Answers


  1. • Though the documentation for the app service IP restriction surely says as such so that only 512 IP access restriction rules are allowed to be whitelisted from the networking access restrictions in an app service but it doesn't say that about IP addresses. So, I tried to allow or whitelist a subnet of ‘/24’ or ‘65535’ IP addresses for an app service and I was able to do so effortlessly. Kindly find the snapshot below for your reference: –

    App service restriction - 1
    App service restriction - 2
    App service restriction - 3

    Thus, the documentation is correct, and it states regarding the limitation about access restriction rules not about IP addresses. As a result, any number of IP addresses can be whitelisted for an app service, there is no restriction on that.

    For detailed information regarding whitelisting the IP addresses for an app service, refer to the below documentation: –

    https://learn.microsoft.com/en-us/azure/app-service/app-service-ip-restrictions

    Login or Signup to reply.
  2. You could use the Multi-source rules to logically group the IP addresses into one rule. So theoretically the limit is (512 rules x 8 IP blocks)

    Add-AzWebAppAccessRestrictionRule -ResourceGroupName "ResourceGroup" -WebAppName "AppName" -Name "Multi-source rule" -IpAddress "192.168.1.0/24,192.168.10.0/24,192.168.100.0/24" -Priority 100 -Action Allow
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search