Connection
Setup
1
Create a service principal
2
Assign it a role
Assign User
Access Administrator, or Owner, on the management group, subscription or resource group Klef grants
access at. Either allows every action under Permissions; Reader allows only the reads.
3
Let it read the directory
Grant the app the Microsoft Graph application permission
User.Read.All, with admin consent, so a
policy can name users by sign-in name or email rather than by object ID.Permissions
- Read role assignments:
Microsoft.Authorization/roleAssignments/readandMicrosoft.Authorization/roleDefinitions/read. - Assign and remove roles:
Microsoft.Authorization/roleAssignments/writeandMicrosoft.Authorization/roleAssignments/delete. - Grant access that expires, which is optional:
Microsoft.Authorization/roleAssignmentSchedules/readandMicrosoft.Authorization/roleAssignmentScheduleRequests/write. - Make users eligible through Privileged Identity Management, which is optional unless the assignment mode is Eligible:
Microsoft.Authorization/roleEligibilitySchedules/readandMicrosoft.Authorization/roleEligibilityScheduleRequests/write. - Find users by sign-in name or email, which is optional: the Microsoft Graph application permission
User.Read.AllorDirectory.Read.All.