azureblog.co.uk
← cd ~/roles
// roles/azure · identity

Managed Identity OperatorAzure built-in role

Read and Assign User Assigned Identity

Role IDf1a07417-d97a-45cb-824c-7a7467783830
CategoryIdentity
Actions7
Data actions0

What it can do

PermissionWhat it allows
Microsoft.ManagedIdentity/userAssignedIdentities/*/readAny read operation on anything under Microsoft.ManagedIdentity/userAssignedIdentities
Microsoft.ManagedIdentity/userAssignedIdentities/*/assign/actionEvery operation matching Microsoft.ManagedIdentity/userAssignedIdentities/*/assign/action
Microsoft.Authorization/*/readAny read operation on anything under Microsoft.Authorization
Microsoft.Insights/alertRules/*Every operation under Microsoft.Insights/alertRules
Microsoft.Resources/subscriptions/resourceGroups/readGets or lists resource groups.
Microsoft.Resources/deployments/*Every operation under Microsoft.Resources/deployments
Microsoft.Support/*Every operation under Microsoft.Support

Assign it

Scope it as tightly as you can: a resource or resource group rather than the whole subscription.

azure cli
az role assignment create \
  --assignee "jane.doe@contoso.com" \
  --role "Managed Identity Operator" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Managed Identity Operator" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
  name: guid(resourceGroup().id, principalId, 'f1a07417-d97a-45cb-824c-7a7467783830')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'f1a07417-d97a-45cb-824c-7a7467783830')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "f1a07417-d97a-45cb-824c-7a7467783830"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other identity roles

Find the smallest role for a task →