Search code examples
azureazure-web-app-serviceazure-app-service-envrmntazure-appservice

Azure App Services: How to restrict everything but one IP address


I have a Web API hosted in Azure App Services, and I want to use the restriction tool to restrict traffic for every single IP that exists, with the exception of the ip address that we want to actually call this service.

How should I proceed? This answer show the correct way to block a single IP, and even mention that you can block a range of IP, but I don't really know how to block a range, as there's not two input boxes to write a range.

enter image description here

Can you help me out please? Thank you!


Solution

  • So, after digging even more around, I found the way. The issue is that the ip address input box expects either an ip or a range of ips based on CIDR notation. In CIDR notation, to block everything, you will write: 0.0.0.0/0

    If you don't know CIDR notation, you can use this builder.

    EDIT:

    To allow only one ip address, is enough to create a rule allowing just that one. This will automatically block every call from other ip addresses.