OAuth Token Scopes and Audiences
Distinguish the API a pod requests a token for, the audience of its federated assertion, and the Azure resource scope of a role assignment.
Learning status: Not practiced
The moving parts
The word scope appears at more than one step in an AKS Workload ID flow. Keep the token request, federation audience, and Azure role assignment separate:
| Term | What it identifies | Example |
|---|---|---|
| OAuth token scope | The target API and, where supported, the permissions requested for the access token | https://storage.azure.com/.default |
| Federated-token audience | The recipient for which the projected Kubernetes assertion is intended | api://AzureADTokenExchange |
| Azure RBAC assignment scope | The Azure resource hierarchy where a role's permissions apply | A storage account resource ID, resource group, or subscription |
OAuth token scope: which API?
An application asks Microsoft Entra ID for an access token for the API it plans to call. The token must be intended for that API; a Storage token is not a Redis or Function API token. With Azure Identity, SDK clients often request the service's scope internally. If requesting a token directly, use the scope documented for the target service:
| Target API | Example scope |
|---|---|
| Azure Key Vault | https://vault.azure.net/.default |
| Azure Blob Storage | https://storage.azure.com/.default |
| Azure Resource Manager | https://management.azure.com/.default |
| Azure Managed Redis | https://redis.azure.com/.default |
| A Function API | api://<function-api-client-id>/.default |
In a client-credentials flow, /.default requests the application's statically configured and consented application permissions for that API. It does not grant permissions by itself, and it does not mean “all Azure permissions.” Azure services that use Azure RBAC, such as Blob Storage, make a separate authorization decision from the role assignment. For a custom API, configure and authorize the application permission or app role the caller needs.
Federation audience: which token is being exchanged?
The projected Kubernetes service-account token is an assertion presented to Entra during federation. Its audience is normally api://AzureADTokenExchange. The federated identity credential must trust that audience, along with the expected issuer and service-account subject.
This audience is not the scope for the access token the pod later presents to Storage, Redis, or a Function API. Entra validates the assertion, then issues a separate access token for the requested resource scope.
Azure RBAC scope: where does a role apply?
An Azure role assignment also has a scope, but it is a resource boundary, not an OAuth token request. It can apply at a specific resource, resource group, subscription, or management group. Assigning a Storage data role at a storage account scope limits where that authorization applies; it does not change the Storage token scope.
The service still evaluates its own authorization model. For example, Blob access needs a Blob data role; Azure Functions uses its API permission model; Azure Managed Redis has its own Entra authentication configuration. A correctly scoped token does not substitute for those grants.
Sources: AKS Workload ID overview, Token scopes and the /.default scope, Authorize Blob access with Microsoft Entra ID, Azure Managed Redis authentication.
Connects to