Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
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:
- Create or update the staticwebapp.config.json file in your application's source code.
- Include a networking section and set the allowedIpRanges property.
- 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:
- Configure networking and IP restrictions in Azure Static Web Apps: https://learn.microsoft.com/en-us/azure/static-web-apps/configuration#networking
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.