Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create SQL Login for Azure Active Directory User

Tags:

azure

Problem : Configure Azure SQL DB so Azure AD Users can login to the server using SSMS, and be authenticated.

The Normal Process to configure a User in SQL is

  • Create Login
  • Create Users
  • Assign Roles

However, I am not able to create Login in a way that Password does not need to be specified, and the user can Login.

Do I need to use this command ? ' CREATE LOGIN login_name [FROM EXTERNAL PROVIDER] { WITH [,..]}

<option_list> ::=
    PASSWORD = {'password'}
    | SID = sid
    | DEFAULT_DATABASE = database
    | DEFAULT_LANGUAGE = language 

' How can we do this without having to create a password, since it will be Azure Active Directory Integrated ?

like image 888
omi Avatar asked Nov 03 '25 22:11

omi


1 Answers

See here: https://learn.microsoft.com/en-us/azure/sql-database/sql-database-aad-authentication-configure#create-contained-database-users-in-your-database-mapped-to-azure-ad-identities

The command is

CREATE USER <Azure_AD_principal_name> FROM EXTERNAL PROVIDER;

For example:

CREATE USER [[email protected]] FROM EXTERNAL PROVIDER;
like image 104
silent Avatar answered Nov 07 '25 16:11

silent