I want to get a build number and display it on my website logo. So whenever there is a new build, I want a new build number and pass it to the AppSettings.json file so then I can fetch the build number from there and use it.
"AppSettings": {
"EmailPopPort": "111",
"PopEmail": "[email protected]",
"PopPassword": "sBzce",
"AvailableStacks": [
"AAA",
"Plan",
"US"
],
"SmsProvider": "SmsGlobal",
"Version": "Dev"
}
I want to update the above "Version" In appsettings.json through the pipeline in Azure. What would be the best technique to do that?
CodePudding user response:
From this document:
2, Give the related service principal required permission:
(Note: The role assign need 5 minutes to apply, please wait.)
3, Use DevOps pipeline to change the app settings:
If you use YAML, it is
steps:
- task: AzureAppServiceSettings@1
displayName: 'xxx'
inputs:
azureSubscription: xxx
appName: xxx
resourceGroupName: 'xxx'
appSettings: |
[
{
"name": "bowmantest",
"value": "bowmantestvalue",
"slotSetting": false
}
]
4, After that, just wait, it will be successful: