adding new users to Azure database Microsoft SQL Server Error: 18456)

Vineyard, Mr. Scotty 1 Reputation point
2023-01-26T14:10:11.8+00:00

We have a couple of users that would like access to the Azure data warehouse but after creating the users in the database (using Azure active directory for authentication) they are getting an authorization error. (Microsoft SQL Server Error: 18456)

We added the users as contributors to the Azure SQL Server and the users were created using the external provider option

CREATE USER [email] FROM EXTERNAL PROVIDER;

We are new at this so I think we missed a step somewhere but we are not sure where. Thanks in advance for any assistance.

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
719 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leandro Ezequiel Molinari 26 Reputation points
    2023-01-26T14:31:49.98+00:00

    Hi Vineyard, how are you?

    It seems that is missing the step to add permissions over the database, after creating the contained user. You can see below example commands:

    EXEC sp_addrolemember N'db_datareader', <user>'

    EXEC sp_addrolemember N'db_datawriter, <user>'

    I hope this can help.

    Greetings.

    1 person found this answer helpful.
    0 comments No comments