PowerBI Semantic Layer
Connect with PowerBIs Semantic Models
1. Create the Entra app (service principal)
Who: Entra / Azure AD admin (or anyone allowed to create app registrations)
In the Entra admin center → App registrations → New registration:
Name: e.g. pbi-backend-service-principal
Supported account types: Single tenant (typical).
Register.
On the app page, capture:
Application (client) ID
Directory (tenant) ID
Certificates & secrets → New client secret:
Add a secret (e.g. 2 year lifetime).
Copy the secret value now (can’t be read later).
Add Security Group (optional)
Create an Entra security group, e.g. pbi-spn-api-callers.
Add the service principal to that group.
For this Power BI scenario you do not need to add Power BI API permissions under API permissions when using service principal auth.
2. Tenant settings in Fabric / Power BI admin portal
Who: Fabric / Power BI admin
Open Fabric / Power BI Admin portal → Tenant settings. We’ll touch three areas.
2.1 Developer settings: allow SPs to use APIs
Under Developer settings:
Find “Service principals can use Fabric APIs” (or: “Allow service principals to use Power BI APIs”).
Set to:
Enabled, scoped to:
Entire organization, or
Specific security groups → add pbi-spn-api-callers.
Save.
This unlocks public Power BI/Fabric APIs for service principals.
2.2 Integration settings: allow ExecuteQueries
Under Integration settings:
Enable “Dataset Execute Queries REST API”.
Recommended: restrict to the same group pbi-spn-api-callers.
Save.
This specifically allows POST /datasets/{id}/executeQueries (and the in-group variant) for those identities.
2.3 Admin API settings: allow SPs to list all datasets/semantic models
To let the service principal list everything across the org, enable admin APIs.
Under Admin API settings:
Turn on “Service principals can access read-only admin APIs”.
Scope to Specific security groups → pbi-spn-api-callers.
Save.
This allows the SP to call e.g. GET /v1.0/myorg/admin/datasets(list all datasets) and other admin endpoints, as long as it’s in the allowed group.
Note: when using service principal for admin APIs, the app must nothave admin-consent Power BI permissions configured in Entra; access is governed by these tenant settings instead.
3. Give the service principal access to workspaces / datasets
Who: Workspace owners (or central admin via script)
For each workspace whose semantic models the backend should query:
Go to Workspace → Access.
Add either:
The service principal directly, or
The security group pbi-spn-api-callers.
Give it a role that implies Read + Build on semantic models, e.g.:
Contributor or Member, or
Viewer + Build (Viewer with Build on the semantic model itself).
The minimum requirement from the API doc:
Tenant setting “Dataset Execute Queries REST API” enabled, and
Caller has dataset Read + Build permissions.
To truly “list all” datasets/semantic models:
The admin APIs (see 2.3) give you org-level listing(/admin/datasets etc.) as long as SP is in the allowed group—no workspace membership needed.
But to query a dataset with executeQueries, the SP still must have Build/Read on that semantic model’s workspace.
4. Connect Dot
Go to Settings / Semantic Layers

Last updated