Azure SWA CLI deploy ignoring resource group

87 Views Asked by At

I'm using the Azure Static Web Apps CLI (SWA CLI) to deploy, but it appears to be ignoring the --resource-group command.

I have 2 separate resource groups within the same Azure subscription (same tenant), with each resource group containing a Static Web App that has the same name.

Issuing the following command:

swa deploy ./spa --env production --tenant-id ABC --subscription-id DEF --resource-group GHI --app-name JKL

Results in the app being deployed to the Static Web App created first (in let's say resource group XYZ), essentially ignoring the resource group command-line option.

Even though the two Static Web Apps have the same name, I was expecting the --resource-group command line option to deploy to the app in the specified resource group.

UPDATE: Upgraded SWA CLI to version 1.1.3 but problem remains as above

1

There are 1 best solutions below

0
On

I tried using deployment token and it worked fine.

swa deploy ./spa --deployment-token $(az staticwebapp secrets list --name <application-name> --resource-group <resource-group> --query "properties.apiKey" | tr -d '"')