Area: Ingestion Issues
Sub-Area: Power BI Source Configuration / Entra App Registration
Applies to: OSS + Cloud
Issue
A Power BI ingestion run gets a 401 Unauthorized from the admin scan endpoint (POST https://api.powerbi.com/v1.0/myorg/admin/workspaces/getInfo on commercial Power BI). The token request succeeds, but the run ingests little or no metadata. With admin_apis_only: false, you can see reports but no dataset tables, columns or schema.
You see these signals:
- Log:
Unable to fetch get scan result. - Log, on HTTP 401 or 403:
Dataset lineage can not be ingestion because this user does not have access to the PowerBI Admin API. - Ingestion report: an
Incomplete Scan Metadatawarning for each workspace. The message reads:Scan returned no metadata for this workspace; it will be ingested without scan-derived metadata (endorsements, app, fabric artifacts, cross-workspace dataset lineage). Check logs for any underlying HTTP or scan error. - Ingestion report: a
Report Scan Fallback Activeinfo entry.
You Might Be Asking
- Why does my Power BI token generate successfully but the admin endpoint still returns 401?
- Why does
admin_apis_only: falsereturn reports but no dataset tables or columns? - Do I need to add API permissions to the app registration for DataHub's Power BI ingestion?
- The tenant settings look right and the app is in the security group. Why is the scan still rejected?
Cause
The connector gets an Entra token with the scope https://analysis.windows.net/powerbi/api/.default and calls the Power BI API at https://api.powerbi.com/v1.0/myorg. A token can be issued even when Power BI later rejects the admin scan call. So a successful token does not show that the app is authorized for the admin APIs.
The scan call creates a scan job with POST <API base>/admin/workspaces/getInfo. The connector then polls the scan status and reads the scan result. Dataset tables and columns come from that scan result. The admin scan runs whether admin_apis_only is true or false.
When the scan returns nothing for a workspace, the connector does not stop. It falls back to the per-workspace reports endpoint, so reports can appear while datasets, tables and columns are missing. The fallback is not silent. It shows the log lines, the Incomplete Scan Metadata warnings and the Report Scan Fallback Active info entry listed above.
A 401 or 403 on the scan means Power BI does not accept the app for the admin APIs. The usual places to check are the tenant settings, the security group and the app registration.
Admin API access is required when extract_ownership, extract_lineage, extract_endorsements_to_tags or admin_apis_only is enabled. A recipe that sets any of these will not get that metadata until the admin scan works.
Solution
-
Set up access the way the DataHub setup guide does. The guide grants access through Power BI tenant settings, scoped to an Entra security group that contains the app, and through workspace membership. It has no step to add Entra API permissions or grant admin consent. See the Power BI setup guide.
-
Check the tenant settings. In the Power BI Admin portal, enable the Developer setting and the Admin APIs settings listed under Prerequisites. Scope each one to the security group that contains your app. In current tenants the Developer setting is called "Service principals can call Fabric public APIs". Older tenants call it "Allow service principals to use Power BI APIs".
-
Check the security group type. The setup guide creates the group with Group type Security. Use a Security group that contains your app, and reference that group in the tenant settings.
-
Check the app registration's API permissions. Microsoft's guidance is that a service principal calling the read-only admin APIs should not have admin-consent-required Power BI Service permissions on its app registration. If your app has any, such as
Tenant.Read.All, remove them. DataHub's setup does not need them. Microsoft controls how long permission and tenant setting changes take to apply, so allow time before you retest. -
Check workspace membership. Add the app as a member of every workspace you want to ingest. Viewer is enough in most cases. Profiling needs Contributor.
-
Re-run ingestion and check the log and report. The
Unable to fetch get scan result.line, theIncomplete Scan Metadatawarnings and theReport Scan Fallback Activeentry should be gone. Example recipe:
source:
type: powerbi
config:
tenant_id: '${TENANT_ID}'
client_id: '${CLIENT_ID}'
client_secret: '${CLIENT_SECRET}'
admin_apis_only: true
extract_dataset_schema: true
extract_lineage: true
extract_ownership: true
extract_endorsements_to_tags: true
With admin_apis_only: true, the connector does not extract Report Pages, does not resolve M-Query parameters, and cannot profile datasets. If you need those, set admin_apis_only: false. The admin scan must still succeed to get dataset tables and columns.
If the scan job does not finish within scan_timeout (default 60), the run fails with Workspace detail is not available. Please increase the scan_timeout configuration value to wait longer for the scan job to complete. Raise scan_timeout in that case.
If you use a government cloud, set environment: GOVERNMENT. The connector then uses https://analysis.usgovcloudapi.net/powerbi/api/.default for the token and https://api.powerbigov.us/v1.0/myorg as the API base. The scan call goes to https://api.powerbigov.us/v1.0/myorg/admin/workspaces/getInfo.