1
votes

I use absolutely the same credentials and default settings to connect to a Azure SQL Database from my virtual machine with Windows Server 2012 R2 as those I use on my laptop with Windows 10. I do so with the same version of SQL Server Management Studio 2014.

I added both machines' IP's to the Azure SQL DB firewall rules.

The firewall on the VM is off.

I get perfect connection from my laptop with Win10, but whenever I'm on that VM with Windows Server I get this message in my SSMS:

Connect to Server

Cannot connect to <my_database>.database.windows.net.


ADDITIONAL INFORMATION:

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 connection could be made because the target machine actively refused it.) (Microsoft SQL Server, Error: 10061)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=10061&LinkId=20476


No connection could be made because the target machine actively refused it


What should I do to connect to that database from my VM with Windows Server? I googled a lot, tried some things like adding outbound rules to the Windows Server firewall for TCP/UDP/ports and trying different protocols in SSMS, but I'm out of ideas now.

2
Are you able to ping (ping -a) your SQL Azure server from the VM? If that is successful, are you able to telnet your SQL Azure Server using the ip address received from the ping command? Telnet IP 1433Alberto Morillo
@AlbertoMorillo How do I ping my SQL Azure server? I just tried to run ping <server>.database.windows.net in the command prompt, but it returns Pinging westeurope1-a.control.database.windows.net [some_IP] with 32 bytes of data: and then Request timed out 4 times on both of the machines (VM and laptop). The final line of the returned message says Ping statistics for <IP>: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),Sergey Zakharov

2 Answers

1
votes

The issue is then caused by the lack of basic connectivity from VM to SQL Azure. Make sure the virtual NIC card is mapped to a physical network card (WIFI or Ethernet) and is not configured NAT, Local Host Only or Private Network.

This article may be useful.

Hope this helps.

Regards,

Alberto Morillo

0
votes

This question is resolved. The problem was that only the inbound port 1433 was open for that virtual machine. After opening the outbound port 1433 for connection with my Azure server everything is working fine.

I know I wrote in the question that firewall on the VM was off, but I got information on that with the wf.msc command which was not relevant (there's a higher level firewall that is managed by system administrators).