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.
ping <server>.database.windows.net
in the command prompt, but it returnsPinging westeurope1-a.control.database.windows.net [some_IP] with 32 bytes of data:
and thenRequest timed out
4 times on both of the machines (VM and laptop). The final line of the returned message saysPing statistics for <IP>: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
– Sergey Zakharov