Azure不会覆盖应用程序设置 [英] Azure does not override application settings

查看:168
本文介绍了Azure不会覆盖应用程序设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Azure App Service中,我想更新应用程序设置,但是从VS发布后,键不会覆盖本地Web.config中的值

In my Azure App Service I want to update application settings, but after publish from VS the keys doesn't override values from local Web.config

在Azure中,它看起来像:

In Azure it looks like:

结果是,我在Azure上的web.config包含来自本地设置的值

In the result my web.config on azure contains values from local settings

  <connectionStrings>
    <add name="MainConnectionString" connectionString="ConnectionStringToReplaceByAzure" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <appSettings>
    <add key="MS_SigningKey" value="Overridden by portal settings" />
  </appSettings>

推荐答案

Azure从不对您的web.config文件进行物理修改.而是在运行时将Azure应用程序设置注入到配置系统中.因此,即使您在web.config中看不到它,也可以通过应用程序查询它.

Azure never physically modifies your web.config file. Instead, the Azure App Setting is injected into the config system at runtime. So even though you don't see it in web.config, if you query it from your app you will get the correct value.

这篇关于Azure不会覆盖应用程序设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆