az role assignment create
command to assign a role to the user or service principal.az role assignment create --assignee <principal-id> --role <role-name>
az ad sp pim create
command to create a PIM role assignment for the user or service principal.az ad sp pim create --id <principal-id> --role <role-name>
az monitor activity-log list
command to retrieve activity logs related to access management.az monitor activity-log list --resource-group <resource-group-name> --resource-type Microsoft.Authorization/roleAssignments
<subscription_id>
, <scope>
, <role_assignment_name>
, <role_definition_id>
, <principal_id>
, <role_assignment_id>
) with the actual values specific to your Azure environment.