Unable to connect from third party hosted web application to sql azure database
I'm attempting to connect a web application that is hosted on a third party web host (in this case, GoDaddy) without any success.  I'm not sure if it is a connection string issue or an sql azure permissions issue, but I'm hoping to find some advice.

The error I receive:<br/><br/>
<i>"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 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)"</i>

At the moment, the web application is nothing more that the ASP MVC Movie tutorial found <a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-cs">here</a>.  The GoDaddy hosting account is a grid hosting account (which does resolve to a single IP address) using asp.net 4.0.  

I can get the web application to pull data from an sql database set up on the third party host that mimics the sql azure database the I have created. I can also connect to the sql azure database using the web development server provided by Visual Studio 2010.  The issue arises when I try to connect the live site/application (on GoDaddy) to the SQL Azure database.

I have setup the firewall for the SQL Azure database to allow connections for (not using real IP's but you'll get the idea):

Microsoft services (0.0.0.0)<br/>
My local dev machine (87.187.187.87) <br/>
The IP address of the third party website (97.197.197.197)

I'm using the same connection string for Debug and Release which leads me to believe that the issue is not with that, but I've also allowed the IP address of the website; so I'm at a bit of a loss as to the cause of the issue.

Some connection strings the I have tried:


<strong>This one is based on reference strings I have seen on the Googles</strong><br/><br/>
Server=tcp:<i><strong>servername</strong></i>.database.windows.net;Database=myDatabase;Trusted_Connection=False;User ID=<i><strong>userName</strong></i>@<i><strong>servername</strong></i>;Password=<i><strong>password</strong></i>;MultipleActiveResultSets=True;Encrypt=True;

<strong>This one is using "Intial Catalog" instead of "Database" and some minor other differences</strong><br/><br/>
Server=tcp:<i><strong>servername</strong></i>.database.windows.net;Initial Catalog=myDatabase;Persist Security Info=True;User ID=<i><strong>userName</strong></i>@<i><strong>servername</strong></i>;Password=<i><strong>password</strong></i>;MultipleActiveResultSets=False;

<strong>This one drops the "@servername" from the User ID</strong><br/><br/>
Server=tcp:<i><strong>servername</strong></i>.database.windows.net;Database=myDatabase;Trusted_Connection=False;User ID=<i><strong>userName</strong></i>;Password=<i><strong>password</strong></i>;MultipleActiveResultSets=True;Encrypt=True;

I have used some others the don't use "tcp:" but that gets a named pipes error and I found out the I should use "tcp:" for sql azure connections. However, now I get a TCP error, so who knows whats right.

All of these connections strings work in my dev environment, but none of them work in a live environment.  I either have something very simple incorrect, or am completely oblivious to the fact that there is something fundamental impossible in the connection between a third party hosted web application and sql azure.

Any advice would be greatly appreciated.

Thanks.



Unable to connect from third party hosted web application to sql azure database
===

I'm attempting to connect a web application that is hosted on a third party web host (in this case, GoDaddy) without any success.  I'm not sure if it is a connection string issue or an sql azure permissions issue, but I'm hoping to find some advice.

The error I receive:<br/><br/>
<i>"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 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)"</i>

At the moment, the web application is nothing more that the ASP MVC Movie tutorial found <a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-cs">here</a>.  The GoDaddy hosting account is a grid hosting account (which does resolve to a single IP address) using asp.net 4.0.  

I can get the web application to pull data from an sql database set up on the third party host that mimics the sql azure database the I have created. I can also connect to the sql azure database using the web development server provided by Visual Studio 2010.  The issue arises when I try to connect the live site/application (on GoDaddy) to the SQL Azure database.

I have setup the firewall for the SQL Azure database to allow connections for (not using real IP's but you'll get the idea):

Microsoft services (0.0.0.0)<br/>
My local dev machine (87.187.187.87) <br/>
The IP address of the third party website (97.197.197.197)

I'm using the same connection string for Debug and Release which leads me to believe that the issue is not with that, but I've also allowed the IP address of the website; so I'm at a bit of a loss as to the cause of the issue.

Some connection strings the I have tried:


<strong>This one is based on reference strings I have seen on the Googles</strong><br/><br/>
Server=tcp:<i><strong>servername</strong></i>.database.windows.net;Database=myDatabase;Trusted_Connection=False;User ID=<i><strong>userName</strong></i>@<i><strong>servername</strong></i>;Password=<i><strong>password</strong></i>;MultipleActiveResultSets=True;Encrypt=True;

<strong>This one is using "Intial Catalog" instead of "Database" and some minor other differences</strong><br/><br/>
Server=tcp:<i><strong>servername</strong></i>.database.windows.net;Initial Catalog=myDatabase;Persist Security Info=True;User ID=<i><strong>userName</strong></i>@<i><strong>servername</strong></i>;Password=<i><strong>password</strong></i>;MultipleActiveResultSets=False;

<strong>This one drops the "@servername" from the User ID</strong><br/><br/>
Server=tcp:<i><strong>servername</strong></i>.database.windows.net;Database=myDatabase;Trusted_Connection=False;User ID=<i><strong>userName</strong></i>;Password=<i><strong>password</strong></i>;MultipleActiveResultSets=True;Encrypt=True;

I have used some others the don't use "tcp:" but that gets a named pipes error and I found out the I should use "tcp:" for sql azure connections. However, now I get a TCP error, so who knows whats right.

All of these connections strings work in my dev environment, but none of them work in a live environment.  I either have something very simple incorrect, or am completely oblivious to the fact that there is something fundamental impossible in the connection between a third party hosted web application and sql azure.

Any advice would be greatly appreciated.

Thanks.


