简体   繁体   English

如何在 SSMS 中连接到 Azure SQL DB

[英]How to connect to an Azure SQL DB in SSMS

I have been struggling to connect to my Azure SQL DB from Power BI and SSMS.我一直在努力从 Power BI 和 SSMS 连接到我的 Azure SQL DB。

I've configured the firewall settings for the server to include my client IP address, enabled 'Azure services and resources' and am able to query my database with both Azure AD and username and password.我已经为服务器配置了防火墙设置,包括我的客户端 IP 地址,启用了“Azure 服务和资源”,并且能够使用 Azure AD 以及用户名和密码查询我的数据库。

I've read that I should troubleshoot by running ping, telnet and tracert and it's failing to reach the server.我读过我应该通过运行 ping、telnet 和 tracert 进行故障排除,但它无法到达服务器。 I'm not sure of the next steps that I should take though.我不确定我应该采取的下一步措施。

My power BI error:我的电源 BI 错误:

在此处输入图像描述

My cmd output:我的 cmd output:

在此处输入图像描述

My ssms output:我的短信 output:

在此处输入图像描述

Is there something basic that I am missing?我缺少一些基本的东西吗? All of the tutorials I've read and watched seem to connect first time without an issue.我阅读和观看的所有教程似乎都是第一次连接没有问题。 I assume this is straightforward enough but I can't seem to find a solution anywhere.我认为这很简单,但我似乎无法在任何地方找到解决方案。

Any help and advice is much appreciated:)非常感谢任何帮助和建议:)

SSMS 17.2 version 14.0.17177.0 SSMS 17.2 版本 14.0.17177.0

If you have successfully configured your azure SQL to accept traffic from your IP then the issue seems to be with your local firewall blocking outbound connections如果您已成功配置 azure SQL 以接受来自 IP 的流量,那么问题似乎与您的本地防火墙阻止出站连接有关

Things I would try:我会尝试的事情:

  • From Azure Portal connect to your database and try to use the query editor online to see if you are able to connect从 Azure 门户连接到您的数据库并尝试使用在线查询编辑器查看您是否能够连接
  • Use https://www.whatismyip.com/ to verify your public IP matches the one that's on the Azure SQL configuration (your error doesn't indicate that the server blocked the connection but worth double checking anyway) Use https://www.whatismyip.com/ to verify your public IP matches the one that's on the Azure SQL configuration (your error doesn't indicate that the server blocked the connection but worth double checking anyway)
  • Lastly is to check from the local machine you are connecting that the "outbound" connection on port 1433 are not blocked.最后是从您正在连接的本地计算机检查端口 1433 上的“出站”连接是否未被阻止。 If you are connecting FROM an azure VM then you need to configure the NSG to allow outbound connection.如果您从 azure VM 连接,则需要配置 NSG 以允许出站连接。 If you are connecting from a local machine then you need to check if there's a local firewall or a VPN that's blocking this connection如果您从本地计算机连接,则需要检查是否有本地防火墙或 VPN 阻止此连接

From your description and the steps you described the last option above seems like the most likely scenario从您的描述和您描述的步骤来看,上面最后一个选项似乎是最有可能的情况

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

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