Can't connect to SQL Azure from Webrole (Trial Account)

I've opened the Firewall. I've copied the connection string from the portal and I get:
============

[Win32Exception (0x80004005): The network path was not found]

[SqlException (0x80131904): 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +6676046

==========


I've tried to Telnet to the SQL Instance and it times out:


Microsoft Telnet> open
 ( to ) Xb4xfv7wau.database.windows.net 1433
 Connecting To tb4xfv7wau.database.windows.net...

 Connection to host lost.

===========

Cannot open database "TheDatabase" requested by the login. The login failed.
 Login failed for user 'TheUser'.
 This session has been assigned a tracing ID of 'c51a78da-ac12-4385-b35a-ca4b28e55063'.  Provide this tracing ID to customer support when you need assistance.

===========

May 31st, 2013 11:23pm

Hi,

try connecting to sql server using sql management studio with the username and password you have, it will isolate issue to sql server or other systems involved.

Free Windows Admin Tool Kit Click here and download it now
May 31st, 2013 11:42pm

I have connected using SQL Mgmt Studio using the same credentials... that's what's throwing me for a loop. It's only from the Webrole to the SQL Instance that the connection string doesn't work. Absurd isn't it?
May 31st, 2013 11:46pm

it is absurd, i would try following just to ensure you can hit with the connection string to the sql server

create a small c# console app and connect to your azure sql database using that same connection string and see if it that works, if that works we can safely say sql server is not the troublemaker here, and then we troubleshoot your webrole, 

in parallel ensure that connection string in webrole is in the cloud config file (i make mistakes myself putting the connection information in local config)

Free Windows Admin Tool Kit Click here and download it now
May 31st, 2013 11:59pm

Hi,

Since the issue is related to SQL Azure, I have moved this thread to SQL Azure forum for getting a better support.

Thanks for your understanding.

June 3rd, 2013 5:49am

Qin,

Thanks, but that's where I originally posted the question. Have you seen the amount of Orange "?" bubbles in that forum? No one in MS really cares about it. That's why I posted it in the App Dev forum. Can you move it back please? Otherwise, it will just sit and not get any response.

R

Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2013 8:01pm

Question: I am under a 3 month trial... Could this be affecting the connection?

June 3rd, 2013 10:18pm

Hi,

first of all my sincere apologies, MS cares for every single community member and all the questions that are asked here on forum, they have dedicated support in most cases (if not all) to monitor these forums, some times people who know the specific area in question do not get time to look at it...but that's why we are all here :)

anyways.. coming to your question, no a 3 month trial should not affect your connection, in fact i tested my websites on azure using a 3 month trial and everything worked like a charm now its a prod site.

did you ever get a chance to create a c# console app to connect to your sql server as i suggested earlier, this will eliminate sql azure as the root cause, also double check that your connection string in the cloud.config file looks correct.. just as a quick test you can also run your webrole locally in the azure emulator and still point to to sql azure database to debug if the connection with sql azure is the issue.

---------------------------

Please mark as answered if it helped

Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2013 11:24pm

        static void Main(string[] args)
        {
            SqlConnection cn = new SqlConnection();
            cn.ConnectionString = "Server=tcp:abcabcabc.database.windows.net,1433;Database=TheDatabase;User ID=TheUser;Password=ThePassword;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;";

            try
            {
                cn.Open();
                Console.WriteLine("cn.Open()");
            }
            catch (Exception ex)
            {
                Console.WriteLine("catch (Exception ex)");
                Console.WriteLine(ex.Message);
            }
            finally
            {
                Console.WriteLine("cn.Close()");
                cn.Close();
            }
            Console.ReadLine();
        }

===============

catch (Exception ex)

Cannot open database "TheDatabase" requested by the login. The login failed.
Login failed for user 'TheUser'.
This session has been assigned a tracing ID of '29268322-f00e-4151-a584-75179798
b327'.  Provide this tracing ID to customer support when you need assistance.
cn.Close()

=============

Same issue

 


June 4th, 2013 4:20am

Gawd!!!!!!!!!!!! Arg............ Drat........... My connection string Database name was off by one character! !!!!

I'm in now.... Pft...

Thanks for your help (all) :>

Free Windows Admin Tool Kit Click here and download it now
June 4th, 2013 4:24am

you  are very welcome :) 

-----------------------------------------------

please mark the post as answered if my post helped

June 4th, 2013 4:29am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics