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

Azure Kubernetes Service Contributor RoleAzure built-in role

Grants access to read and write Azure Kubernetes Service clusters

Role IDed7f3fbd-7b88-4dd4-9017-9adb7ce333f8
CategoryContainers
Actions9
Data actions0

What it can do

PermissionWhat it allows
Microsoft.Authorization/*/readAny read operation on anything under Microsoft.Authorization
Microsoft.ContainerService/locations/*Every operation under Microsoft.ContainerService/locations
Microsoft.ContainerService/managedClusters/*Every operation under Microsoft.ContainerService/managedClusters
Microsoft.ContainerService/managedclustersnapshots/*Every operation under Microsoft.ContainerService/managedclustersnapshots
Microsoft.ContainerService/snapshots/*Every operation under Microsoft.ContainerService/snapshots
Microsoft.Insights/alertRules/*Every operation under Microsoft.Insights/alertRules
Microsoft.Resources/deployments/*Every operation under Microsoft.Resources/deployments
Microsoft.Resources/subscriptions/resourceGroups/readGets or lists resource groups.
Microsoft.ContainerService/deploymentSafeguards/*Every operation under Microsoft.ContainerService/deploymentSafeguards

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 "Azure Kubernetes Service Contributor Role" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Azure Kubernetes Service Contributor Role" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
  name: guid(resourceGroup().id, principalId, 'ed7f3fbd-7b88-4dd4-9017-9adb7ce333f8')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ed7f3fbd-7b88-4dd4-9017-9adb7ce333f8')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "ed7f3fbd-7b88-4dd4-9017-9adb7ce333f8"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other containers roles

Find the smallest role for a task →