When attempting to connect to SQL Azure with the following connection string
Server=tcp:SERVER.database.windows.net,1433;Database=DBNAME;User ID=USER@SERVER;Password=PASSWORD;Trusted_Connection=False;Encrypt=True
from a locally running ASP.NET MVC application I receive this exception:
{"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 such host is known.)"}
I realize this is a relatively generic error message.
In troubleshooting the problem I have opened inbound and outbound traffic through my Windows firewall on port 1433:
netsh advfirewall firewall add rule name=”Open Port 80” dir=in action=allow protocol=TCP localport=80
I have configured the Azure firewall to accept connections from my IP address as well to "Allow other Windows Azure services to access this server." I can connect to the Azure database via SQL Server Management Studio 2008 R2. I cannot telnet to the database via
telnet SERVER.database.windows.net 1433
Related Stack Overflow Questions:
I feel like I must be overlooking something basic. Are there other troubleshooting steps I have missed?
Embarrassed to say that that this issue was caused because I fat fingered the server name. Apparently, I really am terrible at solitary programming these days. Thank you to all of the comments above which caused me to keep asking myself what am I missing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With