Interview Prep/Azure/Identity and Authorization Errors

`PrincipalNotFound: Principal 3333... does not exist in the directory <tenantId>.` when Terraform creates a role assignment for a new identity.

IntermediateTroubleshootingIdentity and Authorization Errors
Answer

Likely causes → Entra replication lag: the identity was just created and ARM's lookup can't see it yet.

Diagnose → Re-run after a minute; it usually succeeds, which confirms replication delay.

Fix →

  1. In Terraform, set skip_service_principal_aad_check = true on azurerm_role_assignment for service principals and managed identities
  2. In CLI, pass --assignee-object-id &lt;id> --assignee-principal-type ServicePrincipal

Prevent → Always specify principal type for newly created identities.

Azure All Azure questions Roadmap: Azure core services

More on Identity and Authorization Errors