Static Web App Deployment Fails Due to Region Policy Violation — No Allowed Regions in Dropdown

Mohan Kumar J 0 Reputation points
2025-12-18T13:33:56.62+00:00

I'm trying to deploy a Static Web App in Azure under the following configuration:

  1. App Name: frontend
  2. SKU: Free
  3. Region: eastasia (selected from dropdown)
  4. Repo: https://github.com...
  5. Branch: deploy
  6. App location: /
  7. Output location: build

a policy assignment restricting deployments to the following regions only:

  • centralindia, malaysiawest, uaenorth, southeastasia, austriaeast

However, none of these regions appear in the dropdown list during Static Web App creation. The deployment fails with the error: “The template deployment failed because of policy violation. Please see details for more information.”

How can I deploy the Static Web App in one of the allowed regions if the portal dropdown doesn’t list them? Is there a workaround using Azure CLI, ARM templates, or another method to manually specify a permitted region?

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2025-12-18T13:34:16.11+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    If you are unable to select the allowed regions in the Azure portal dropdown for deploying your Static Web App due to a policy assignment, you can try the following workaround using the Azure CLI:

    1. Use Azure CLI to Create the Static Web App: You can deploy your Static Web App in one of the allowed regions by using the Azure CLI. Here’s a command structure you can follow:
         az staticwebapp create \
             --name frontend \
             --resource-group <YourResourceGroup> \
             --location <AllowedRegion> \
             --source <YourRepoUrl> \
             --branch deploy \
             --app-location / \
             --output-location build \
             --sku Free
      
      Replace <YourResourceGroup> with your resource group name and <AllowedRegion> with one of the permitted regions (e.g., centralindia, malaysiawest, etc.).
    2. ARM Templates: If you prefer using ARM templates, you can define your Static Web App in an ARM template and specify the allowed region in the template. Here’s a basic structure:
         {
             "type": "Microsoft.StaticWebApps",
             "apiVersion": "2020-12-01",
             "name": "frontend",
             "location": "<AllowedRegion>",
             "properties": {
                 "sourceControl": {
                     "repoUrl": "<YourRepoUrl>",
                     "branch": "deploy"
                 },
                 "appLocation": "/",
                 "outputLocation": "build"
             }
         }
      
      Make sure to replace <AllowedRegion> and <YourRepoUrl> with the appropriate values.
    3. Check Policy Assignment: Ensure that the policy assignment is correctly set up to allow deployments in the specified regions. If the policy is overly restrictive, you may need to adjust it or work with your Azure administrator to modify the policy settings.

    By using the Azure CLI or ARM templates, you should be able to specify a permitted region for your Static Web App deployment even if it does not appear in the portal dropdown.


    References:

    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.