I have the following code that creates the environment variable called ENDPOINT_TEST
through an ADO pipeline but I want to hide the URL https://xyz
. I have created a secret in the keyvault to store this url as secret_url
and I have linked my keyvault variables with ADO. My question is how can I call this variable from ADO and use it in this azure cli script?
- task: AzureCLI@1
displayName: 'Set variable'
inputs:
azureSubscription: 'test-group-SPN'
scriptType: 'ps'
scriptLocation: 'inlineScript'
inlineScript: |
az webapp config appsettings set -n function-test -g test-group --settings ENDPOINT_TEST=https://xyz
I have tried the following:
az webapp config appsettings set -n function-test -g test-group --settings ENDPOINT_TEST=$(secret_url)
az webapp config appsettings set -n function-test -g test-group --settings ENDPOINT_TEST='$(secret_url)'
az webapp config appsettings set -n function-test -g test-group --settings ENDPOINT_TEST=${secret_url}
None of these have worked. What am I missing? Any help or suggestion is appreciated!