> ## Documentation Index
> Fetch the complete documentation index at: https://nango-wari-migrated-bigcommerce-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Power BI (Client Credentials)

> Integrate your application with the Microsoft Power BI API using a service principal (client credentials)

## 🚀 Quickstart

Connect to Microsoft Power BI with Nango and see data flow in 2 minutes.

<Steps>
  <Step title="Create the integration">
    In Nango ([free signup](https://app.nango.dev)), go to [Integrations](https://app.nango.dev/dev/integrations) -> *Configure New Integration* -> *Microsoft Power BI (Client Credentials)*.
  </Step>

  <Step title="Connect Microsoft Power BI">
    Go to [Connections](https://app.nango.dev/dev/connections) -> *Add Test Connection* -> *Connect*, then enter your **Tenant ID**, **Client ID**, and **Client Secret**. Later, you'll let your users do the same directly from your app.
  </Step>

  <Step title="Call the Microsoft Power BI API">
    Let's make your first request to the Power BI API (list the workspaces your service principal can access). Replace the placeholders below with your [API key](https://app.nango.dev/dev/environment-settings), [integration ID](https://app.nango.dev/dev/integrations), and [connection ID](https://app.nango.dev/dev/connections):

    <Tabs>
      <Tab title="cURL">
        ```bash theme={null}
        curl "https://api.nango.dev/proxy/v1.0/myorg/groups" \
          -H "Authorization: Bearer <NANGO-API-KEY>" \
          -H "Provider-Config-Key: <INTEGRATION-ID>" \
          -H "Connection-Id: <CONNECTION-ID>"
        ```
      </Tab>

      <Tab title="Node">
        Install Nango's backend SDK with `npm i @nangohq/node`. Then run:

        ```typescript theme={null}
        import { Nango } from '@nangohq/node';

        const nango = new Nango({ apiKey: '<NANGO-API-KEY>' });

        const res = await nango.get({
            endpoint: '/v1.0/myorg/groups',
            providerConfigKey: '<INTEGRATION-ID>',
            connectionId: '<CONNECTION-ID>'
        });

        console.log(res.data);
        ```
      </Tab>
    </Tabs>

    Or fetch credentials with the [Node SDK](/reference/sdks/node#get-a-connection-with-credentials) or [API](/reference/api/connection/get).

    ✅ You're connected! Check the [Logs](https://app.nango.dev/dev/logs) tab in Nango to inspect requests.
  </Step>

  <Step title="Implement Nango in your app">
    Follow our [Auth implementation guide](/guides/primitives/auth) to integrate Nango in your app.

    To obtain your own production credentials, follow the setup guide linked below.
  </Step>
</Steps>

## 📚 Microsoft Power BI (Client Credentials) integration guides

Nango-maintained guides for common use cases.

* [How do I link my account?](/api-integrations/microsoft-power-bi-oauth2-cc/connect)
  Connect using an Entra ID app registered as a Power BI service principal

Official docs: [Power BI REST API](https://learn.microsoft.com/en-us/rest/api/power-bi/)

## 🧩 Pre-built syncs & actions for Microsoft Power BI (Client Credentials)

Enable them in your dashboard. Extend and customize to fit your needs.

### Others

| Function name                     | Description                                                                                                                             | Type                                           | Source code                                                                                                                                                  |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `add-dataset-rows`                | Append rows of data to a push-dataset table.                                                                                            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/add-dataset-rows.ts)                |
| `add-workspace-user`              | Grant a user or service principal access to a workspace.                                                                                | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/add-workspace-user.ts)              |
| `create-dashboard`                | Create a new, empty dashboard in a workspace.                                                                                           | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/create-dashboard.ts)                |
| `create-push-dataset`             | Create a new dataset with an explicit table/column schema in push mode, ready to receive rows via the API without needing a .pbix file. | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/create-push-dataset.ts)             |
| `create-workspace`                | Create a new Power BI workspace.                                                                                                        | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/create-workspace.ts)                |
| `delete-dataset-rows`             | Delete all rows from a push-dataset table (truncate)                                                                                    | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/delete-dataset-rows.ts)             |
| `delete-dataset`                  | Delete a dataset.                                                                                                                       | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/delete-dataset.ts)                  |
| `delete-workspace`                | Delete a workspace.                                                                                                                     | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/delete-workspace.ts)                |
| `execute-dataset-queries`         | Run a DAX query against a dataset and return the results                                                                                | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/execute-dataset-queries.ts)         |
| `get-dataset-refresh-schedule`    | Get the configured refresh schedule for a dataset.                                                                                      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/get-dataset-refresh-schedule.ts)    |
| `get-dataset`                     | Get details of a single dataset.                                                                                                        | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/get-dataset.ts)                     |
| `get-workspace`                   | Get details of a single workspace.                                                                                                      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/get-workspace.ts)                   |
| `list-dashboard-tiles`            | List the tiles on a dashboard.                                                                                                          | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/list-dashboard-tiles.ts)            |
| `list-dashboards`                 | List dashboards in a workspace.                                                                                                         | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/list-dashboards.ts)                 |
| `list-dataflows`                  | List dataflows in a workspace                                                                                                           | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/list-dataflows.ts)                  |
| `list-dataset-datasources`        | List the data sources backing a dataset.                                                                                                | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/list-dataset-datasources.ts)        |
| `list-dataset-refresh-history`    | List the refresh history of a dataset.                                                                                                  | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/list-dataset-refresh-history.ts)    |
| `list-dataset-users`              | List users and service principals with direct access to a dataset.                                                                      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/list-dataset-users.ts)              |
| `list-datasets`                   | List datasets in a workspace.                                                                                                           | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/list-datasets.ts)                   |
| `list-gateways`                   | List on-premises data gateways visible to this service principal.                                                                       | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/list-gateways.ts)                   |
| `list-reports`                    | List reports in a workspace.                                                                                                            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/list-reports.ts)                    |
| `list-workspace-users`            | List users and service principals with access to a workspace.                                                                           | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/list-workspace-users.ts)            |
| `list-workspaces`                 | List Power BI workspaces (groups) accessible to this service principal.                                                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/list-workspaces.ts)                 |
| `refresh-dataset`                 | Trigger a refresh of a dataset.                                                                                                         | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/refresh-dataset.ts)                 |
| `takeover-dataset`                | Transfer ownership of a dataset's data source credentials to the caller.                                                                | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/takeover-dataset.ts)                |
| `update-dataset-refresh-schedule` | Configure the automatic refresh schedule for a dataset.                                                                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/update-dataset-refresh-schedule.ts) |
| `update-dataset-table-schema`     | Replace a push dataset table's column schema.                                                                                           | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/update-dataset-table-schema.ts)     |
| `update-workspace`                | Rename a workspace.                                                                                                                     | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/actions/update-workspace.ts)                |
| `datasets`                        | Sync datasets across all workspaces accessible to this service principal.                                                               | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/syncs/datasets.ts)                          |
| `workspaces`                      | Sync Power BI workspaces (groups) accessible to this service principal.                                                                 | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/microsoft-power-bi-oauth2-cc/syncs/workspaces.ts)                        |

## API gotchas

* Power BI's app-only auth isn't gated by Microsoft Graph permissions alone — a Power BI tenant admin must also enable **Allow service principals to use Power BI APIs** (and, if scoping to a security group, add the app to that group) in the Fabric admin portal's tenant settings. Without this, requests fail even with a valid token and correct application permissions.
* A service principal only sees workspaces it's been added to as a viewer, contributor, member, or admin (`/v1.0/myorg/groups`). To read tenant-wide without per-workspace membership, use the [Admin API](https://learn.microsoft.com/en-us/rest/api/power-bi/admin) (`/v1.0/myorg/admin/groups`) — this requires enabling **Service principals can access read-only admin APIs** in the Fabric admin portal (separate from the base tenant setting above). No Microsoft Entra API permission is needed: `Tenant.Read.All`/`Tenant.ReadWrite.All` are delegated-only scopes and don't apply to service principals.

***
