SWA CLI setting region location to eastus2 #658
-
I am new to Azure static web apps and new to the SWA CLI, so have been reading the SWA doc, plus expert scripting advice and examples, then experimenting. swa deploy ./build --env production found at https://edi.wang/post/2022/11/17/deploy-to-azure-static-web-app-from-local-machine-without-github-action creates a static web app from my desktop's build folder, but places it in the default region, westus2. Cannot be changed after setup. I would like to learn how to re-do this and set the region to eastus2, if possible. Posted on the Microsoft Tech community, but so far no replies (https://techcommunity.microsoft.com/t5/azure/azure-static-web-app-cli-script-to-create-plus-add-location/m-p/3747071). I have read about environment variables but, unfortunately, as a beginner, have no idea how to implement this using the SWA CLI? If possible, is there a step-by-step walk-through of setting the region location using the Power Shell on my Win 11 desktop? Will keep working with and testing the SWA CLI, so hope in the future to contribute. Thank you for this wonderful tool. Best Wishes, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @saratogacoach, And thanks for being a SWA CLI enthusiast! :) |
Beta Was this translation helpful? Give feedback.
Hi @saratogacoach,
Looks like you have recently received your answer in the Tech Community (link)
Like mentioned, SWA is a global service and hence your application gets deployed across all the regions. The region selection plays a role for your API backend, since that would be deployed to one specific region.
Also curious if you tried setting
AZURE_REGION_LOCATION
environment variable toeastus2
. This should also create your project in the specified location. Do let us know if this doesn't work though.And thanks for being a SWA CLI enthusiast! :)