Search code examples
azureazure-active-directoryazure-sql-database

Setting Table level permissions on Azure SQL?


I have a requirement with a (supposedly) pre-existing item, where an Azure sync'd AD group "SQL Users" was granted read access to a database running in Azure.

Apparently, this group was assigned write permissions to specific tables in this database and it needs to be expanded to 3 more.

I'm fairly green to Azure, so I poked around and couldn't find any references to this group in the SQL instance at all, but did find it within the resource group with read permissions, but I can't seem to edit that at all.

Any ideas? I'm stuck.

Investigated SQL Instance for requested group Checked Azure shell for role assignments, found it there but didn't tell me anything about the existing read access.

What I need to achieve: Assign an Azure AD Group with existing read access, write access to specific tables in Azure SQL, preferably without things breaking :)


Solution

  • To assign an Azure AD Group with existing read access, write access to specific tables in Azure SQL, you can follow the procedure below:

    Set admin to Azure SQL database:

    Log in with admin into the SQL database and create a user using the command below:

    CREATE USER [ADadmin] FROM EXTERNAL PROVIDER
    

    Grant the required access using the command below:

    GRANT SELECT, INSERT, UPDATE, DELETE ON [Schema].[table] TO [ADadmin];
    

    Enter image description here

    After granting the permissions, group members will access the table as shown below:

    Enter image description here