Authentication¶
TL;DR¶
If you are already signed in via Azure CLI or Azure PowerShell, you don't need to configure anything — fabric-dw picks up your session automatically.
If neither of those works for you, read on for the alternatives.
fabric-dw selects a credential source via the FABRIC_AUTH environment variable:
FABRIC_AUTH value |
What it uses |
|---|---|
default (default) |
azure-identity DefaultAzureCredential — see credential chain below |
interactive |
Browser pop-up — see interactive sign-in below |
sp |
Service-principal — see service principal below |
Interactive browser sign-in (zero setup)¶
FABRIC_AUTH=interactive (and the default-mode browser fallback) uses a shared multi-tenant app — no registration needed:
| Display name | fabric-dw |
| Client ID | f666e5ee-2149-4c6a-87eb-13c9e1fdc70d |
| Sign-in audience | Multi-tenant (AzureADMultipleOrgs) |
| Redirect URI | http://localhost |
On first sign-in:
- Non-admin users — the consent prompt asks for the delegated scopes the app needs (Workspace, Item, Tenant.Read, SQL user_impersonation). If your tenant policy requires admin consent for any of them, sign-in will fail until an admin grants it.
- Admins — choose "Consent on behalf of your organization" once; subsequent sign-ins from anyone in the tenant just work.
Pre-consent admin URL:
https://login.microsoftonline.com/<YOUR-TENANT-ID>/adminconsent?client_id=f666e5ee-2149-4c6a-87eb-13c9e1fdc70d
Bring your own app (advanced)¶
Set FABRIC_INTERACTIVE_CLIENT_ID (and optionally FABRIC_INTERACTIVE_TENANT_ID) to override the shared default. You then need to register an Entra app in your tenant:
az ad app create \
--display-name "fabric-dw" \
--sign-in-audience AzureADMyOrg \
--is-fallback-public-client true \
--public-client-redirect-uris http://localhost
Then grant the same delegated permissions as the shared app:
| API | Permission | Resource app ID |
|---|---|---|
| Power BI Service | Workspace.ReadWrite.All |
00000009-0000-0000-c000-000000000000 |
| Power BI Service | Item.ReadWrite.All |
00000009-0000-0000-c000-000000000000 |
| Power BI Service | Tenant.Read.All |
00000009-0000-0000-c000-000000000000 |
| Azure SQL Database | user_impersonation |
022907d3-0f1b-48f7-badc-1ba6abab6d66 |
Tenant pinning
When FABRIC_INTERACTIVE_TENANT_ID is set, FABRIC_AUTH=interactive passes it as tenant_id to InteractiveBrowserCredential and the default-mode browser fallback also receives it as interactive_browser_tenant_id. Useful when your tenant policy requires a specific tenant context at sign-in time.
FABRIC_AUTH=default — DefaultAzureCredential chain¶
When FABRIC_AUTH is default (or unset), the package delegates to azure-identity's DefaultAzureCredential. It walks the following sources in order and stops at the first one that returns a usable token:
- Environment variables —
AZURE_CLIENT_ID,AZURE_CLIENT_SECRET/AZURE_CLIENT_CERTIFICATE_PATH,AZURE_TENANT_ID— seeEnvironmentCredential - Workload Identity — injected in Kubernetes / AKS workloads — see
WorkloadIdentityCredential - Managed Identity — Azure VMs, App Service, Container Apps, etc. — see
ManagedIdentityCredential - Shared token cache — the MSAL cache shared between Azure tools — see
SharedTokenCacheCredential - Azure CLI — token from
az login— seeAzureCliCredential - Azure Developer CLI — token from
azd auth login— seeAzureDeveloperCliCredential - Azure PowerShell — token from
Connect-AzAccount— seeAzurePowerShellCredential - Interactive browser — falls back to browser sign-in using the shared app (or your override via
FABRIC_INTERACTIVE_CLIENT_ID) — seeInteractiveBrowserCredential
FABRIC_AUTH=sp — Service principal¶
Set the following environment variables:
| Variable | Description |
|---|---|
AZURE_TENANT_ID |
Your Entra tenant ID |
AZURE_CLIENT_ID |
Application (client) ID of your registered app |
AZURE_CLIENT_SECRET |
A client secret for the app |
The package uses ClientSecretCredential with these values. The shared fabric-dw app is not used in SP mode — you must supply your own app registration and secret.
Environment variable reference¶
| Variable | Default | Description |
|---|---|---|
FABRIC_AUTH |
default |
Credential mode: default, interactive, or sp |
FABRIC_INTERACTIVE_CLIENT_ID |
f666e5ee-2149-4c6a-87eb-13c9e1fdc70d |
Override the shared app client ID for browser sign-in |
FABRIC_INTERACTIVE_TENANT_ID |
(unset) | Pin a specific Entra tenant for browser sign-in |
AZURE_TENANT_ID |
(unset) | Required for FABRIC_AUTH=sp |
AZURE_CLIENT_ID |
(unset) | Required for FABRIC_AUTH=sp |
AZURE_CLIENT_SECRET |
(unset) | Required for FABRIC_AUTH=sp |
Debugging¶
Set AZURE_LOG_LEVEL=debug to make azure-identity log which credential in the chain it tried and why each failed.