Skip to main content
Azure workloads can use either of two token sources:
  • Azure managed identity: a VM or virtual machine scale set requests a Microsoft Entra ID token from the Azure Instance Metadata Service (IMDS).
  • Azure Kubernetes Service (AKS): a pod uses a projected Kubernetes service account token issued by the cluster.
App Service, Azure Functions and Container Apps do not use IMDS. They give the managed identity token at the URL in the IDENTITY_ENDPOINT environment variable, with the X-IDENTITY-HEADER request header set to IDENTITY_HEADER. The SDK managed identity helpers do not support this endpoint. On these services, pass your own token provider that calls it. See Microsoft’s guide to managed identities for App Service and Azure Functions.

Azure managed identity

Set up the identity

Managed identity tokens are issued for a resource, and the resource becomes the token’s aud. Create an app registration in Microsoft Entra ID to represent Reducto, and set its Application ID URI, for example api://reducto-acme-prod. See Microsoft’s guide to register an application. The Application ID URI, the IMDS resource parameter, the token’s aud and the Reducto provider audience must all be the same value. Assign a system-assigned or user-assigned managed identity to the resource that runs your code.

Get and inspect a token

From the Azure resource:
If the resource has more than one user-assigned identity, add client_id=<identity client ID> to the request.
The issuer depends on the token version that the app registration accepts. Version 1 tokens use https://sts.windows.net/<tenant ID>/ and version 2 tokens use https://login.microsoftonline.com/<tenant ID>/v2.0. Copy iss from a real token.

Configure Reducto

In Studio, open Settings > Workload identity and create a provider with the Azure managed identity preset: Add a mapping for the identity and tenant: If your tokens have no appid, use azp (version 2 tokens) or oid.

Call Reducto

Pass the Application ID URI to the token provider as resource. The default resource is https://management.azure.com/, which Reducto rejects. For a user-assigned identity on a resource with several identities, also pass client_id (clientId in Node.js).
Entra managed identity tokens often last up to 24 hours. Reducto still caps the access token at the mapping lifetime, at most one hour.

Azure Kubernetes Service (AKS)

AKS can publish a public OIDC issuer for the cluster. Get it, and enable it if it is empty:
Create a service account and mount a projected token with the Reducto audience, as in the Kubernetes guide. AKS tokens use the standard Kubernetes claims:
Create a provider with the AKS preset: Add a mapping with sub = system:serviceaccount:payments:reducto-client. Then use k8s_service_account_token_provider("/var/run/secrets/reducto/token") (Python) or k8sServiceAccountTokenProvider("/var/run/secrets/reducto/token") (Node.js), as shown in the Kubernetes guide. If your pods already use Microsoft Entra Workload ID to get Entra tokens for a managed identity, you can follow the managed identity steps instead. Reducto then trusts the Entra token, not the cluster token.

Azure best practices

  • Use one managed identity per application and environment. Match its appid together with tid.
  • Use a dedicated app registration for the Reducto audience, and do not reuse it for other APIs.
  • Keep development, staging and production on separate identities and mappings.
  • Remove mappings for identities that you delete, and review them when you move resources between subscriptions.