connection error when trying to connect to sql database via azure data studio

blubb 0 Reputation points
2024-03-13T10:01:28.0866667+00:00

I created an azure sql database and added my IP address to the firewall rules. In "Getting started" I use the button "Open Azure Data Studio" to connecto the database via Azure Data Studio. In Connection Details the Authentication type "SQL Login" is preselected. I type in my Azure Account credentials, user name and password, and click "Connect". Then I get the error:

Connection error

Cannot open server "XXXXXXX" requested by the login. The login failed.

What am I missing?

Azure SQL Database
Azure Data Studio
Azure Data Studio
A cross-platform database tool for data professionals using on-premises and cloud data platforms on Windows, macOS, and Linux.
103 questions
{count} votes

5 answers

Sort by: Most helpful
  1. ShaktiSingh-MSFT 14,086 Reputation points Microsoft Employee
    2024-03-13T10:53:13.7433333+00:00

    Hi blubb •,

    Welcome to Microsoft Q&A forum.

    As I understand, you could not connect to Azure SQL Database using Azure Data Studio.

    You have mentioned that IP address is added, and authentication type selected is SQL Login.

    Please check if the SQL Server name is given correctly:

    User's image

    Try to update Azure Data Studio to the latest version if not already done.

    Let us know if you are unable to connect with screenshots and server configuration details so that we can check at our end.

    Awaiting your reply.

    Thanks

    0 comments No comments

  2. ShaktiSingh-MSFT 14,086 Reputation points Microsoft Employee
    2024-03-14T15:30:52.1266667+00:00

    Hi blubb

    Thanks for replying.

    Could you please ensure that server name is correctly present if Input Type is selected as Parameters with "servername.database.windows.net".

    Also, please try once using Connection String option of Input Type if that works.

    Thanks

    0 comments No comments

  3. Olaf Helper 41,971 Reputation points
    2024-03-14T17:42:59.8866667+00:00

    "SQL Login" is preselected. I type in my Azure Account credentials

    Your "Azure Account credentials" aren't the SQL Login credentials, that's why login fails.

    Use the SQL account defined during database creating and create a SQL login.

    https://learn.microsoft.com/en-us/sql/relational-databases/security/authentication-access/create-a-login?view=sql-server-ver16


  4. blubb 0 Reputation points
    2024-03-14T22:24:14.69+00:00

    It works using Authentication mode "Microsoft Entra MFA" in SSMS or "Microsoft Entra ID - Universal with MFA support" in Azure Data Studio. As Olaf Helper mentioned above, you need to create a new SQL Login to be able to connect to the database using "SQL Login" as authentication mode. But I haven't been successful yet in doing so.

    0 comments No comments

  5. ShaktiSingh-MSFT 14,086 Reputation points Microsoft Employee
    2024-03-18T04:38:52.86+00:00

    Hi blubb

    This is strange.

    Could you please post the details over the link here: https://github.com/microsoft/azuredatastudio/issues

    Or else please raise support case for more analysis and assistance.

    Thanks

    0 comments No comments