I have a SQL Server in my subscription with multiple databases. Each database corresponds to a client organization. I wanted to give each client read only access to their individual database without them being able to see the other databases.
For a single client,
I created a Group using Entra ID and added the external users to this group.
Set the SQL Server Microsoft Entra Admin
Then I logged into the client's database
Then I Used the Azure portal's Query Editor to manage client's database permissions.
I ran the following commands:
CREATE USER [ClientDBViewOnlyAccess] FOR EXTERNAL PROVIDER GO
ALTER ROLE db_datareader ADD MEMBER [ClientDBViewOnlyAccess] GO
where ClientDBViewOnlyAccess is the AAD group name
This successfully gave the group reader access at the database level.
However, after a user from the group logs into Azure, they do not see anything and get a message "You do not have any Azure subscriptions in the directory".
I figured this was because the group does not have permission at the resource / subscription level.
First I assigned reader role to the group at subscription level, but then they were able to see all resources including different ADFs etc which was unacceptable. I removed the role from the subscription level and assigned the reader role at the SQL server level to the group.
Now, they were able to login and see only the SQL server but they were also able to see the list of all the other databases other than their own. They were only able to login to their database, not the others.
What do i need to do to make sure that the group logs into Azure, goes to the SQL server but can only see their database and not the others.