Microsoft Developer Network > Forums Home > Azure Forums > SQL Azure — Getting Started > Cannot open database requested by the login
Ask a questionAsk a question
 

AnswerCannot open database requested by the login

  • Thursday, November 05, 2009 7:34 PMdzruna Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I have a Silverlight 3\RIA application running on Windows Azure that cannot access the SQL Azure database. I'm getting the following error when it tries to connect:

    "Cannot open database *** requested by the login. The login failed. Login failed for user ***."

    Here is the connection string being used:

    connectionString="Server=tcp:[servername].database.windows.net;Database=VSICloud;User ID=vsi;Password=[password];Trusted_Connection=False;

    I have setup the firewall to allow Microsoft Services and added a rule for all outside address ranges by specifying 0.0.0.0 to 255.0.0.0 for each entry. I have been able to upload the schema and data to the Azure database via the SQL Azure Migration Wizard.

    My account for SQL Azure was screwed up somehow when I moved from the Aug to Oct CTP. MS has not been able to resolve the account problem and asked that I setup another account which I did. I now have a new SQL Azure account and have asked for a new Windows Azure token for this new account and have yet to receive it. Could this issue be caused by the two services (Windows Azure and SQL Azure) running under different user accounts (one on the old account and one on the new account)?

    I really want to like Azure and have convinced a lot of our customers to go this route but the experience of trying to rollout an application to Azure thus far has been extremely frustrating. Learning Silverlight 3, RIA Services and the Azure SDK in the last couple months has been a cakewalk compared to trying to roll this app out to Azure.

    Anyone else experiencing the same degree of frustration? Can anyone help me out?

    Thanks,
    Dan  

Answers

  • Friday, November 06, 2009 10:04 PMdzruna Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    I can connect to your master db fine. So it is your local firewall problem.

    When I try to connect to your VSICloud db though it connects me back to master for some reason. I might be a bug and is worth for guys from Microsoft to look at, do not delete the db yet.

    So there are two sugesstions:
    1. Open your local firewall.
    2. Create a new db and try to connect to it.

    Good luck with that.

    Vadim

    Hi Vaim,

    Thanks very much for checking that out. Yes, I am also able to connect to the master db. The issue is getting connected to my VSICloud db. Now that I know it is not just me I'll bring it to Microsoft's attention. Not sure why I'm having all of these issues.

    Thanks again,
    Dan

    Hey Vadim,

    I think I know what the issue is. I think the VSICloud database is corrupt. I created a new "Test" database and can access it just fine. This has me a little concerned about hosting critical data on SQL Azure. Should I just chalk this one up to CTP woes? Has anyone else out there had a database become corrupt and inaccessible?

    Dan 
    • Marked As Answer bydzruna Saturday, November 07, 2009 11:51 AM
    •  

All Replies

  • Thursday, November 05, 2009 9:26 PMazurehappy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Dan,

    I am sorry to hear about your frustration. I have MOSTLY positive experience with SQL Azure so far.

    Did you have to recreate your DB after moving to Oct CTP?
    Are you sure you created a user with that ID and assigned it to a role with connect privileges?

    Vadim
  • Friday, November 06, 2009 12:37 AMdzruna Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Vadim,

    When I moved to the Oct CTP everything was lost and I was instructed to setup a new account and start over which was fine by me. MS provided a new token for SQL Azure quickly but I'm still waiting for a new Windows Azure token. So, yes everything had to be recreated.

    Please clarify "Are you sure you created a user with that ID and assigned it to a role with connect privileges?". I think I missed something. I have only setup one initial administration account and am using those credentials to access the db from my app. Do I need to setup another ID and set privileges?

    Thanks,
    Dan
  • Friday, November 06, 2009 1:15 AMMeaning Of Lights Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    Hi Dan,

    "Do I need to setup another ID and set privileges?" No you can use the initial admin account.

    "MS provided a new token for SQL Azure quickly but I'm still waiting for a new Windows Azure token." - so you have not entered your new Windows Azure token ?

    If you haven't thats possibly the cause of the failure as your connection string looks right, given the dB is called VSICloud and exists and your Administrator Username is vsi

    I suspect that "one on the old account and one on the new account" probably isn't going to work, in general its best practice to make sure your on the same versions and service pack levels.


    HTH
    Jeremy - MCP | MCAD.Net | MCSD.Net
  • Friday, November 06, 2009 2:40 AMazurehappy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Dan,

    You do not have to, but it is not a good practice to connect as admin, that is why I was wondering if you connecting as another user.

    So your first Windows Azure account is OK, right?

    Vadim
  • Friday, November 06, 2009 3:01 AMdzruna Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Yes, the first Windows Azure account is ok and is hosting my Silverlight app.

    Dan
  • Friday, November 06, 2009 3:08 AMazurehappy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    And you can connect to you SQL Azure db running your app locally, correct?
  • Friday, November 06, 2009 3:53 AMazurehappy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I have just verified that I can connect to both of my Aug and Oct SQL Azure dbs through the same Windows Azure account. Aug CTP works a little slower, but still works.
  • Friday, November 06, 2009 4:52 AMazurehappy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I have just verified that I can connect to both of my SQL Azure dbs from a different Windows Azure account. Now I have my app hosted at 4 URLs connecting to 2 different databases, works perfectly. So the answer to question about not being able to connect because of a different account is FALSE.

    Dan, I am pretty much sure it is something on your side. Give me more details about how you connect to you data. Are you using WCF service, LINQ to SLQ, etc?
    Oh, I hope you noticed that it takes about a minute afters it says Ready and before your app can realy access data.

    Vadim
  • Friday, November 06, 2009 1:46 PMdzruna Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Running locally I cannot connect to the SQL Azure db in VS debug mode. I get the same message. If I use SSMS 2008 and try to connect (using the recommended procedure, Cancel, New query, SQL Azure db, etc.) and specify the VSICloud database it will only connect to the master db. In the SSMS dropdown list I can see the SQLCloud db listed but when I try to select it I receive a different error:

    "The database VSICloud is not accessible"

    The only way I have been able to successfully connect to this db is by using the SQL Azure Migration Wizard and a tool found online called SQL Azure Manager (hanssens.org). The funny thing is that these two programs use a different way of specifying the login name. They use the old format (from what I understand) which is [user@server]. I checked the online FAQ, (which needs to be updated) and it still recommends user@server in the sample connection string.

    I've noticed this morning that the SQL Azure site has been updated. There are some new features available. Perhaps the "Drop Server" button will clean up this issue.

    Thanks for your help,
    Dan
  • Friday, November 06, 2009 1:55 PMdzruna Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Also, good to know. I can take that out of the equation.

    We have a Silverlight 3 App using EF and RIA but see my earlier post - I can't even connect to the VSICloud db with SMSS. Also, awhile back we sucessfully ran an earlier iteration of this app on Azure\SQL Azure using the Aug CTP. All ____ broke loose, so to speak when we moved to the Oct CTP. (I have another post regarding that. MS suggested a new account which I've setup. Weird thing I found, which MS is looking into, is if you use an asterisk in your password the server does not initialize properly.)
  • Friday, November 06, 2009 5:33 PMazurehappy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    To connect to SQL AZURE database using SSMS make sure your LOCAL firewall allows connections on TCP 1433 and UDP 1434 . You can monitor connection attemps using netstat -an.

    Vadim

  • Friday, November 06, 2009 5:54 PMdzruna Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    To connect to SQL AZURE database using SSMS make sure your LOCAL firewall allows connections on TCP 1433 and UDP 1434 . You can monitor connection attemps using netstat -an.

    Vadim


    We use MS Threat Management Gateway and I've added a rule allowing TCP 1433 and UDP 1434 outbound traffic. Do you know if both inbound and outbound are needed?
  • Friday, November 06, 2009 7:03 PMazurehappy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I am pretty sure UDP needs inbound, not sure about TCP.
  • Friday, November 06, 2009 7:24 PMdzruna Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I am pretty sure UDP needs inbound, not sure about TCP.

    Hmm. Set it to inbound and outbound and still have the issue with SSMS.
  • Friday, November 06, 2009 7:28 PMazurehappy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Have you tried to connect from a different locaton such as home?  I can try to connect from my location if you would give the name of your db at vadim  _  a  _  sokolov at yahoo  dot com

    Vadim
  • Friday, November 06, 2009 7:37 PMdzruna Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Have you tried to connect from a different locaton such as home?  I can try to connect from my location if you would give the name of your db at vadim  _  a  _  sokolov at yahoo  dot com

    Vadim

    I have tried from my home office as well. I'll send you my connection string via email.
  • Friday, November 06, 2009 8:29 PMazurehappy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I can connect to your master db fine. So it is your local firewall problem.

    When I try to connect to your VSICloud db though it connects me back to master for some reason. I might be a bug and is worth for guys from Microsoft to look at, do not delete the db yet.

    So there are two sugesstions:
    1. Open your local firewall.
    2. Create a new db and try to connect to it.

    Good luck with that.

    Vadim
  • Friday, November 06, 2009 9:48 PMdzruna Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    I can connect to your master db fine. So it is your local firewall problem.

    When I try to connect to your VSICloud db though it connects me back to master for some reason. I might be a bug and is worth for guys from Microsoft to look at, do not delete the db yet.

    So there are two sugesstions:
    1. Open your local firewall.
    2. Create a new db and try to connect to it.

    Good luck with that.

    Vadim

    Hi Vaim,

    Thanks very much for checking that out. Yes, I am also able to connect to the master db. The issue is getting connected to my VSICloud db. Now that I know it is not just me I'll bring it to Microsoft's attention. Not sure why I'm having all of these issues.

    Thanks again,
    Dan
    • Proposed As Answer byazurehappy Friday, November 06, 2009 10:19 PM
    •  
  • Friday, November 06, 2009 10:04 PMdzruna Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    I can connect to your master db fine. So it is your local firewall problem.

    When I try to connect to your VSICloud db though it connects me back to master for some reason. I might be a bug and is worth for guys from Microsoft to look at, do not delete the db yet.

    So there are two sugesstions:
    1. Open your local firewall.
    2. Create a new db and try to connect to it.

    Good luck with that.

    Vadim

    Hi Vaim,

    Thanks very much for checking that out. Yes, I am also able to connect to the master db. The issue is getting connected to my VSICloud db. Now that I know it is not just me I'll bring it to Microsoft's attention. Not sure why I'm having all of these issues.

    Thanks again,
    Dan

    Hey Vadim,

    I think I know what the issue is. I think the VSICloud database is corrupt. I created a new "Test" database and can access it just fine. This has me a little concerned about hosting critical data on SQL Azure. Should I just chalk this one up to CTP woes? Has anyone else out there had a database become corrupt and inaccessible?

    Dan 
    • Marked As Answer bydzruna Saturday, November 07, 2009 11:51 AM
    •  
  • Saturday, November 07, 2009 6:11 AMahs101MSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Dan,

    I just look at this thread, please send me a private message with your server name and I will take a look. ahsaenz_at_microsoft_dot_com

    Thank you,
    Alejandro Hernandez.