Unable to create AD group LOGIN on Azure SQL

agammar 26 Reputation points
2022-07-12T10:50:58.547+00:00

Hello.
I have a Azure AD Group called "testgroup@X .at"
Issuing:
CREATE LOGIN [testgroup@X .at] FROM EXTERNAL PROVIDER;

throws an error:
Msg 33130, Level 16, State 1, Line 23
Principal 'testgroup@X .at' could not be found or this principal type is not supported.

CREATE LOGIN [testuser@X .at] FROM EXTERNAL PROVIDER;
works though.

This is also not working:
CREATE LOGIN [testgroup_XXX.at#EXT#@X .onmicrosoft.com] FROM EXTERNAL PROVIDER

I want to have a LOGIN/USER for all the members of the group.
Any idea why it's not working?

Azure SQL Database
0 comments No comments
{count} vote

Accepted answer
  1. Alberto Morillo 34,461 Reputation points MVP
    2022-07-12T11:08:47.467+00:00

    Try this:

    CREATE USER [testgroup] FROM EXTERNAL PROVIDER WITH DEFAULT_SCHEMA=[dbo]  
    

    Make sure users specify the database name when getting connected to the database.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.