Having trouble connecting to Azure SQL Database or Azure SQL Managed Instance? This guide walks you through the most common connection issues and how to resolve them.
Ensure the client IP is allowed in the server firewall. You can add rules via the Azure portal, PowerShell, or CLI.
az sql server firewall-rule create --resource-group MyResourceGroup --server myserver --name AllowMyIP --start-ip 203.0.113.5 --end-ip 203.0.113.5
Verify the format matches the driver you are using. Example for ADO.NET:
Server=tcp:myserver.database.windows.net,1433;Initial Catalog=mydb;Persist Security Info=False;User ID=myuser;Password=MyP@ssw0rd;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
Check that Encrypt=True
and TrustServerCertificate=False
are set.
Azure SQL endpoints resolve to multiple IPs. Ensure your network allows outbound traffic to *.database.windows.net
over TCP/443 and TCP/1433.
If using custom DNS, verify that records are not cached incorrectly.
Azure SQL requires TLS 1.2. Update your client libraries or OS to support TLS 1.2.
On Windows, enable TLS 1.2 via registry:
reg add "HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\TLS 1.2\\Client" /v Enabled /t REG_DWORD /d 1 /f
If you are behind a corporate proxy, ensure the proxy allows traffic to Azure SQL endpoints.
For VPNs, verify that split tunneling includes the Azure SQL IP ranges.
Exceeding the max concurrent connections can cause failures. Monitor using Azure Monitor or Query Performance Insight.
Scale up the service tier if needed.