none
Cannot Connect to SQL Azure from Azure Web Role RRS feed

  • Question

  • I have a RIA application that is working well locally in the Development fabric. It has an authentication database and another database both on SQL Azure. I've just migrated my Web Role to the cloud and the connectivity to both databases seems to be lost. Login times out and when I look at the exception with Fiddler it says "Unable to conntect to SQL Server database".

    Both databases are within the same server and the server Firewall setting allows both my development machine and Microsof Services to reach the database.

    The Web Role is within an Affinity group and I am quite sure that the SQL server is in the same affinity group although I can't figure out how to verify through the Portal UI.

    It seems like I am missing something really simple...

    Thanks,
    Don Rule

    Monday, June 21, 2010 10:38 PM

Answers

  • Hello, first of all, please make sure you're indeed tryting to connect to SQL Azure, not a local SQL Server database. For example, if you're using the Silverlight Business Application project template, you must modify the configuration as described in http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/a51097e3-3bc8-4c16-a60f-98d167ad3246, to disable local SQL Server, and enable SQL Azure. You can also try to disable all local SQL Server instances and test locally, to see if the application works.

    If you've made sure you're connecting to SQL Azure, please check the firewall settings again to make sure Microsoft Services are allowed to connect. If it still doesn't work, try to ping your Web Role to obtain the IP address, and then add an explicitly firewall rule to allow connection from the specific IP address. If this works, please report back, and let us know which data center is your Windows Azure/SQL Azure in.


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by Don-Rule Tuesday, June 22, 2010 7:40 PM
    Tuesday, June 22, 2010 2:37 AM

All replies

  • Hello, first of all, please make sure you're indeed tryting to connect to SQL Azure, not a local SQL Server database. For example, if you're using the Silverlight Business Application project template, you must modify the configuration as described in http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/a51097e3-3bc8-4c16-a60f-98d167ad3246, to disable local SQL Server, and enable SQL Azure. You can also try to disable all local SQL Server instances and test locally, to see if the application works.

    If you've made sure you're connecting to SQL Azure, please check the firewall settings again to make sure Microsoft Services are allowed to connect. If it still doesn't work, try to ping your Web Role to obtain the IP address, and then add an explicitly firewall rule to allow connection from the specific IP address. If this works, please report back, and let us know which data center is your Windows Azure/SQL Azure in.


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by Don-Rule Tuesday, June 22, 2010 7:40 PM
    Tuesday, June 22, 2010 2:37 AM
  • Perhaps you have tested. Did this work in the development fabric?

    Try to connect just to SQL Azure via a Client API.

    Try to verify if the authentication works with a simple file.


    mysorian
    Tuesday, June 22, 2010 2:41 AM
  • OK, there were two problems. The first is that "Allow Microsoft Services to Access this server" is not functional. I manually put in an entry for the server 70.37.104.245 and the data database worked. I suspect this is not a good final solution because the IP address of that web server could change. I will open the firewall to the whole subnet but I am betting that is not the ideal either.

    This entry http://social.msdn.microsoft.com/Forums/en/ssdsgetstarted/thread/cf3f1003-cc83-4607-bcf9-66f00766a43c implies that the RIPE database will tell you what address block the host is in but I either misunderstood the UI for the database search or it didn't work.

    I am still not sure exactly what the second issue was but I think it was that when I named my MembershpProvider name="SqlProvider" it ignored my connectionString. I suspect that the fact that SqlProvider is associated with the local sql server (In Machine Config ?) I was using the local SQL Express database without realizing it.

    Thanks Very Much,
    Don Rule

    Tuesday, June 22, 2010 7:40 PM
  • Have you tried a simple client API as a test to connect to SQL Azure(like using the ADO.NET Connections string or the ODBC string from the portal). Looks like you are using the aspnetdb of SQProvider. I would first try soem simple stuff to verify the connectivity is OK.


    mysorian

     

    Sorry, I did not see my previous post, exactly the same suggestion.

    Thursday, July 29, 2010 7:57 PM
  • I had the same issue recently and I had to manually add the IP of the web role's VM to SQL Azure's firewall settings.  The WindowsService rule did not work. 

    Windows Azure : West US datacenter
    SQL Azure: South Central US

    Hopefully, it will be fixed soon.

    Thursday, April 19, 2012 1:25 AM
  • I had the same issue recently and I had to manually add the IP of the web role's VM to SQL Azure's firewall settings.  The WindowsService rule did not work.

    Windows Azure : West US datacenter
    SQL Azure: South Central US

    Hopefully, it will be fixed soon.

    Thursday, April 19, 2012 1:26 AM
  • Hello!

    I have the same issue - i can't connect to sql azure from my webrole.

    I can connect to the server from managemeent portal, i can connect to the sql azure server from sql management studio at my laptop, i can connect to it from a console app that i just wrote to test connection string (from my laptop). But i get the following error 26 from SQL Network interfaces at application startup by first request:

    [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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +6351856
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +412
       System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) +6366442
       System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +180
       System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +6366853
       System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +6366729
       System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +352
       System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +831
       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +49
       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +6368534
       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +78
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +2194
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +89
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +6372046
       System.Data.SqlClient.SqlConnection.Open() +300
       System.Data.SqlClient.SqlProviderServices.UsingConnection(SqlConnection sqlConnection, Action`1 act) +132
       System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection sqlConnection, Action`1 act) +3981711
       System.Data.SqlClient.SqlProviderServices.GetDbProviderManifestToken(DbConnection connection) +10513833
       System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +44

    [ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.]
       System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +11122213
       System.Data.Entity.ModelConfiguration.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) +48

    [ProviderIncompatibleException: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct.]
       System.Data.Entity.ModelConfiguration.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) +242
       System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) +82
       System.Data.Entity.Infrastructure.EdmxWriter.WriteEdmx(DbContext context, XmlWriter writer) +242
       System.Data.Entity.Migrations.Extensions.DbContextExtensions.GetModel(Action`1 writeXml) +175
       System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration configuration, DbContext usersContext) +424
       System.Data.Entity.MigrateDatabaseToLatestVersion`2.InitializeDatabase(TContext context) +134
       System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +64

    [DataException: An exception occurred while initializing the database. See the InnerException for details.]
       System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +152
       System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +224
       System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input) +193
       System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action) +235
       BeeBroker2012.UI.MvcApplication.Application_Start() in {app_src_path}\Global.asax.cs:82

    [ApplicationException: Invalid connection string: Data Source=tcp:{serverid}.database.windows.net,1433;Initial Catalog={database_name};Integrated Security=False;User ID=sysadmin_login@{serverid};Password={password};Encrypt=True;Application Name=EntityFrameworkMUE]
       {project_name}.UI.MvcApplication.Application_Start() in {local_src_path}\Global.asax.cs:99

    [HttpException (0x80004005): Invalid connection string: Data Source=tcp:{serverid}.database.windows.net,1433;Initial Catalog={database_name};Integrated Security=False;User ID=sysadmin_login@{serverid};Password={password};Encrypt=True;Application Name=EntityFrameworkMUE]
       System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +4056837
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +191
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +352
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375

    [HttpException (0x80004005): Invalid connection string: Data Source=tcp:{}serverid.database.windows.net,1433;Initial Catalog={database_name};Integrated Security=False;User ID={sysadmin_login}@{serverid};Password={password};Encrypt=True;Application Name=EntityFrameworkMUE]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11700592
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4868789

    Wednesday, April 25, 2012 9:05 PM
  • Hi,

    @Giavinh, related to your problem I don't know exactly what's causing it, but I just want to clarify something that might help other readers that try to debug similar connection issues. The problem itself is not being caused by the fact that your web role is in data center and the database that you are trying to access is inside another. This is possible. I have just tested with a SQL Azure database in North Europe and a web role in West Europe. I can assume that in your case the problem might have been caused by a new range of IPs added to Azure that haven't yet propagated to the SQL Azure firewall settings. If this is the case I can only hope it will be fixed soon. By the way, there are already a few days from your post, did it start working for you?

    @KonstIsaev, your error doesn't seem to be firewall related. Below I have pasted a firewall related error when connecting to SQL Azure and it is different. Are you sure that the connection string in the app deployed to the web role is correct?

    [SqlException (0x80131904): Cannot open server 'xxxxxxxxx' requested by the login. Client with IP address 'xxx.xxx.xxx.xxx' is not allowed to access the server.  To enable access, use the SQL Azure Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range.  It may take up to five minutes for this change to take effect.
    Login failed for user 'xxxxxx'.
    This session has been assigned a tracing ID of 'xxxxxxxxxxxxxxxxxxxxxxxxx'.  Provide this tracing ID to customer support when you need assistance.]

    [Note: Proposed as an answer in the light of Evan's Basalik post]


    My technical blog: ducons.com/blog


    Thursday, April 26, 2012 12:12 AM
  • @KonstIsaev, your error doesn't seem to be firewall related. Below I have pasted a firewall related error when connecting to SQL Azure and it is different. Are you sure that the connection string in the app deployed to the web role is correct?

    I sure in this since i copy-pasted the string from management portal (and replaced password) into Microsoft Sql management Studio connection dialog (additional connection parameters tab) and it worked. I also cared specially about "Trusted_Connection=False;" and "Encrypt=True;" parameters today.

    Again copy-paste error messages here with connection stirng was verified 9002 times:

    [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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +6351856
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +412
       System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) +6366442
       System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +180
       System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +6366853
       System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +6366729
       System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +352
       System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +831
       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +49
       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +6368534
       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +78
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +2194
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +89
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +6372046
       System.Data.SqlClient.SqlConnection.Open() +300
       System.Data.SqlClient.SqlProviderServices.UsingConnection(SqlConnection sqlConnection, Action`1 act) +132
       System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection sqlConnection, Action`1 act) +3981711
       System.Data.SqlClient.SqlProviderServices.GetDbProviderManifestToken(DbConnection connection) +10513833
       System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +44
    
    [ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.]
       System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +11122213
       System.Data.Entity.ModelConfiguration.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) +48
    
    [ProviderIncompatibleException: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct.]
       System.Data.Entity.ModelConfiguration.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) +242
       System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) +82
       System.Data.Entity.Infrastructure.EdmxWriter.WriteEdmx(DbContext context, XmlWriter writer) +242
       System.Data.Entity.Migrations.Extensions.DbContextExtensions.GetModel(Action`1 writeXml) +175
       System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration configuration, DbContext usersContext) +424
       System.Data.Entity.MigrateDatabaseToLatestVersion`2.InitializeDatabase(TContext context) +134
       System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +64
    
    [DataException: An exception occurred while initializing the database. See the InnerException for details.]
       System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +152
       System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +224
       System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input) +193
       System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action) +235
       BeeBroker2012.UI.MvcApplication.Application_Start() in D:\Work\{appsrcpath}\Global.asax.cs:82
    
    [ApplicationException: Invalid connection string: Server=tcp:{serverid}.database.windows.net,1433;Database={database};User ID={userid}@{serverid};Password={password};Trusted_Connection=False;Encrypt=True;Application Name=EntityFrameworkMUE]
       BeeBroker2012.UI.MvcApplication.Application_Start() in D:\Work\{appsrcpath}\Global.asax.cs:99
    
    [HttpException (0x80004005): Invalid connection string: Server=tcp:{serverid}.database.windows.net,1433;Database={database};User ID={userid}@{serverid};Password={password};Trusted_Connection=False;Encrypt=True;Application Name=EntityFrameworkMUE]
       System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +4056837
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +191
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +352
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375
    
    [HttpException (0x80004005): Invalid connection string: Server=tcp:{serverid}.database.windows.net,1433;Database={database};User ID={userid}@{serverid};Password={password};Trusted_Connection=False;Encrypt=True;Application Name=EntityFrameworkMUE]   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11700592
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4868789

    I tryed to make a simple console app that just query tables count from Information_Schema of database and it worked with that connection string from my laptop (its IP was included into firewall rules).

    0.0.0.0 rule is present in firewal rules of server.

    I tryed to add another SQL Azure server and error repeats with it.

    I posted my question here since i feel that title of this thread is 146% matches to my current situation.

    Thanks for attention.



    • Edited by KonstIsaev Thursday, April 26, 2012 1:41 PM
    Thursday, April 26, 2012 10:12 AM
  • Hi KonstIsaev,

    Please edit your last post IMMEDIATELY since in the exception details it contains the connection string. I also strongly advise to change your login's password. If the data in your DB is sensitive you might also consider recreating the DB (so that a new name would be given to it).

    That being said, I have tried the very basic code below and it worked against your database. The test was made from the West Europe data center.

    string connectionString = "xxxxxxxxx";
    SqlConnection conn = new SqlConnection(connectionString);
    SqlCommand cmd = conn.CreateCommand();
    cmd.CommandText = "select 'test'";
    
    conn.Open();
    string result = cmd.ExecuteScalar().ToString();
    cmd.Dispose();
    conn.Dispose();
    
    ViewBag.Message = "Query executed: " + result;
    
    return View();


    My technical blog: ducons.com/blog


    Thursday, April 26, 2012 11:52 AM
  • Sorry folks - as someone earlier in the thread surmised, we missed a few IP ranges when we recently upgraded our datacenters, so even when you check "Allow Microsoft Services" your Windows Azure client still might not be able to get through the SQL Azure firewall.  :(

    Rest assured, though, we are fixing this very soon (if not already - I haven't checked the current deployment timeline) and you should be all set by this weekend.

    Evan

    P.S.  We are also putting some changes in our service to try to prevent this from happening again in the future.

    Thursday, April 26, 2012 12:34 PM
  • Please edit your last post IMMEDIATELY

    FlorinDumitrescu thanks for notice! I am not getinig any authomatic notificatons about replies from this forum via email. Is this forum supports such stuff?

    I am so frustrated with that badly connectvity of SQL Azure from webrole..

    My console app for conection testing is quite simular, it just different query - it selects count of tables from Infrmation_Schema.

    That my console utility was able to connect Sql Azure even from azure VM, but the webrole is not able to connect SqlAzure anyway.

    That makes me mad - second azured project pushes my face into corpsy aroma of unrecoverable and stupid error again, like first one...


    • Edited by KonstIsaev Thursday, April 26, 2012 2:18 PM
    Thursday, April 26, 2012 1:52 PM
  • Hi KonstIsaev,

    The forum's automatic replies work just fine for me. Do you have the Alert Me link checked on top of this thread (when this is the case, the link would display Remove Alert)? Anyway, this is a bit off topic.

    I am really sorry to hear about your problems. Personally, I have never had any connectivity problems to SQL Azure, but as it turns out they might happen on very rare occasions. As Evan pointed out, at the moment there might be some firewall problems on some of the Azure IPs. That is expected to be fixed very soon (by the weekend according to Evan).

    However, if I were you, I would try a few things even before the Azure fix becomes active:

    1. You say that you have a console application that from your PC connects with no problem to the database server. Try connecting with Remote Desktop Connection to one of your web role instances (details here), copy the console application on the instance and try to run it from there. If the application works, then the problem is to be found in your web app rather than in the web role.

    2. Manually add a firewall exception in SQL Azure for your web role's IP. Just for a short test you can even try to add an everyone exception 0.0.0.0 - 255.255.255.255.

    [PS: You can Vote As Helpful the posts that were useful to you ;) ]


    My technical blog: ducons.com/blog


    Thursday, April 26, 2012 2:18 PM
  • Hi, Florinn Dumetrescu.

    i just registered with liveid, but email address for notifications were empty somehow in profile.

    About your advicesL

    1) i tryed to say that i already did this.... I said this here:
    That my console utility was able to connect Sql Azure even from azure VM, but the webrole is not able to connect SqlAzure anyway.

    i meant the comute instance when said "azure VM".

    2) we tryed rule 0.0.0.0 - 0.0.0.0 and we even tryed rule 0.0.0.0 - 255.255.255.255 and it did not helped.

    3) we deleted sql azure server and added new SQL Azure server in Southeast Asia and this did not helped.

    4) we tryed to remove Encrypt=True parameter and it did not helped too.

    Last "weapon" i have - moving compute instances to SouthEast asia too.

    Will drop few lines when done.


    • Edited by KonstIsaev Thursday, April 26, 2012 3:37 PM
    Thursday, April 26, 2012 3:23 PM
  • Hi KonstIsaev,

    If the console app works fine from inside one of the instances inside the web role, then the web role itself has nothing to do with your problem. Your problem can only be somewhere in the web application that you are deploying to Azure.


    My technical blog: ducons.com/blog

    Thursday, April 26, 2012 4:01 PM
  • Yes, this is a problem of my appp.. deploying the all stuff at Southeast Asia did not help.

    I just trying to apply Code Migrations in EF Code first uisng UpgrateDatabaseToLatestVersion initializer at application startup.  But since this action fails with connectivity error message, on Db context initialization, i thought the problem is in my settings...

    Well, if i used DropAndCreateDatabase initializer than yes, i really making something illegal in terms of SQL Azure (changing database during connection). WTF? What should do to se TRUE ERROR MESSAGE? Kill my client inside the Stonehedge under the full moon at the friday 13th?

    By the way, i published the whole callstack, so, if somebody saw such thingy before...

    I don't like the

    "   System.Data.SqlClient.SqlConnection.Open() +300
       System.Data.SqlClient.SqlProviderServices.UsingConnection(SqlConnection sqlConnection, Action`1 act) +132
       System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection sqlConnection, Action`1 act) +3981711
       System.Data.SqlClient.SqlProviderServices.GetDbProviderManifestToken(DbConnection connection) +10513833
       System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +44"

    snippet, but it ends up like a new connection opened, with just "master" DB specified, not a "Use Master;" statement in current connection....

    Thursday, April 26, 2012 4:51 PM
  • Hi There Evan,

    I am having the same issues as discussed in this Post. I have an Azure cloud service running in South East Asia, and a SQL Azure LINKED DB to the Cloud service also in South East Asia.

    The "Allow Windows Azure Services" is set to YES.

    The error is the old: Cannot open server 'xxxxxx' requested by the login. Client with IP address
    'xxxxxx' is not allowed to access the server. To enable access....

    Friday, December 7, 2012 9:47 PM
  • DaleCorporation,

    Sigh - new Windows Azure IP addresses strikes again. I promise at some point I am going to get the various Azure product groups associated with this to build a better system for staying in synch. :)

    Are you still seeing this problem? If so, please drop me an email (evanba at Microsoft dot com) with the IP address which is getting the failure.

    Evan

    Saturday, December 8, 2012 2:11 PM
  • Is this problem solved? Or will be in the near future?

    We have two Azure subscriptions - one created about 2 years ago and second created this week. We have no problem with IP addresses for the first subscription, but for the new one there is a problem unfortunately  :(

    We have 6 cloud services (15 instances total) in the new subscription and for each instance I had to create firewall rule. 

    Regards,

    Dominika

    Wednesday, January 9, 2013 11:37 AM
  • We found a misconfiguration in our network configuration that was causing this. We rolled a fix out to East US on Friday, so you shouldn’t be seeing these problems anymore.

    Evan

    Sunday, January 13, 2013 7:08 PM
  • Unfortunately your fix did not help with my problem. I removed firewall rules from allowed ip addresses list and I start getting ‘Client with IP address XX.XX.XXX.XX is not allowed to access the server’.
    Monday, January 14, 2013 11:54 AM
  • We found another, related problem and rolled out a fix late last night. You should see this completely resolved at this point.
    Tuesday, January 15, 2013 7:14 PM
  • Evan,

    It seems that your second fix do the trick! Thank you!

    Regards,

    Dominika

    Tuesday, January 22, 2013 11:55 AM
  • I am experiencing this same problem in the US East region. Both my SQL Database and Web role VM are in the East region. I was unable to connect from the webrole to the database  until I added the web role vm's IP address to the list of allowed addresses even though Allow Windows Azure Services is Yes (on). Obviously this seems like a poor fix to add the IP address as I assume this is dynamic. How else can I address this issue?
    Friday, March 8, 2013 5:38 PM
  • On what IP address are you getting a failure?

    Sunday, March 10, 2013 6:44 PM
  • I having the same problem, it seems to have started Friday. Is there a resolution, or someone i can contact.

    thanks

    Monday, March 11, 2013 5:11 PM
  • Can one of the folks having this problem please provide a sample IP address that is failing?
    Monday, March 11, 2013 5:35 PM
  • sorry about that, I should haev posted the ip in question. 10.241.150.59 is one of my 7 instances. I've tried multiple deployments, but the ip range is always in the 10.241.150.X for me right now. This had been working last week fine.

    also another note that might be related, my RDP access stopped working as well, I checked with my it deparement as RDP is blocked by default, and they had added the east coast data center for me to allow through which had been working fine until friday. MY IP of my cloud service is now 137.117.x.x . which my it guy says is not in the east cost data center, or at least in the range he had added.

    thanks, i'd like to get to the bottom of this asap.

    Monday, March 11, 2013 5:58 PM
  • Yep - it looks like we missed that IP address range when Windows Azure added some new ones. I have notified the correct folks and we are working on fixing it.
    Tuesday, March 12, 2013 5:59 PM
  • thanks, I'll keep a watch.. I've worked around the problem for now, but manually adding my instances IPs in..
    Tuesday, March 12, 2013 6:43 PM
  • I'll confirm the 137.117.xxx.xxx firewall blockage from your web services.  As soon as the IP is confirmed I'll request this IP opened for Web Roles.  Until then I recommend adding this IP to your "allowed IPs" for your SQL Database.

    Thanks for bringing this to our attention.

    Chris Skorlinski
    Microsoft SQL Server Escalation Services


    Chris Skorlinski Microsoft SQL Server Escalation Services

    Tuesday, March 12, 2013 11:16 PM
  • It looks like 168.61.xxx.xxx range is also being blocked.  We'll work to get that IP range open to Web Roles.

    If your Windows Azure Web Roles are using 137.117.xxx.xxx or 168.61.xxx.xxx range you'll need to give them access via the SQL Database Management Portal.

    We'll be working over the next few days to get these IP ranges as automatic pass-through.

    Sorry for the troubles.

    Chris Skorlinski
    Microsoft SQL Server Escalation Services


    Chris Skorlinski Microsoft SQL Server Escalation Services

    Wednesday, March 13, 2013 9:44 PM
  • It looks like 168.61.xxx.xxx range is also being blocked.  We'll work to get that IP range open to Web Roles.

    If your Windows Azure Web Roles are using 137.117.xxx.xxx or 168.61.xxx.xxx range you'll need to give them access via the SQL Database Management Portal.

    We'll be working over the next few days to get these IP ranges as automatic pass-through.

    Sorry for the troubles.

    Chris Skorlinski
    Microsoft SQL Server Escalation Services


    Chris Skorlinski Microsoft SQL Server Escalation Services

    This is still broken. What's the deal? 137.117.xxx.xxx here... :-/

    Saturday, March 23, 2013 12:21 AM
  • It looks like 168.61.xxx.xxx range is also being blocked.  We'll work to get that IP range open to Web Roles.

    I'm running an Azure Web Site on 168.62.224.13 and also can't connect to my Azure SQL Database. Could this be the same problem? I've enabled Windows Azure Services in the SQL dashboard, as well as both my explicit IP and the 168.62.xxx.xxx range. Still not working.

    I am able to connect from my site running locally and from MSSQL Mgmt Studio, so it seems to be a firewall issue.

    Friday, April 26, 2013 8:48 AM
  • You know, a couple of EFFING months ago after losing a couple EFFING hours tracking down this issue, I stumbled on this EFFING thread and posted a not so nice EFFING message. After I cooled off a bit I deleted the EFFING message. Well, this EFFING issue his EFFING bit me in the EFFING ASS EFFING AGAIN.

    WHEN THE EFF ARE YOU EVER GOING TO EFFING FIX THIS SO IT DOESN'T KEEP EFFING BITING YOUR DEVELOPERS IN THE EFFING ASS?

    Saturday, May 4, 2013 12:00 AM
  • You know, a couple of EFFING months ago after losing a couple EFFING hours tracking down this issue, I stumbled on this EFFING thread and posted a not so nice EFFING message. After I cooled off a bit I deleted the EFFING message. Well, this EFFING issue his EFFING bit me in the EFFING ASS EFFING AGAIN.

    WHEN THE EFF ARE YOU EVER GOING TO EFFING FIX THIS SO IT DOESN'T KEEP EFFING BITING YOUR DEVELOPERS IN THE EFFING ASS?

    I'm EFFING with you, man. This is ridiculous that this has been going on for THREE YEARS!!
    Tuesday, May 7, 2013 9:53 AM