Available on the Enterprise plan. Contact sales to learn more.
Azure-specific constraints
Azure Entra ID federated credentials have two limits that shape how you design the trust:- Exact match on
subject— wildcards are not supported. You need one federated credential per distinctsubvalue you want to authorize. - Maximum 20 federated credentials per app registration or managed identity.
Prerequisites
- V3 tokens enabled on the OIDC Token Configuration page. See Enable V3 tokens.
- Azure CLI installed in your environment.
- An Azure app registration or user-assigned managed identity. The examples below use an app registration; the same federated-credential and CLI flow works for managed identities.
How it works
- Ona issues a JWT signed with RS256, containing identity claims about the environment, user, or service account.
- Azure validates the token against Ona’s OIDC discovery endpoint and JWKS.
- If
iss,aud, andsubmatch the federated credential, Azure issues a service principal access token. - The Azure CLI or any Azure SDK uses that access token to call Azure APIs.
Step 1: Create an app registration or managed identity
Use either an app registration or a user-assigned managed identity. Note the client ID and tenant ID — both are required for the login flow. App registration:Step 2: Inspect your Ona token
Run this in an Ona environment to see whatsub value Azure will need to match:
sub value verbatim — Azure requires an exact-match string.
Step 3: Add a federated identity credential
Add a federated identity credential that trusts Ona’s OIDC tokens for the recordedsub.
For an app registration:
Step 4: Assign Azure RBAC roles
Grant the app registration or managed identity access to the Azure resources it needs:Step 5: Authenticate from an environment
Useona idp login azure to exchange the OIDC token and configure the Azure CLI:
az calls use the federated credentials:
Flags
Automate on environment startup
Add the login to your automations:Manual exchange (without ona idp login azure)
Use this when integrating with non-CLI tooling or other Azure SDKs:
ClientAssertionCredential:
Sub claim strategy
Azure’s exact-match constraint means you should pick the coarsestsub that still expresses your trust boundary. Each unique sub you want to authorize costs one of your 20 federated credentials per identity.
The default V3 environment sub depends on whether the environment belongs to a project:
- With project:
organization_id:<orgID>:project_id:<projID>— stable across all environments in the project. - Without project:
organization_id:<orgID>— matches every environment in the org.
Per-project (recommended)
sub = organization_id + project_id (default — no configuration needed).
Per-user, per-project
Addcreator_email (or creator_id) to the extra sub fields on the OIDC Token Configuration page. The sub becomes:
Per-user, all projects
Adduser_id (for user tokens) or creator_id (for environment tokens) to the extra sub fields.
Per-repository
Addenvironment_initializers.git.remote_uri to the extra sub fields. Useful when you want the trust to follow a repository regardless of which Ona project wraps it.
Colons in values are URL-encoded as
%3A in the sub claim.Limits
- Maximum 20 federated credentials per app registration or managed identity. If you need more, create additional identities with different role assignments.
- The
subjectfield has a 600-character limit. Long sub compositions (many extra fields with UUIDs) can approach this.
Token claims available to your application
Even though Azure only matches againstsub, the rest of the JWT body is available to your application after login. Use top-level claims for downstream authorization (audit logs, tenant routing, group-based checks).
See Token structure for the full schema and per-principal variants.
SSO claims forwarding
creator_idp_claims forwards string-valued claims from your SSO provider (for example, Entra ID groups or preferred_username). To enable additional claims:
- Open Organization Settings → Login and Security in Ona.
- Add the scopes your IdP returns on login (for example,
profile,email,groups). - Configure your IdP to release those claims to Ona.
sub using the creator_idp_claims.<key> syntax.
A note on the creator_ prefix
In Ona, environments have their own identity — they are machines, not users. The creator_ prefix makes explicit that those claims describe the user who created the environment, not the environment itself. The distinction matters when environments are launched by automations or shared across users.
V2 tokens
V2 tokens also work with Azure federated credentials. The V2sub uses a path-based format (for example, org:<orgID>/prj:<projectID>/env:<envID>). Set the federated credential’s subject to the exact V2 sub value.
V2 tokens carry fewer claims (org, gsub, and standard JWT fields), so trust is limited to matching sub. New integrations should use V3. See V2 tokens for the full V2 reference.
Troubleshooting
AADSTS70021: No matching federated identity record found
- The
subclaim in your Ona token does not match any federated credential’ssubject. - Decode your token:
ona idp token --audience api://AzureADTokenExchange --decode. - Compare it to the
subjectyou registered. The match must be exact, including case. - Newly created federated credentials take a few minutes to propagate. Retry after the wait.
AADSTS700024: Client assertion is not within its valid time range
- The token has expired. Ona OIDC tokens are short-lived. Re-run
ona idp login azure.
AADSTS700016: Application not found in the directory
--client-idmust be the client ID (appId) of the app registration or managed identity, not its object ID.
missing --client-id / missing --tenant-id
- Pass the flags or set
IDP_AZURE_CLIENT_ID/IDP_AZURE_TENANT_IDin the environment.