Using Console
Using CLI
az login
and enter your credentials.
az role assignment list --all
which will list all the role assignments in your subscription.
principalId
value.
az role assignment delete --assignee <principalId> --role "Owner"
where <principalId>
is the value you noted in step 3.
az role assignment list --all
again and verifying that the role assignment has been removed.
Using Python
azure.identity
and azure.mgmt.authorization
modules to authenticate and access the Azure resources.
RoleAssignmentsOperations
class from the azure.mgmt.authorization
module to get the list of role assignments that have full administrator privileges. You can filter the role assignments based on the role_definition_id
property that corresponds to the built-in Owner
role.
RoleAssignmentsOperations
class to revoke the full administrator privileges from the users, groups, and applications that have them. You can use the delete_by_id
method to delete the role assignments.
<your-subscription-id>
with your actual subscription ID.