简体   繁体   中英

Create SQL Login for Azure Active Directory User

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 ?

See here: https://docs.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 [alice@fabrikam.onmicrosoft.com] FROM EXTERNAL PROVIDER;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM