IP tags restriction for Azure static web app

Simran Yadav 0 Reputation points Microsoft Employee
2025-10-30T18:03:46.1933333+00:00

I've a static web app deployed for my frontend. I want it to be accessible only to certain IP tags. How can I do it? I see there is a networking configuration, can it be used for IP tags?

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


1 answer

Sort by: Most helpful
  1. Praneeth Maddali 12,585 Reputation points Microsoft External Staff Moderator
    2025-11-04T19:24:42.6+00:00

    Hi @Simran Yadav

    Yes, you can limit access to your Azure Static Web App to certain IP addresses or IP tags by using the IP range restriction feature included in the Azure Static Web Apps Standard plan.

    To implement IP restrictions:

    1. Create or update the staticwebapp.config.json file in your application's source code.
    2. Include a networking section and set the allowedIpRanges property.
    3. List the permitted IP address ranges or Azure service tags using CIDR notation.

    Here is a sample configuration snippet for your reference:

    {
      "networking": {
        "allowedIpRanges": [
          "203.0.113.0/24",
          "40.112.0.0/16",
          "AzureFrontDoor.Backend"
        ]
      }
    }
    

    This configuration restricts access to your static web app exclusively to the specified IP addresses or service tags. Any requests originating from IPs outside these defined ranges will be blocked.

    Key points to note:

    • This feature is available only with the Standard tier of Azure Static Web Apps.
    • You can utilize Azure service tags, such as AzureFrontDoor.Backend, which cover Microsoft-managed IP address ranges.
    • If you require more detailed control or are using the Free tier, you might consider placing Azure Front Door or Azure Application Gateway in front of your Static Web App to manage IP restrictions.

    Reference:

    let us know if the above helps or you need further assistance on this issue.

     

    Please "upvote" if the information helped you. This will help us and others in the community as well.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.