I have a configuration in App Service like this I want to pass this setting into the argument of a pipeline's task How can I do it?
I've tried to create a variable group but I still don't know how to link the app setting into the variable
CodePudding user response:
Microsoft provide command line tools to access this information. I don't have a web-app to access to give specific commands but roughly something like this.
See documentation here: https://docs.microsoft.com/en-us/azure/app-service/configure-common?tabs=cli#configure-app-settings
For example using az cli you could do something like:
az webapp config connection-string list --resource-group <group-name> --name <app-name> > settings.json
You can then select the specific item out of that list using jq
.
myvalue=$(jq -r .some.path settings.json)
And you can also set the value in a variable which you can use in another task:
##vso[task.setvariable variable=appsetting;]value
So :
- Download app settings
- Select item
- Set variable to pass to next step
- Use variable in next step.