> For the complete documentation index, see [llms.txt](https://integrations.drivetrain.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integrations.drivetrain.ai/integration-guide/readme/bi/integrating-with-power-bi.md).

# Integrating with Power BI

Connect Power BI to Drivetrain using a Microsoft Entra ID service principal

Drivetrain connects to Power BI through a Microsoft Entra ID app registration that acts as a service principal. You register an app in Azure, grant it Power BI API permissions, enable a few Power BI tenant settings, give it access to the workspace you want to sync, and share three credentials, the Client ID, Tenant ID, and Client Secret, with Drivetrain.

**Note:** This is a read-only integration. The service principal only pulls data from Power BI into Drivetrain, nothing is written back.

## Prerequisites

To connect Power BI to Drivetrain, you need:

* Admin access to Microsoft Entra ID (Azure AD), to register an app and grant admin consent.
* Power BI (Fabric) admin access, to change tenant settings in the Power BI admin portal.
* A Power BI Premium Per User (PPU) license, or Premium or Fabric capacity, on the workspace. This is required for the Execute Queries API the integration uses.
* Admin access to the Power BI workspace you want Drivetrain to read.

## Registering an app in Microsoft Entra ID

This app registration is the service principal Drivetrain authenticates with.

### Step 1: Create the app registration

To create the app registration:

1. Sign in to the Azure portal at [portal.azure.com](https://portal.azure.com).
2. Go to **Microsoft Entra ID → App registrations → New registration**.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-d0e0174dde58fea47d177e89e6a844c953bd6409%2Fpowerbi_drivetrain_step_01.png?alt=media" alt=""><figcaption></figcaption></figure>

3. Enter a name, for example "Drivetrain BI Integration".

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-41de45ba85abb254f00b42e3c2bbff32d8e039dd%2Fpowerbi_drivetrain_step_02.png?alt=media" alt=""><figcaption></figcaption></figure>

4. Under **Supported account types**, select **Accounts in any organizational directory (Multitenant)**.
5. Click **Register**. The app's **Overview** page opens.

### Step 2: Copy the Client ID and Tenant ID

On the app's **Overview** page, copy and save these two values in a secure document. You'll share them with Drivetrain:

* Application (client) ID
* Directory (tenant) ID

### Step 3: Add Power BI API permissions

1. In the app, go to **API permissions**.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-1250217a0999cb3914404646d5f4563bcdd73e36%2Fpowerbi_drivetrain_step_03.png?alt=media" alt=""><figcaption></figcaption></figure>

2. Click **Add a permission → Power BI Service** and add the required Delegated permissions.
3. Click **Add a permission → Power BI Service** again and add the required Application permissions.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-da81baf33cf3bed305c199b3e5febdae6d7578d3%2Fpowerbi_drivetrain_step_04.png?alt=media" alt=""><figcaption></figcaption></figure>

4. Click **Grant admin consent for {your organization}**, then click **Yes** to confirm. Every permission shows a green **Granted** status.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-57e75a26f24febe92a01622602a6bfaa6b09e2db%2Fpowerbi_drivetrain_step_05.png?alt=media" alt=""><figcaption></figcaption></figure>

### Step 4: Create a client secret

1. Go to **Certificates & secrets → New client secret**.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-17c182430dc7836b18edda6f04be07e8de13792c%2Fpowerbi_drivetrain_step_06.png?alt=media" alt=""><figcaption></figcaption></figure>

2. Enter a description and choose an expiry.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-e440ff6a92f661fcf785786c021cfb3176693b3f%2Fpowerbi_drivetrain_step_07.png?alt=media" alt=""><figcaption></figcaption></figure>

3. Click **Add**.
4. Copy the secret's **Value**, not the Secret ID, and store it securely.

**Important:** The secret **Value** is shown only once. If you navigate away or refresh the page, it disappears and you have to create a new one.

You now have the three service principal credentials: Client ID, Tenant ID, and Client Secret.

## Enabling Power BI tenant settings

You must be a Power BI or Fabric administrator for this section. In Power BI, go to **Settings (⚙) → Admin portal → Tenant settings**, then enable the following (search each by name):

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-0cb4b852207e32a3fcb690fe9b6acd8110408ec0%2Fpowerbi_drivetrain_step_08.png?alt=media" alt=""><figcaption></figcaption></figure>

* **Integration settings → Dataset Execute Queries REST API**: enable, applied to the entire organization or to a security group that contains the app.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-5a4d142c9b7d0c89bab114bf247172c521b3e7c7%2Fpowerbi_drivetrain_step_09.png?alt=media" alt=""><figcaption></figcaption></figure>

* **Developer settings → Allow service principals to use Power BI APIs**: enable.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-8a20d92d6147ba431e6f8a0aab4568c79977a4a1%2Fpowerbi_drivetrain_step_10.png?alt=media" alt=""><figcaption></figcaption></figure>

* **Admin API settings → Service principals can access read-only admin APIs**: enable. This lets Drivetrain read workspace metadata.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-4f692f9ff663fdf636c11dc4ff2e3bec91b37e19%2Fpowerbi_drivetrain_step_11.png?alt=media" alt=""><figcaption></figcaption></figure>

* Optional: **Enhance admin APIs responses with detailed metadata**.
* Optional: **Enhance admin APIs responses with DAX and mashup expressions**.

**Tip:** You can scope each setting to a specific security group instead of the whole organization. If you do, add the service principal to that group.

**Important:** The workspace must be on Premium Per User (PPU), or Premium or Fabric capacity. Without it, the Execute Queries API doesn't work.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-044b87f3b845238a64da32dd5c28a150d90a7f22%2Fpowerbi_drivetrain_step_12.png?alt=media" alt=""><figcaption></figcaption></figure>

## Granting the service principal access to your workspace

1. Open the Power BI workspace you want Drivetrain to read.
2. Click **Manage access → Add people or groups**.
3. Search for your app registration by name (for example, "Drivetrain BI Integration") and select it.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-9c866b681d6cc842c15aeef1f994e618fb57e57f%2Fpowerbi_drivetrain_step_13.png?alt=media" alt=""><figcaption></figcaption></figure>

4. Set the role to **Contributor**. This is required so the service principal can run queries. Click **Add**.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-ab6ff082b0863fa5ef5149aacd098b97acd3eb40%2Fpowerbi_drivetrain_step_14.png?alt=media" alt=""><figcaption></figcaption></figure>

## Sharing credentials with Drivetrain

Share the following with your Drivetrain customer success manager, through a secure channel such as a password manager or an encrypted document:

* Client ID
* Tenant ID
* Client Secret
* The Power BI workspace name(s) you want Drivetrain to sync

## What happens next

* Drivetrain validates the credentials and workspace access.
* Drivetrain configures the sync based on the enabled permissions.
* You're notified once the integration is live, and your Power BI data becomes available across Drivetrain.

**Note:** If you have questions or run into issues during setup, contact your customer success manager.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://integrations.drivetrain.ai/integration-guide/readme/bi/integrating-with-power-bi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
