Azure SQL Database, Azure SQL Managed Instance, Microsoft SQL Server

Connect to your database using a tool like the Microsoft SQL Server Management Studio, and execute the following query. Note that the <entra_sp_name> should be replaced with the name of the Microsoft Entra Managed Identity or the Microsoft Entra Service Principal, depending on which authentication method you are using.

CREATE USER [<entra_sp_name>] FROM EXTERNAL PROVIDER;
 
ALTER ROLE db_datareader ADD MEMBER [<entra_sp_name>];
ALTER ROLE db_datawriter ADD MEMBER [<entra_sp_name>];

Last updated