Forum Discussion

saratogacoach's avatar
saratogacoach
Copper Contributor
Feb 19, 2023
Solved

Azure Static Web App-CLI script to create plus add location: eastus2

Hi, I am a beginner using Azure, have set up a basic free account to try creating a static web app, using the SWA CLI tool. Found a useful command line script (https://edi.wang/post/2022/11/17/deplo...
  • ediwang's avatar
    Feb 21, 2023

    saratogacoach 

     

    There are no options for specifying deployment location or region yet. Because https://learn.microsoft.com/en-us/azure/static-web-apps/faq#how-do-i-ensure-my-app-is-deployed-to-a-specific-azure-region- it will automatically distribute your app files to closest datacenter to your customers, only resource group is regional, in your case, I will show you how to deploy to a regional resource group.

     

    1. Go to Azure portal first and create a new static web app in your desired location, in your case East US 2. Make sure you select "Other" in Deployment details - source. Wait for 5 minutes (important, otherwise you will not see this app in step 2).

     

    2. Use SWA to deploy your code, it will list existing static web apps which were created from Azure portal in the previous step. Select the app you created in step 1.

     

    3. This time your code will be deployed to East US 2 resource group.

Resources