Interview Prep/Azure/Identity and Authorization Errors

`(AuthorizationFailed) The client '[email protected]' with object id '1111...' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/write' over scope '/subscriptions/.../resourcegroups/rg-shop-dev' or the scope is invalid.`

BeginnerTroubleshootingIdentity and Authorization Errors
Answer

Likely causes → No role with that action at that scope (or above); a newly granted role not propagated yet; wrong subscription selected so the scope is different from what you think.

Diagnose →

az account show --query "{sub:id, user:user.name}"
az role assignment list --assignee <objectId> --all --include-inherited -o table

Fix →

  1. Confirm the subscription in the error matches your intended one; az account set if not
  2. Grant a role that includes the action at the right scope (Contributor on the subscription to create RGs, or pre-create the RG and grant Contributor on it)
  3. If just granted, wait a few minutes, then az logout && az login to refresh tokens

Prevent → Pre-create RGs in the platform pipeline and scope app identities to them.

Azure All Azure questions Roadmap: Azure core services

More on Identity and Authorization Errors