Available on the Enterprise plan.
Prerequisites
- The Cube tenant has OIDC enabled and an
Azuretoken config exists under Admin → OIDC. - Permissions in your Azure AD tenant sufficient to create an app registration and add federated credentials, plus an Azure subscription where you can grant the app role assignments on resources.
- Your Cube tenant slug — the leftmost label of your tenant’s console URL.
Throughout this guide it’s referenced as
<tenant-name>(and the full issuer URL ashttps://<tenant-name>.cubecloud.dev). Substitute your actual slug everywhere it appears.
How Azure federation works
Azure doesn’t have a generic OIDC provider registration the way AWS does. Instead, you configure each app registration (or user-assigned managed identity) with a federated credential that pins the issuer URL, expectedaud, and exact sub value. When Cube presents a JWT that
matches all three, Azure AD swaps it for an access token scoped to the
app registration.
Step 1: Create or pick an app registration
You can use an existing app registration or create a new one — Cube doesn’t have any opinion as long as it has the federated credential and the role assignments.AZURE_CLIENT_ID. The
Directory (tenant) ID is your AZURE_TENANT_ID. Both are visible in
the Azure portal under Microsoft Entra ID → App registrations → Cube
Cloud Deployment → Overview.
Step 2: Add a federated credential
The federated credential is what binds the app registration to a specific Cube subject. Each credential matches exactly one issuer + subject + audience triple — Azure doesn’t support wildcards or pattern matching here.| Field | Value |
|---|---|
issuer | Your Cube tenant’s URL: https://<tenant-name>.cubecloud.dev. |
subject | The exact sub claim Cube emits — typically cube:deployment:<deployment-id>:component:<component>. |
audiences | Always ["api://AzureADTokenExchange"] — this is the standard Azure AD token-exchange audience. |
name | A human-readable label. Pick something that lets you find this credential later. |
subject ending in :component:cube_api and one ending in
:component:cube_store.
Cube’s default sub claim is cube:deployment:<deployment_id>. To match
the :component:<component> examples in this guide (or to add
:region:<region>), open your Azure token config in Admin → OIDC and
paste one of these templates into the Subject Claim Format field:
cube:deployment:{deployment_id}:component:{component}— for thecube:deployment:<deployment-id>:component:<component>examples below.cube:deployment:{deployment_id}:component:{component}:region:{region}— to additionally pin a Cube Cloud region.
Step 3: Set the deployment identity
Add two env vars to your deployment under Settings → Environment variables:AZURE_TENANT_ID— the Microsoft Entra ID (Azure AD) tenant where your app registration lives.AZURE_CLIENT_ID— the Application (client) ID of the app registration.
Step 4: Assign roles on Azure resources
Grant the app registration the standard Azure RBAC roles it needs, the same way you’d grant any service principal access to a resource. Examples follow per target.Azure SQL
Create the federated credential
See Step 2 — pin subject to
cube:deployment:<deployment-id>:component:cube_api.Create a contained user in Azure SQL
Connect to your Azure SQL database as an Entra-authenticated admin and
create a user backed by the app registration:The user name must match the app registration’s display name.
Azure Blob Storage export bucket
If your data source uses an export bucket for pre-aggregation unloads, grant the app registration Storage Blob Data Contributor on the storage account.Grant role assignment
Assign Storage Blob Data Contributor on the storage account scope:For tighter scoping, narrow to a specific container with
.../blobServices/default/containers/<container> instead of the whole
storage account.Configure the export bucket env vars
Point the export bucket env vars at your container:The Azure storage client picks up the same federated identity. See the
export bucket reference for the full set of
variables.
Azure Blob Storage CSPS bucket
Cube Store CSPS lets you store pre-aggregations in your own Azure Blob Storage container. Cube Store gets a separate OIDC token whosesub claim
ends in component:cube_store, so the federated credential can be locked
down to that component — even if the same app registration were shared with
the rest of the deployment, only Cube Store would match.
Every Cube Store worker emits a sub of the form
cube:deployment:<deployment-id>:component:cube_store. Unlike AWS IAM —
which matches sub with a StringLike wildcard, so one role can cover the
whole tenant — Azure pins the federated credential’s subject literally
and has no tenant-wide *. So CSPS on Azure is per deployment: each
deployment that writes pre-aggregations to the container needs its own
federated credential carrying that deployment’s exact sub. If you expect
many deployments, mind the 20-credential limit and see Scaling past 20
federated credentials.
Create the Cube Store federated credential
Add a federated credential on the app registration, pinning the subject
to the deployment’s Cube Store component:Make sure the Azure token config’s Subject Claim Format includes the
:component: segment
(cube:deployment:{deployment_id}:component:{component}) — see
Step 2 — otherwise the Cube Store
sub won’t match this credential.Grant the container permissions
Grant the app registration Storage Blob Data Contributor so Cube
Store can read, write, and list pre-aggregation blobs. Scope it to the
container for tightest isolation:Use the storage account scope (drop the
/blobServices/default/containers/<container> suffix) if you’d rather
one assignment cover multiple containers.Enable CSPS on each deployment
For each deployment that should use this container, go to Settings →
Pre-Aggregation Storage on the deployment and:
- Toggle Enable CSPS on.
- Storage Provider: Azure Blob Storage.
- Storage Account:
<account>. - Container:
<container>. - Client ID: the app registration’s Application (client) ID.
- Tenant ID: the Microsoft Entra ID (Azure AD) directory ID.
Scaling past 20 federated credentials
A single app registration accepts at most 20 federated credentials. Three patterns cover most growth scenarios:- One app registration per deployment. Each deployment gets its own app + role assignments. Clean isolation, but you have to provision a new app every time you add a deployment.
- Multiple app registrations behind one set of role assignments. Group deployments by access pattern (e.g. read-only vs read-write); each group gets its own app, and the role assignments target the same resources.
- User-assigned managed identities. Each managed identity has its own 20-credential limit, and you can attach many of them to your tenant. Useful when you want the resource permissions managed in Azure alongside other infrastructure rather than as RBAC on app registrations.
Verifying the setup
The fastest way to confirm the federated credential is wired up correctly is the Test connection button on the relevant settings page (data source wizard, BYO LLM provider). Behind the scenes, Cube issues a real OIDC token, exchanges it with Azure AD, and returns a precise error if anything is misconfigured. If the test fails:| Symptom | Likely cause |
|---|---|
AADSTS70021: No matching federated identity record found | The federated credential’s issuer, subject, and audiences triple doesn’t match the JWT exactly. Compare with the iss / sub / aud of a token from the Test connection error response. |
AADSTS700213: No matching federated identity record found ... subject | The subject claim differs by even a single character. Azure doesn’t support wildcards — you need one credential per exact subject. |
AADSTS50034: The user account does not exist | You’re using the wrong AZURE_TENANT_ID. Double-check the directory ID on the app registration’s Overview blade. |
AADSTS500011: The resource principal ... was not found | The role assignment hasn’t been created on the target resource, or it’s still propagating. Wait a minute and retry; if it persists, re-check the --assignee and --scope values. |