I'm baffled. I'm trying to connect to an Azure SQL database (managed, not a VM) from an Azure VM running Ubuntu. I'm using python FreeTDS ODBC with a connection string that looks like:
Driver=FreeTDS;Server=mycompany.database.windows.net;Database=mydbname;UID=myusername;PWD=secret;Port=1433;Timeout=30
When I try to connect from the ubuntu VM I get a timeout:
[FreeTDS][SQL Server]Timeout expired (0) (SQLDriverConnect)
It doesn't matter what kind of timeout parameters I supply, either in the connection string or in the pyodbc connect() arguments. The timeout happens in about a second, not thirty.
I can telnet to the server on 1433 and something answers, from both my local machine and the VM. I can ping it from the VM but not from my local machine. The hostname resolves to the same IP on the VM and my local machine.
Here's the crazy thing - it works on my local machine. In fact, if I use ssh tunneling to route the Azure VM THROUGH my local machine, it WORKS, with the same exact connection string.
At this point, I've tried adding a temporary allow 0/32 on the Azure VM's firewall just to rule it out. There's no difference.
I'm sure there's some checkbox or something I'm missing on the Azure side, but I can't figure it out! I've checked the "Allow Azure services to access this resource" or whatever on the SQL instance.
Hoping someone can point out what I'm missing!