简体   繁体   中英

How to get value from Azure App Service from Azure pipeline

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在此处输入图像描述

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://learn.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:

  1. Download app settings
  2. Select item
  3. Set variable to pass to next step
  4. Use variable in next step.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM