Skip to main content

Power BI

Lets agents list workspaces, reports, datasets and dashboards, refresh semantic models and run DAX queries in Power BI.

Connect it with: Service account. Power BI's own documentation: https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal.

What agents can do​

Connect Power BI so the agents working your tasks can reach it. With it connected, they can:

  • List the workspaces, reports, dashboards and semantic models (datasets) the service principal can reach.
  • Trigger a semantic model refresh and read the refresh history to see whether it succeeded.
  • Run DAX queries against a semantic model with the Execute Queries API to check numbers.
  • Export a report, clone it between workspaces, or rebind it to another semantic model.

Before you start​

  • A Power BI Pro, Premium Per User or Fabric/Premium capacity licence for the workspaces agents should reach.
  • An app registration in Microsoft Entra ID with a client secret: Azure portal > Microsoft Entra ID > App registrations > New registration. It needs no Power BI API permissions; access comes from workspace roles.
  • A security group in Microsoft Entra ID that contains the app.
  • A Power BI or Fabric administrator who turns on Admin portal > Tenant settings > Developer settings > Service principals can call Fabric public APIs for that security group (Power BI's REST API is governed by the same setting).
  • The app added to each workspace: open the workspace > Manage access > Add people or groups, search for the app's name, and give it Member or Contributor (Viewer for read-only work).
  • A Jaah account. Anyone can add a personal secret; an organization secret needs an Org Owner or Admin.

Connect with Power BI​

Jaah connects to Power BI with a service account, not with a sign-in button.

Connect with an API key​

Find each value first:

  • Tenant ID: Azure portal > Microsoft Entra ID > Overview > Tenant ID (a GUID, or a domain such as yourcompany.onmicrosoft.com).
  • Client ID: Azure portal > Microsoft Entra ID > App registrations > your app > Overview > Application (client) ID.
  • Client secret: Your app > Certificates & secrets > Client secrets > New client secret; copy the Value column (not the Secret ID) right after creating it.

Then add it to Jaah:

  1. In Jaah, open Secrets, select New, and pick the Power BI card.
  2. Name the secret and choose who can use it.
  3. Fill in Tenant ID, Client ID, Client secret.
  4. Select Save. Jaah tests the secret straight away (see Test the connection).

Jaah encrypts what you type and never shows it again — not to you, and not to an admin.

Use your own OAuth app​

Not used: Jaah connects to Power BI with a service account, not through an OAuth app.

Test the connection​

Select Test on the secret. Jaah first signs in at POST https://login.microsoftonline.com/<Tenant ID>/oauth2/v2.0/token with the client ID and secret, then calls Power BI's API once with the token it got back (GET https://api.powerbi.com/v1.0/myorg/groups), and shows whether Power BI accepted it, or which value Power BI refused and the status it answered. Jaah also tests automatically when you save or reconnect.

The last result and its time stay on the secret's page, so you can see whether it still works without testing again.

Who can use it​

Every secret has an owner, and the owner decides who can use it:

  • Personal — only your own tasks can use it. This is the default.
  • Organization — every task in the organization can use it. Only Org Owners and Admins can choose this.
  • Attached to a project — every task on that project can use it, whoever started the task. See Attach a secret to a project.

More on owners and access: How secrets work.

Use it in an agent session​

An agent asks for the secret with its credential_get tool, by the secret's path, when it needs it, and gets the values for that one call. The path is the owner's prefix and the secret's name:

  • org/<name> for an organization secret,
  • projects/<project>/<name> for one attached to a project,
  • me/<name> for your personal one.

A key connection hands the agent its fields: tenant_id, client_id, client_secret.

Tell the agent in your task description which secret to use, for example “use the Power BI secret org/power-bi”.

Manage, rotate or disconnect​

Everything is on the secret's page under Secrets:

  • Rotate a key: create a new key at the vendor first, then select Replace on the secret and paste it. Revoke the old key at Power BI once the test passes. Steps: Replace or delete a secret.
  • Disconnect: select Delete. The stored values are destroyed and agents lose access on their next call. To end access at Power BI's side too, delete the service account's key in its cloud console.

Limitations​

  • A service principal reaches only workspaces it was added to; My workspace and classic (v1) workspaces are never reachable.
  • Admin APIs (the /admin endpoints) need a separate tenant setting, Service principals can access read-only admin APIs, and work only for a group that holds no other Power BI API permission.
  • The Execute Queries API is limited to 120 query requests per minute per user and returns at most 100,000 rows.
  • Client secrets expire (at most two years); create a new one and replace it in Jaah before the old one lapses.
  • Agents can do only what the connected Power BI service account and its roles allow.

Troubleshooting​

Test says Power BI rejected the client ID and client secret (400) or (401) - check both

The tenant, client ID or secret is wrong, or the secret expired. Check the Tenant ID on Microsoft Entra ID > Overview, the Application (client) ID on the app's Overview, and paste the secret's Value (not its Secret ID).

Test says Power BI rejected the access token it issued (401) or (403)

Entra issued a token but Power BI refused the app. In Admin portal > Tenant settings > Developer settings, turn on the service principal setting for a security group, put the app in that group, and wait up to 15 minutes. An app that was granted Power BI API permissions in Entra with admin consent can also be refused: remove those permissions.

The Test passes but agents see no workspaces or reports

The app is not a member of any workspace. Open each workspace > Manage access > Add people or groups and add the app with Member, Contributor or Viewer.

Still stuck? Select Test and read the result: it names the value Power BI refused and the status it answered.

FAQ​

Why a service principal and not a sign-in button?

A service principal is Microsoft's supported identity for unattended automation: it keeps working when a person leaves, needs no Power BI licence of its own, and sees only the workspaces you add it to.

Can agents edit report visuals?

Not through the REST API. Agents can refresh, export, clone and rebind reports and query their data; changing visuals needs Power BI Desktop or the report's PBIR files in a Git-connected workspace.

Can Jaah or an admin see the key or token?

No. Jaah stores it encrypted and never shows it again. Only the tasks allowed to use the secret receive it, at the moment they ask for it.

Can I connect more than one Power BI account?

Yes. Add one secret per account, each with its own name, and tell the agent which one to use.