Using Console
Using CLI
<principal_id>
with the ID of the principal you want to revoke the role from, <role_name>
with the name of the role you want to revoke, and <resource_scope>
with the appropriate scope (e.g., resource group, subscription, etc.).
Repeat this command for each unnecessary role assignment you identified in step 4.
Using Python
<your-subscription-id>
with your actual Azure subscription ID in step 4. Additionally, you can modify the role definition ID in step 5 to target different roles with infrastructure modification capabilities.Note: This solution assumes you have the necessary permissions to delete role assignments.