2

When using the Azure Websites with ASP.NET apps, it is possible to configure through the Azure portal a series of AppSettings to be injected at deployment time into the web.config behavior of the app. How can this be reproduced using a private instance of Kudu?

4

1 回答 1

0

第一个问题

是的,您可以直接在网站的门户中输入一些 AppSettings。您可以通过转到 CONFIGURE 选项卡并将一些键/值设置到 APPSETTINGS 部分来执行此操作。

这对您的应用程序是绝对透明的。您只需使用 ConfigurationManager 阅读 appsetting,就好像该设置在 web.config 文件中一样。新值优先于 web.config 中的值。

如果您要设置敏感值,这很有趣。

另一种选择(对 Web 作业更有趣)是直接从自动创建的环境变量中读取您的应用程序设置。如果你在设置中有一个 FOO 键,你也会得到一个名为 APPSETTING_FOO 的环境变量

最近,新门户为您提供了新的可能性,只需选中一个复选框即可设置特定于插槽的 appsettings 键:

http://weblogs.asp.net/scottgu/azure-machine-learning-service-hadoop-storm-cluster-scaling-linux-support-site-recovery-and-more

于 2015-02-23T11:20:29.103 回答