Having issues adding an AAD group to Azure SQL Database.

Michael MacGregor 86 Reputation points
2022-01-26T22:25:36.107+00:00

We have an AAD group called [QA Leads]. I have no issues adding this group to a SQL Server on an Azure VM as [domain_name\QA Leads]. Works just fine, but if I try to do that in Azure SQL Database it gives me the following error:

Msg 33130, Level 16, State 1, Line 38
Principal 'domain_name\QA Leads' could not be found or this principal type is not supported.

I've seen several posts, including MS Docs, that say to use [username@domainname.com] but I don't know how that would work with an AAD group named QA Leads.

I tried simply doing this:

CREATE USER [QA Leads] FROM EXTERNAL PROVIDER WITH DEFAULT_SCHEMA=[dbo]

That appeared to work, except when one of the group members attempts to login he gets an error:

Login failed for user '<token-identified principal>'. (Microsoft SQL Server, Error: 18456)

Thanks in advance for any help.

Michael MacGregor
Database Architect

Azure SQL Database
No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Alberto Morillo 26,031 Reputation points MVP
    2022-01-26T23:18:20.91+00:00

    Please see more troubleshooting options on this support article.

  2. Michael MacGregor 86 Reputation points
    2022-01-27T19:59:49.557+00:00

    Turns out it was a mistake by the user who was testing the connection in that he entered the wrong database name in the Options tab in SSMS. Would be helpful if the error message provide actually said "Database does not exist'. Would've take a lot less time to figure out what was wrong!