Pular para o conteúdo principal

Microsoft Power BI Toolkit

The Microsoft Power BI toolkit connects a Power BI account to EKB using OAuth and lets agents and workflows list workspaces, reports, dashboards, and datasets, retrieve dataset schemas, execute DAX queries, and trigger dataset refreshes. The toolkit runs with the connected user's Power BI permissions and does not elevate access beyond what that account can see.

Prerequisites​

  • A Microsoft account with access to Power BI workspaces, reports, and semantic models you intend to use.
  • At least Viewer access to a Power BI workspace.
  • An EKB project where you can configure an agent or workflow.
  • Your organization's Microsoft Entra administrator may need to approve the app's requested Power BI delegated permissions before the OAuth connection can complete.
aviso

The toolkit runs with the connected user's Power BI permissions. It does not grant access beyond what that account can see in Power BI. Never include tokens, client secrets, or credential values in workflow inputs, prompts, screenshots, tickets, or documentation.

Setup​

  1. Open an agent or workflow in EKB

    Create or open an agent or workflow in EKB, then add the Microsoft Power BI toolkit.

  2. Connect with Microsoft

    When prompted, select Connect with Microsoft Power BI and sign in with the Microsoft account that has access to the Power BI workspaces, reports, and semantic models you need.

  3. Accept permissions

    Review and accept the requested permissions. If your organization requires administrator approval, ask your Microsoft Entra administrator to approve the app's delegated Power BI permissions before proceeding.

  4. Confirm the connection

    Run List Workspaces to confirm the connection is working and to obtain workspace IDs for use in subsequent actions.

Available tools​

Discovery​

ToolDescription
List WorkspacesLists the Power BI workspaces accessible to the connected user. Returns workspace IDs for use in other actions.
List ReportsLists reports in a selected workspace. Omit workspace ID to list reports in My Workspace.
List DashboardsLists dashboards in a selected workspace. Omit workspace ID for My Workspace.
List DatasetsLists datasets (semantic models) in a selected workspace. Returns dataset IDs for use in schema, DAX, and refresh actions.

Data Exploration​

ToolDescription
Get Dataset SchemaReturns the tables and columns available in a dataset or semantic model. Run this before authoring a DAX query to confirm table and column names.
Execute DAX QueryRuns a DAX query against a dataset or semantic model and returns the results.

Refresh Management​

ToolDescription
Refresh DatasetTriggers a dataset refresh. Refresh requires write or refresh rights on the semantic model.
Get Refresh HistoryReturns recent refresh records for a dataset. Use this to check whether the latest refresh completed before publishing a report link.

Start with List Workspaces → List Datasets (using a workspace ID) → Get Dataset Schema → Execute DAX Query. This sequence makes the available model and its table and column names visible before you write a query.

Use cases​

  • Return the top revenue regions from a Power BI semantic model using a DAX query, then include the results in a Slack notification or report summary.
  • Trigger a dataset refresh after an upstream data-load workflow completes, then use Get Refresh History to confirm success before publishing a report link.
  • Let an agent list workspaces and reports, then surface a report URL to a stakeholder on request.
  • Check the latest refresh status of a scheduled dataset before a downstream workflow depends on fresh data.

Troubleshooting​

SymptomLikely causeFix
Admin approval requiredYour Microsoft Entra tenant requires administrator consent for the app's Power BI delegated permissions.Ask your Microsoft Entra administrator to grant consent for the app registration.
No workspaces returnedThe connected account has no workspace access, or you are signed into the wrong Microsoft account.Confirm you are signed into the intended account and have at least Viewer access to a Power BI workspace.
401 UnauthorizedThe OAuth token has expired or been revoked, or the app registration configuration is invalid.Reconnect the toolkit. If the problem persists, contact an EKB administrator to check the OAuth app's client secret expiry and redirect URI.
403 ForbiddenThe connected user lacks permission for the requested action at the workspace, dataset, or tenant level.Ask the workspace or tenant administrator to grant the required permission. Dataset refresh requires write or refresh rights.
Dataset schema or DAX action failsIncorrect workspace or dataset ID, insufficient permissions, or an invalid DAX expression.Run List Datasets to confirm the dataset ID, run Get Dataset Schema to verify table and column names, then correct the query.
Refresh starts but does not completeThe semantic model's data source credentials, gateway, capacity, or refresh policy has a problem.Check Get Refresh History for the detailed failure reason and resolve it in the Power BI service.
Connection expiredThe OAuth token could not be refreshed automatically.Reconnect the Microsoft Power BI toolkit. If the problem recurs, contact an EKB administrator to check the OAuth configuration.