在Azure的网站加密数据库连接字符串

在Azure的网站加密数据库连接字符串

本文介绍了在Azure的网站加密数据库连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以加密数据库连接字符串,并将其部署到Windows Azure的网站? (不是Windows Azure的Web角色)如果是这样,怎么样?

Is it possible to encrypt a database connection string and deploy it to a Windows Azure Website? (NOT a Windows Azure Web Role) If so, how?

我想问的原因是因为我无法找到的例子或文档至于如何与Azure的网站专门执行此的任何地方。 (我想使用共享网站模式)

The reason I ask is because I can't find examples or documentation anywhere as to how to perform this specifically with Azure Websites. (I'd like to use the "Shared" web site mode)

我发现下面的资源,来接近我想要的,但利用网络角色而不是网站:结果

http://blogs.msdn.com/b/windowsazure/archive/2010/09/09/securing-your-connection-string-in-windows-azure-part-3.aspx

I have found the following resources, which come close to what I want, but utilize Web Roles instead of Websites:
http://archive.msdn.microsoft.com/pkcs12protectedconfghttp://blogs.msdn.com/b/windowsazure/archive/2010/09/09/securing-your-connection-string-in-windows-azure-part-3.aspx

推荐答案

要在Azure网站使用的连接字符串的正确方法是调试连接字符串添加到您的的web.config 文件(并以调试,它可以是本地DB /存储或安全地共享任何字符串 - 空字符串)。

The proper way to use connection strings on Azure Websites is to add "debug" connection strings to your web.config file (and by "debug" it can be a local db/storage or any string that is safe to share - empty string).

在Azure的门户网站去你的Azure网站 - >配置选项卡,然后在连接字符串部分用在你的网​​站使用相同的名称添加您的实际连接字符串。配置文件中,连接字符串保存为加密的字符串。

On the Azure portal go to your Azure website --> CONFIGURE tab and under connection strings sections add your actual connection strings with the same names as used in your web.config file, there the connection string are saved as encrypted strings.

该网站code将让你在Azure的门户网站设置了正确的连接字符串。

The website code will get the proper connection string you set in the Azure portal.

这篇关于在Azure的网站加密数据库连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 00:38