如何和在哪里定义一个环境变量在天蓝色 [英] How and where to define an environment variable on azure
问题描述
GetEnvironmentVariable(...)
方法读取我的设置。 问题是我找不到在天蓝色门户网站中定义这个环境变量的方法。任何人都可以指出我可以做哪些事情?
我不想让这个东西在文件中,数据会有一个凭据。
其实这解决了我的问题(我昨天发现的 - 也是在Scotts博客上):
http://www.hanselman.com/blog/BestPracticesForPrivateConfigDataAndConnectionStringsInConfigurationInASPNETAndAzure.aspx
tl; dr;
将设置放在单独的文件中,不会转到存储库,而是没有部署到服务器。接下来在应用设置中定义缺少的变量,如Xiaomin Wu显示。
I have a mvc web application deployed to azure. I'm reading my setting using GetEnvironmentVariable(...)
method.
Problem is that I can't find a way to define this environment variable in azure portal. Can anyone point where I can do that?
I don't want to have this stuff in file, data that will be there a credentials.
Actually this solves my problem (which I found yesterday - and its on Scotts blog also): http://www.hanselman.com/blog/BestPracticesForPrivateConfigDataAndConnectionStringsInConfigurationInASPNETAndAzure.aspx
tl;dr;
Put settings in a separate file, that doesnt go to repository and are not being deployed to server. Next define missing variables in app setting like Xiaomin Wu showed.
这篇关于如何和在哪里定义一个环境变量在天蓝色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!