Initial Connection to New SQL Database

Mark Carringer 21 Reputation points
2022-11-13T04:53:21.333+00:00

I just created an Azure SQL database following the steps on this page:

https://learn.microsoft.com/en-us/azure/azure-sql/database/free-sql-db-free-account-how-to-deploy?view=azuresql

I would like to use SSMS to connect to this database. The idea is simply to run queries against the AdventureWorks database.

I am trying to use the following connection parameters:

Server type: Database engine
Server name: mysqlserver1419857.database.windows.net
Authentication: Azure Active Directory - Universal with MFA
User name: (The same user name I am using to sign into Azure, which happens to match the name of my Gmail account.)

I have tried SQL Server Authentication as well. It has not worked yet. Am I anywhere near the neighborhood of getting this to work? The only user name and password that I am aware of are the ones I used to log into the Azure portal. There is a Server Admin named CloudSA21182071, but I never specified a password for it. There is an "Active Directory admin" for this server named "Azure Portal". (This last point differed from the steps on the website. I picked it because I did not know what else to pick.)

Azure SQL Database
0 comments No comments
{count} votes

Accepted answer
  1. Ronen Ariely 15,096 Reputation points
    2022-11-13T16:53:17.163+00:00

    Hi,

    When you create a new virtual Azure SQL Server, then you have option to configure the authentication method

    259779-image.png

    The default is to use "Use only Azure Active Directory (Azure AD) authentication"

    Which mean that you will not have option to connect using user name and password.

    This is the only issue which you had when using the first link. The first link instruct you how to create a database and not how to create the virtual server. During the procedure of creating the database you have option to select to use a new virtual server. In this case the default configuration of the server is to use the "Use only Azure Active Directory (Azure AD) authentication".

    This make no change. You did not need to delete the service but simply configure the virtual server to use "Use both SQL and Azure AD authentication". This can be done after the server already exists.

    All you need to do is to go the server -> click on the "Azure Active Directory" in the left menu

    259885-image.png

    Unmark the checkbox for "Support only Azure Active Directory authentication for this server" -> Click "save"

    Now, you just need to set the password of the admin and find his name.

    Since originally you did not set an admin name, the system created such for you. If you will go the server -> and move to the "overview" then you can see the server admin name

    259837-image.png

    Now, Clock on "reset password" on the upper menu of the page, and set the password to your admin

    That's it :-)

    you can use SSMS and connect using that admin

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Ronen Ariely 15,096 Reputation points
    2022-11-13T12:30:59.247+00:00

    Please follow the tutorial in this document:

    Quickstart: Use SSMS to connect to and query Azure SQL Database or Azure SQL Managed Instance

    https://learn.microsoft.com/azure/azure-sql/database/connect-query-ssms?view=azuresql&WT.mc_id=DP-MVP-5001699#get-server-connection-information

    1 person found this answer helpful.
    0 comments No comments

  2. Mark Carringer 21 Reputation points
    2022-11-13T16:04:16.947+00:00

    I deleted the server and database and re-created them according to this page:

    https://learn.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart?view=azuresql&tabs=azure-portal

    Which is simlilar but not identical to the page I indicated above. Fortunately, the second page worked.

    The key difference was that the second page allowed me to create a server admin with a password. The first page led to... something else that I didn't understand.

    I think that one of the main challenges with Azure is going to be selecting the correct documentation to follow.

    0 comments No comments