SQL Database Connectivity Troubleshooting

This guide helps you identify and resolve common connectivity issues when connecting to Azure SQL Database.

1. Verify Server Name and Credentials

Ensure you use the fully qualified server name ({your_server}.database.windows.net) and a valid login.

Server=tcp:<your_server>.database.windows.net,1433;
Initial Catalog=<your_database>;
Persist Security Info=False;
User ID=<username>;
Password=<password>;

2. Check Firewall Rules

Azure SQL Database blocks all traffic by default. Add client IP addresses or allow Azure services.

// Azure CLI example
az sql server firewall-rule create \
  --resource-group MyResourceGroup \
  --server myserver \
  --name AllowMyIP \
  --start-ip-address 203.0.113.5 \
  --end-ip-address 203.0.113.5

3. Verify Network Connectivity

Use telnet or nc to test the TCP port 1433.

# Linux
nc -vz myserver.database.windows.net 1433

# Windows
telnet myserver.database.windows.net 1433

4. Diagnose DNS Issues

Check that the DNS resolves correctly.

nslookup myserver.database.windows.net

5. Enable Transparent Network IP Resolution (TNIR)

Include the following in your connection string to allow automatic IP failover.

ColumnEncryptionSetting=Enabled;
ConnectRetryCount=3;
ConnectRetryInterval=10;

6. Common Error Codes

Error CodeDescription
18456Login failed. Check authentication method.
4060Cannot open database. Verify name and permissions.
10928/10929Resource limits reached. Scale up.

7. Use Azure Diagnose and Solve Problems

Navigate to the Azure portal, select your SQL server, and open Diagnose and solve problems for guided steps.

8. Further Reading