Blog Post

Azure Database Support Blog
1 MIN READ

Lesson Learned #23: How to add AAD Security Groups to Azure SQL Database?

Jose_Manuel_Jurado's avatar
Mar 14, 2019

First published on MSDN on Mar 10, 2017
In these days, we are receiving multiples cases where our customer needs to add Azure SQL Database groups from Azure Active Directory.

This is an example to how to archive it.

  • Using the Portal in Azure:

    • I created a user called SQLMember.
    • I created a group called SQLGroup, adding the member SQLMember.

 

 

  • Running SELECT * FROM SYS.DATABASE_PRINCIPALS we could see that the group has been created in Azure SQL Database

 

 

  • Finally, I disconnected from SQL Server Management Studio and I connect again using the user SQLMember@mydomain.com to the database and I was able to connect without issue, applying the read-only permissions for the database

 

Updated Nov 03, 2020
Version 3.0

4 Comments

  • Matt_LM's avatar
    Matt_LM
    Copper Contributor

    if you add a user to the active directory group after you've created an azure db user for that group does it still work?

  • astanton1978 yes, because he created the user using the FROM EXTERNAL PROVIDER, meaning its not a SQL login, and is signing in using "SQLMember@mydomain.com". This is a domain user. 

    Also the title indicates that the group is an AAD objects. 

    He is being quite clear about it. 

  • astanton1978's avatar
    astanton1978
    Brass Contributor

    Did you create the user in Azure Active Directory or SQL?
    Same for the Group?