Principal ID (Object ID)
The tenant-local service principal object ID used to assign Azure permissions to a managed identity or application.
Learning status: Not practiced
The moving parts
For a managed identity, principalId is the object ID of its Microsoft Entra service principal. Azure RBAC role assignments target this principal, not the Kubernetes service account.
For an app registration, use the Object ID of the enterprise application (service principal) in the resource's tenant. The app registration also has its own object ID; that application object ID is not the service principal ID used for Azure RBAC. An application can have service principals in multiple tenants, each with a different object ID.
Find the principal
For a user-assigned managed identity:
az identity show \
--resource-group <resource-group> \
--name <identity-name> \
--query principalId \
--output tsv
For an Entra application, query its service principal in the currently selected tenant:
az ad sp show --id <application-client-id> --query id --output tsv
Assign permissions
For example, grant the identity permission to read secrets at a specific RBAC-enabled Key Vault:
az role assignment create \
--assignee-object-id <principal-id> \
--assignee-principal-type ServicePrincipal \
--role "Key Vault Secrets User" \
--scope <key-vault-resource-id>
Creating a role assignment requires appropriate role-assignment permissions at that scope. Use the narrowest suitable scope and role.
The client ID selects the identity during authentication. The principal ID identifies the tenant-local identity that receives permissions. Neither value is a secret, and neither replaces the federated identity credential.
Sources: Application and service principal objects, Assign Azure roles using Azure CLI.
Connects to