问题描述
我真的很喜欢使用默认的appsettings.json来获得Asp.Net vNext的新配置功能
I really enjoyed the new Configuration feature of Asp.Net vNext using de default appsettings.json
但是,当我将网站发布为Azure Web App时,我想更改该文件的值.
But I would like to change the values of that file when I publish the website as a Azure Web App.
旧的web.config应用程序设置很容易更改和配置环境中的属性.
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应用设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!