在服务定义csdef中启用自定义配置部分,在azure中启用服务配置cscfg

时间:2016-01-20 08:33:07

标签: asp.net-mvc azure azure-cloud-services azure-configuration

我正在将.NET MVC应用程序移动到Microsoft Azure云服务。我计划将配置从web.config移动到azure中的csdef / cscfg。

我的web.config文件包含很少的自定义配置部分。

<configuration>
  <configSections>
     <section name="myConfig1" type="MyNamespace.MyClassType" />
  </configSections>

  <myConfig1 someProperty1="someValue1" someProperty2="someValue2" someProperty3="someValue3">
     <test1 testproperty=testValue />
     <test2 xProperty=xValue />
  </myConfig1>
</configuration>

我在应用程序启动时使用此配置(global.asax)。 我想将其转换为csdef / cscfg。 通常cscfg具有键/值对配置设置..

有人可以建议我如何将自定义配置转换为天蓝色的服务配置吗?

1 个答案:

答案 0 :(得分:0)

您的web.config仍将在Azure Web角色中使用。 csdef文件的目的是为您的应用程序定义环境 - 例如VM大小和任何自定义启动任务。您可以将任何键/值对放在cscfg文件中,或将它们保留在web.config中。

相关问题