简体   繁体   English

如何将 Azure SQL 数据库连接到托管在不同服务器上的 ASP.NET 网站

[英]How to connect Azure SQL database to ASP.NET website hosted on a different server

I have created Sql database from Azure using my subscription.我使用我的订阅从 Azure 创建了 Sql 数据库。 I copied the connection string supplied with my credentials correctly into my code and it work in visual studio but when I deployed to my hosting server for my website it displays connection error.我将我的凭据提供的连接字符串正确复制到我的代码中,它在 Visual Studio 中工作,但是当我为我的网站部署到我的托管服务器时,它显示连接错误。 I have set IP range to accept all IP yet not working.我已将 IP 范围设置为接受所有 IP 但仍无法正常工作。

By default, (when you create a new DB), Azure blocks ALL traffic to your database.默认情况下,(当您创建新数据库时),Azure 会阻止到您的数据库的所有流量。 In order to allow traffic to your database either you need to whitelist all the IP address or the best suggestion in your case is to enable ' Allow access to Azure Services ' on the SQL Server settings.为了允许流量到您的数据库,您需要将所有 IP 地址列入白名单,或者在您的情况下,最好的建议是在服务器设置上启用“允许访问 Azure 服务”。 Find more details here 在此处查找更多详细信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM