Azure 上的 Asp.Net VNext 应用程序设置 [英] Asp.Net VNext App Settings on Azure
问题描述
我非常喜欢使用默认 appsettings.json 的 Asp.Net vNext 的新配置功能
I really enjoyed the new Configuration feature of Asp.Net vNext using de default appsettings.json
但是当我将网站发布为 Azure Web 应用程序时,我想更改该文件的值.
But I would like to change the values of that file when I publish the website as a Azure Web App.
旧的 web.config appsettings 易于更改和配置环境属性.
The old web.config appsettings was easy to change and configure the properties on the environment.
你知道怎么做吗?我更喜欢使用默认提供程序而不是创建自定义配置提供程序.
Do you know how to do this? I prefer to user the default provider instead of creating a custom configuration provider.
谢谢!
推荐答案
如果您在 Azure 门户中设置应用程序设置,它们会在运行时成为环境变量,并且应该被 ASP.NET vNext 运行时拾取.所以你不需要物理上修改你的appsettings.json
来实现这个.
If you set App Settings in the Azure Portal, they become environment variables at runtime, and should get picked up by the ASP.NET vNext runtime. So you don't need to physically modify your appsettings.json
to achieve this.
这篇关于Azure 上的 Asp.Net VNext 应用程序设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!