如何使用Azure更新AppSettings.json值
我想获得一个构建号码并将其显示在我的网站徽标上。因此,只要有新的构建,我都需要一个新的构建号码并将其传递到appsettings.json文件,这样我就可以从那里获取构建号并使用它。
"AppSettings": {
"EmailPopPort": "111",
"PopEmail": "[email protected]",
"PopPassword": "sBzce",
"AvailableStacks": [
"AAA",
"Plan",
"US"
],
"SmsProvider": "SmsGlobal",
"Version": "Dev"
}
我想在AppSettings.json中通过Azure中的管道更新上述“版本”。最好的技术是什么?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从本文档中:
App Service中配置的值覆盖了Web中的内容。 config或appsettings.json。
因此,只需更改为配置设置即可。
如何在Azure管道中进行操作:
1,创建服务连接:
:角色分配需要5分钟才能申请。
注意
( https://i.sstatic.net/ttvvi.png“ rel =“ nofollow noreferrer”>
noreferrer“>
如果使用yaml,那是
4,之后,等一下,它将成功:
From this document:
https://learn.microsoft.com/en-us/azure/app-service/configure-common?tabs=portal#configure-app-settings
the values of configuration in App Service override the ones in Web.config or appsettings.json.
So, just need to change to configuration settings is ok.
How to do it in Azure pipeline:
1, Create a service connection:
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
4, After that, just wait, it will be successful: