AzureStaticWebApp@0 - Unable to runtime variable for azure_static_web_apps_api_token
- Dominant language
- No language data
- Stars
- 346
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Unable to pass the deployment token as a parameter when using a runtime variable
for the tasks below, "./artifacts/build/" is a built reactjs site, and "./artifacts/api/" is a function app. When "deploymentToken" is defined as a library or pipeline variable the site deploys fine, but when it is retrieved from the resource on-the-fly using the azure cli, deployment fails with an "invalid token" error. The value of $(deploymentToken) is the same as the value provided when you manage tokens in the Azure Portal. I verified this in both the Azure CLI and by writing the value to the log during deployment.
- task: AzureCLI@2
displayName: Get Deployment Key Variable
inputs:
azureSubscription: ******
scriptLocation: inlineScript
scriptType: pscore
inlineScript: |
$KEY= & az staticwebapp secrets list `
--name $(resource_group_name)_client `
--resource-group $(resource_group_name) `
--query properties.apiKey; `
Write-Host "##vso[task.setvariable variable=deploymentToken;issecret=true]$KEY"
- task: AzureStaticWebApp@0
displayName: Deploy Public Client
inputs:
app_location: "./artifacts/build/"
api_location: "./artifacts/api/"
azure_static_web_apps_api_token: $(deploymentToken)
output_location: ""
skip_app_build: true
**Expected behavior**
The token should be accepted and the deployment succeed, just as when using a compile time variable
**Screenshots**

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.