Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zachbonham/04cafc1e95316b32765463d597b23de0 to your computer and use it in GitHub Desktop.
Save zachbonham/04cafc1e95316b32765463d597b23de0 to your computer and use it in GitHub Desktop.
Azure DevOps Static Web Apps Pipeline Task for Deployment Token
- task: AzureCLI@2
displayName: 'Get Deployment Token'
name: swaConfig
inputs:
azureSubscription: $(azureServiceConnection)
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
apiKey=$(az staticwebapp secrets list --name $(websiteName) --query '[properties.apiKey][0]' --output tsv)
echo $apiKey | jq .
echo "##vso[task.setvariable variable=deployToken;isoutput=true]$apiKey"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment