Azure 连接字符串异常“发生与网络相关或特定于实例的错误”
尝试使用以下连接字符串连接到 SQL Azure 时
服务器=tcp:SERVER.database.windows.net,1433;数据库=DBNAME;用户ID=USER@SERVER;密码=PASSWORD;Trusted_Connection=False;Encrypt=True
从本地运行的 ASP.NET MVC 应用程序我收到此异常:
{“与网络相关或 发生特定于实例的错误 建立与 SQL 的连接 服务器。找不到服务器或 无法访问。验证 实例名称正确且 SQL 服务器配置为允许远程 连接。 (提供者:TCP 提供者, 错误:0 - 不知道这样的主机。)"}
我意识到这是一个相对通用的错误消息。
在解决问题时,我通过 Windows 防火墙在端口 1433 上打开了入站和出站流量:
netsh advfirewall 防火墙添加规则名称=“打开端口 80”dir=in 操作=允许协议=TCP localport=80
我已将 Azure 防火墙配置为接受来自我的 IP 地址的连接以及“允许其他 Windows Azure 服务访问此服务器” ”。我可以通过 SQL Server Management Studio 2008 R2 连接到 Azure 数据库。我无法通过以下方式远程登录到数据库
telnet SERVER.database.windows.net 1433
相关 Stack Overflow 问题:
我觉得我一定忽略了一些基本的东西。我还遗漏了其他故障排除步骤吗?
When attempting to connect to SQL Azure with the following connection string
Server=tcp:SERVER.database.windows.net,1433;Database=DBNAME;User ID=USER@SERVER;Password=PASSWORD;Trusted_Connection=False;Encrypt=True
from a locally running ASP.NET MVC application I receive this exception:
{"A network-related or
instance-specific error occurred while
establishing a connection to SQL
Server. The server was not found or
was not accessible. Verify that the
instance name is correct and that SQL
Server is configured to allow remote
connections. (provider: TCP Provider,
error: 0 - No such host is known.)"}
I realize this is a relatively generic error message.
In troubleshooting the problem I have opened inbound and outbound traffic through my Windows firewall on port 1433:
netsh advfirewall firewall add rule name=”Open Port 80” dir=in action=allow protocol=TCP localport=80
I have configured the Azure firewall to accept connections from my IP address as well to "Allow other Windows Azure services to access this server." I can connect to the Azure database via SQL Server Management Studio 2008 R2. I cannot telnet to the database via
telnet SERVER.database.windows.net 1433
Related Stack Overflow Questions:
I feel like I must be overlooking something basic. Are there other troubleshooting steps I have missed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不好意思地说,这个问题是因为我粗略地指认了服务器名称而引起的。显然,这些天我真的不擅长单独编程。感谢上面所有的评论,这些评论让我不断问自己我错过了什么。
Embarrassed to say that that this issue was caused because I fat fingered the server name. Apparently, I really am terrible at solitary programming these days. Thank you to all of the comments above which caused me to keep asking myself what am I missing.