5

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?

6
  • You checked the information available on MSDN? Commented Jun 2, 2011 at 8:34
  • @DOK I've looked through a lot of the information on MSDN, the article you are specifically referencing seems to be about Azure services and not SQL-Azure, am I missing something? Commented Jun 2, 2011 at 13:02
  • @Aaronontheweb tried switching to encrypted=False, didn't make a difference. :( Commented Jun 2, 2011 at 13:02
  • Do you have a proxy between you and web? I have seen that some proxies block TCP traffic that is not running as the user. Since web sites run as app pool identity, it gets blocked sometimes. Commented Jun 2, 2011 at 15:49
  • also, if you have a proxy, TCP proxy may have a different IP address than your HTTP proxy. Make sure that SQL Azure has the correct IP address in its firewall Commented Jun 2, 2011 at 19:09

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

It's always the server name, I faced the same issue few times. Since Azure db's have complex names, it can go wrong in many ways like mistyping, copying part of it etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.