如何和在哪里定义一个环境变量在天蓝色 [英] How and where to define an environment variable on azure

查看:133
本文介绍了如何和在哪里定义一个环境变量在天蓝色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个mvc web应用程序部署到天蓝色。我正在使用 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屋!

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