Using Console
Using CLI
custom-role.json
) with the necessary permissions for database services. Here’s an example of a custom role JSON file that allows read access to databases and denies write access:
AssignableScopes
field with the appropriate subscription ID.
<custom_role_name>
with the name you provided in the custom role JSON file and <database_service_name>
with the name of the database service you want to assign the role to. Run the following command:
Using Python
<subscription_id>
with your Azure subscription ID in the code above. This code will remove any role assignments for the database services in Azure that have the ‘Contributor’ or ‘Owner’ role and are assigned to Service Principals or Users.