Unable to connect to Azure SQL DB from SSMS

Melinda DeSeranno 101 Reputation points
2021-03-07T21:18:05.28+00:00

I've set-up a new azure server and database. I've added my ip address to the firewall but none of my user ids are working to log in. I may be entering the wrong syntax.

Azure SQL Database
0 comments No comments
{count} vote

Accepted answer
  1. Melinda DeSeranno 101 Reputation points
    2021-03-08T17:31:49.21+00:00

    I was able to log in:

    I went to Home > SQL databases and clicked on the database in question. I checked the connection string listed there.

    My user id was different that the syntax I am used to it actually had me include the server name as part of my user id. For example
    my name@Stuff .com@my server name

    I also downloaded the sdks listed below for the various connections as well (ADO, OBDC etc).


3 additional answers

Sort by: Most helpful
  1. 2021-03-08T12:01:21.517+00:00

    Hi, You would also face this error if you do not provide the database name in the SSMS options ![75461-image.png][1] [1]: /api/attachments/75461-image.png?platform=QnA

    1 person found this answer helpful.

  2. Melinda DeSeranno 101 Reputation points
    2021-03-07T21:37:09.553+00:00

    Here is the specific error

    75116-image.png

    0 comments No comments

  3. Anurag Sharma 17,576 Reputation points
    2021-03-08T06:51:37.373+00:00

    Hi @Melinda DeSeranno , welcome to Microsoft Q&A forum.

    From the error message it looks the user you are trying to login with does not exist in the database. There are couple of ways to login to Azure SQL Database through SSMS:

    1). Use the admin credentials that were used to create the Azure SQL Server service. Please refer to below screenshot for the same. We provide the admin credentials as mentioned in yellow highlighted box. We can then use the same in the SSMS to login.

    75284-image.png

    2). Creating another user through below commands after you login to SSMS using admin credentials:

    --Run this in master database  
      
    CREATE LOGIN newuserlogin  
    WITH PASSWORD = 'password@123';  
    
    --Run this in database you want to create the login user in  
      
    CREATE USER newuserlogin  
    FROM LOGIN newuserlogin  
    WITH DEFAULT_SCHEMA=dbo;  
    

    After creating the login user you can use the same values for login again in SSMS. Also mention the database name where you created the user as shown in below screenshot:

    75452-image.png

    Please be notified that these will work only when you added the ip address to the firewall of Azure SQL Server. You can check the same like below:

    75218-image.png

    Please let me know if this helps or else we can discuss further.

    ----------

    If answer helps, please mark it 'Accept Answer'