Interview Prep/Azure/Identity and Authorization Errors

AKS `kubectl get pods` returns `Error from server (Forbidden): pods is forbidden: User "[email protected]" cannot list resource "pods" in API group "" in the namespace "shop": User does not have access to the resource in Azure. Update role assignment to allow access.`

BeginnerTroubleshootingIdentity and Authorization Errors
Answer

Likely causes → Azure RBAC for Kubernetes is enabled and the user has no AKS RBAC role at the cluster or namespace scope.

Diagnose →

az role assignment list --assignee [email protected] --scope $(az aks show -g rg -n aks --query id -o tsv) --include-inherited -o table

Fix →

az role assignment create --assignee [email protected] --role "Azure Kubernetes Service RBAC Reader" \
  --scope "$(az aks show -g rg -n aks --query id -o tsv)/namespaces/shop"

Prevent → Grant namespace roles to groups as part of namespace onboarding.

Azure All Azure questions Roadmap: Azure core services

More on Identity and Authorization Errors