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.
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).