static-web-apps-cli: deploy command does not actually deploy
Hi,
trying to deploy my already-built angular application to azure static web site with pwsh script from ubuntu OS in my container which will run as deploy container in our azure devops pipeline. I’m using following instructions
az login --service-principal -u $armClientId -p $armClientSecret --tenant $armTenantId -o none
$deploymentToken = az staticwebapp secrets list --name $staticWebSiteName --query "properties.apiKey"
swa init --yes
swa deploy --env production `
--deployment-token $deploymentToken `
--resource-group $rgName `
--app-name $staticWebSiteName `
--app-location $artifactPath `
--no-use-keychain `
--verbose=silly
Expected behavior I expect that my angular frontend in $artifactPath will be packed to zip and then uploaded to azure static web app instance $staticWebSiteName and if not command writes into console what is wrong and returns non-zero code. What actually happens is that i get following console output
Welcome to Azure Static Web Apps CLI (1.0.3)
Detected configuration for your app:
- Framework(s): Static HTML
- App location: artifact
- Output location: .
- API location:
- App build command:
- API build command:
- App dev server command:
- App dev server URL:
Configuration successfully saved to swa-cli.config.json.
Get started with the following commands:
- Use swa start to run your app locally.
- Use swa deploy to deploy your app to Azure.
Welcome to Azure Static Web Apps CLI (1.0.3)
Getting config file options from swa-cli.config.json...
Changed directory to /workspaces/ci-deploy-image
Using configuration "ci-deploy-image" from file:
/workspaces/ci-deploy-image/swa-cli.config.json
Deploying front-end files from folder:
/workspaces/ci-deploy-image/artifact
Deployment token provided via flag
- --deployment-token: <hidden>
Deploying to environment: production
Trying to read workflow config with values:
- appLocation: /workspaces/ci-deploy-image/artifact
- outputLocation: /workspaces/ci-deploy-image/artifact
- apiLocation: <undefined>
No workflow config folder found at /workspaces/ci-deploy-image/artifact/.github/workflows
Validating user workflow config (BEFORE):
- appLocation: /workspaces/ci-deploy-image/artifact
- outputLocation: /workspaces/ci-deploy-image/artifact
- apiLocation: <undefined>
Validating user workflow config (AFTER):
- appLocation: /workspaces/ci-deploy-image/artifact
- apiLocation: <undefined>
- outputLocation: /workspaces/ci-deploy-image/artifact
Loading staticwebapp.config.json schema...
Schema loaded successfully from https://json.schemastore.org/staticwebapp.config.json
Compiling schema...
Reading content from staticwebapp.config.json...
Parsing staticwebapp.config.json...
Validating staticwebapp.config.json...
File validated successfully. Continuing with configuration!
Content parsed successfully
Found configuration file:
/workspaces/ci-deploy-image/artifact/staticwebapp.config.json
Deploying project to Azure Static Web Apps...
Fetching release metadata for version: stable. Please wait...
- version: stable
- buildId: 1.0.020981
- publishDate: 2022-09-29T17:37:34.4094014Z
- files:
- linux-x64:
- url: https://swalocaldeploy.azureedge.net/downloads/1.0.020981/linux/StaticSitesClient
- sha: e55db21d0720a12098804559152303e66846bdd94c13a30b30be29a0fc9ae366
- win-x64:
- url: https://swalocaldeploy.azureedge.net/downloads/1.0.020981/windows/StaticSitesClient.exe
- sha: 4e4eb72aef26641e236c24929c822500e956bda099ca78054112cadf20261107
- osx-x64:
- url: https://swalocaldeploy.azureedge.net/downloads/1.0.020981/macOS/StaticSitesClient
- sha: e0f2ae7ec297510a1b3b9332c0dc0dd962a51adb8ea13cd4f3746d79fc24a7e9
Local client binary is up to date. Skipping download.
Deploying using /root/.swa/deploy/1.0.020981/StaticSitesClient@1.0.020981
Deploying using the following options:
- env:
- SWA_CLI_DEBUG: silly
- SWA_RUNTIME_WORKFLOW_LOCATION: <undefined>
- SWA_RUNTIME_CONFIG_LOCATION: /workspaces/ci-deploy-image/artifact
- SWA_RUNTIME_CONFIG: /workspaces/ci-deploy-image/artifact/staticwebapp.config.json
- SWA_CLI_VERSION: 1.0.3
- SWA_CLI_DEPLOY_DRY_RUN: false
- SWA_CLI_DEPLOY_BINARY: /root/.swa/deploy/1.0.020981/StaticSitesClient@1.0.020981
- DEPLOYMENT_ACTION: upload
- DEPLOYMENT_PROVIDER: SwaCli
- REPOSITORY_BASE: /workspaces/ci-deploy-image/artifact
- SKIP_APP_BUILD: true
- SKIP_API_BUILD: true
- DEPLOYMENT_TOKEN: <hidden>
- APP_LOCATION: /workspaces/ci-deploy-image/artifact
- API_LOCATION: <undefined>
- CONFIG_FILE_LOCATION: /workspaces/ci-deploy-image/artifact
- VERBOSE: true
ℹ DeploymentId: aa230ca8-5a63-4791-bc0d-8986db8672ef
ℹ
ℹ Verbose logging enabled
ℹ
ℹ For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/
but nothing is updated on azure static web app instance i deploy to and yet i get 0 return code signalizing everything is ok…
Additional context ubuntu 22.04, nodejs v18.12.1, npm 8.19.2 installed with
RUN apt-get install -y nodejs="18.12.1-*" && \
npm install -g @azure/static-web-apps-cli
RUN apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb libsecret-1-0
Any help really appreciated…
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 23 (5 by maintainers)
ok. so problem solved. there were actually two stupid problems in my case
az staticwebapp secrets list --name <application-name> --query "properties.apiKey"which doesn’t work as it does not remove quotation marks - this leads to invalid token exception… Correct command isaz staticwebapp secrets list --name <application-name> --query "properties.apiKey" -o tsv