Interview Prep/Azure/Entra ID, RBAC and Identities

How do you write a custom RBAC role?

IntermediateConceptEntra ID, RBAC and Identities
Answer

Define actions, data actions and assignable scopes in JSON, then create it:

{
  "Name": "AKS Node Pool Scaler",
  "Description": "Scale AKS node pools only",
  "Actions": [
    "Microsoft.ContainerService/managedClusters/read",
    "Microsoft.ContainerService/managedClusters/agentPools/read",
    "Microsoft.ContainerService/managedClusters/agentPools/write"
  ],
  "NotActions": [],
  "DataActions": [],
  "AssignableScopes": ["/subscriptions/00000000-0000-0000-0000-000000000000"]
}
az role definition create --role-definition @aks-scaler.json
az provider operation show -n Microsoft.ContainerService -o table   # find action names

Custom roles are limited per tenant (5,000), so we create a few reusable ones rather than one per team.

Azure All Azure questions Roadmap: Azure core services

More on Entra ID, RBAC and Identities