CONNECT APP
Build with Microsoft Power BI
Data Analytics
- OAuth
MCP
Give your agent Microsoft Power BI tools
Every Microsoft Power BI action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Microsoft Power BI account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "microsoft_power_bi",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// e.g. run Add Rows to Dataset Table:
const result = await mcp.callTool({
name: "microsoft_power_bi-add-rows-dataset-table",
arguments: {
datasetId: "Dataset ID",
tableName: "Table Name",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", # any stable ID for this user in your system
"x-pd-app-slug": "microsoft_power_bi",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Add Rows to Dataset Table:
result = await session.call_tool("microsoft_power_bi-add-rows-dataset-table", {
"datasetId": "Dataset ID",
"tableName": "Table Name",
})API PROXY
Call the Microsoft Power BI API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the Microsoft Power BI API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://api.powerbi.com/v1.0/myorg/groups",
})
// Any allowed Microsoft Power BI endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# The path segment is the target URL, URL-safe base64 encoded:
# https://api.powerbi.com/v1.0/myorg/groups
curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkucG93ZXJiaS5jb20vdjEuMC9teW9yZy9ncm91cHM?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
-H "Authorization: Bearer {access_token}" \
-H "x-pd-environment: production"SDK
Run Microsoft Power BI actions from your backend
Connect a user's Microsoft Power BI account once, then run Add Rows to Dataset Table on their behalf from your own code — TypeScript, Python, or plain HTTP.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "microsoft_power_bi-add-rows-dataset-table",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
microsoft_power_bi: { authProvisionId: "apn_xxxxxxx" },
datasetId: "Dataset ID",
tableName: "Table Name",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="microsoft_power_bi-add-rows-dataset-table",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"microsoft_power_bi": {"authProvisionId": "apn_xxxxxxx"},
"datasetId": "Dataset ID",
"tableName": "Table Name",
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "microsoft_power_bi-add-rows-dataset-table",
"configured_props": {
"microsoft_power_bi": { "authProvisionId": "apn_xxxxxxx" },
"datasetId": "Dataset ID",
"tableName": "Table Name"
}
}'TOOLS
Microsoft Power BI actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Add Rows to Dataset Table
actionAdds new data rows to the specified table within the specified dataset from My workspace. See the documentationWritev0.0.6 -
Add Rows To Push Dataset
actionAppend rows to a table in a Power BI Push Dataset (streaming / realtime data). Only works for datasets created via the REST API withdefaultMode: Push— these datasets exposeaddRowsAPIEnabled: trueon the object returned by List Datasets. Use List Datasets first to resolve a dataset name →datasetIdand inspect itstablesfor the exacttableName(case-sensitive). PassworkspaceId(from List Workspaces) orworkspaceNameto target a specific workspace, or omit both for My workspace. Rows must match the table's column schema.rowsaccepts either a JSON array ([{...}, {...}]) or a JSON-stringified array. Each row is an object ofcolumnName → value. Common mistakes: (1) case mismatch ontableNamereturns 404 — copy the exact string from the dataset'stablesarray. (2) Sending values that don't match the declared column data type returnsRequestedResourceNotFoundorDMTS_DatasourceHasNoCredentialsError. Push-dataset rows have no individual IDs and cannot be updated or deleted — only appended or bulk-cleared. See the documentationWritev0.0.3 -
Cancel Dataset Refresh
actionCancels a refresh operation for a specified dataset in Power BI. See the documentationWritev0.0.5 -
Create Dataset
actionCreates a new Push Dataset in Power BI. See the documentationWritev0.0.4 -
Execute DAX Query
actionExecute a DAX (Data Analysis Expressions) query against a Power BI dataset (semantic model). This is the primary analytics tool — use it to answer questions about values, aggregates, or filtered rows in a dataset. Use List Datasets first to resolve a dataset name →datasetId. The query must be a single valid DAX expression starting withEVALUATE. Table discovery (standard datasets): For datasets published from Power BI Desktop, the RESTGET /datasets/{id}/tablesendpoint is scoped to push datasets only and will not list tables. UseEVALUATE INFO.TABLES()instead — it returns every table name in the semantic model. Typical agent flow: List Workspaces → List Datasets → Execute DAX Query (EVALUATE INFO.TABLES()) → Execute DAX Query (EVALUATE 'TableName'). Common patterns: • Discover all tables —EVALUATE INFO.TABLES()(use this before querying an unknown dataset) • List all rows of a table —EVALUATE 'Species'• Filter —EVALUATE FILTER('Species', 'Species'[dietType] = "Carnivore")• Top N by column —EVALUATE TOPN(5, 'Species', 'Species'[weightKg], DESC)• Aggregate single value —EVALUATE ROW("Total", SUMX('Species', 'Species'[weightKg]))• Peek at a table's columns —EVALUATE TOPN(0, 'Species')(returns an empty rowset with column names in the response). Limits: max 100,000 rows or 1,000,000 values per query, andDEFINE/multiple-statement queries are not supported via REST. The tenant must have 'Dataset Execute Queries REST API' enabled (admin setting) or the call returns 401/403. PassworkspaceId(from List Workspaces) orworkspaceNameto target a specific workspace, or omit both for My workspace. See the documentationRead-onlyv0.0.4 -
Export Report
actionExport a Power BI report to a file format such as PDF, PPTX, or PNG. Requires a report ID (use List Reports to find it) and defaults to PDF if no format is given. PassworkspaceId(from List Workspaces) orworkspaceNameto target a specific workspace, or omit both for My workspace. Supportedformatvalues depend on the report type: Power BI reports supportPDF,PPTX,PNG. Paginated reports additionally supportCSV,XLSX,DOCX,XML,MHTML. This API is Premium-only: requires the workspace to be backed by Premium capacity, Premium Per User, or Embedded capacity. On shared (free) capacity it returnsFixedCapacityLimitExceeded/ 403. The export is asynchronous — this tool starts the export, then polls until the job reachesSucceededorFailed(orpollTimeoutSecondselapses), then downloads the file and returns it as base64 along with the job metadata. PNG exports only work for single-page reports. For PPTX/PDF, passpages(array of page names, e.g.,["ReportSection", "ReportSection1"]) to limit the export. See the documentationWritev0.0.3 -
Get Dataset Refresh
actionTriggers a refresh operation for a specified Power BI dataset. See the documentationRead-onlyv0.0.3 -
Get Refresh History
actionGet the refresh history for a Power BI dataset. Use List Datasets first to resolve a dataset name →datasetId. PassworkspaceId(from List Workspaces) orworkspaceNameto scope to a specific workspace, or omit both for My workspace. Each entry includesrequestId,refreshType(OnDemand,Scheduled,ViaApi, etc.),startTime,endTime,status(Completed,Failed,Disabled,Cancelled,Unknown—Unknownmeans still in progress), andserviceExceptionJsonon failures. See the documentationRead-onlyv0.0.3 -
Get Report by id
actionRetrieve metadata for a single Power BI report by ID. Uses My workspace by default; set Workspace (Group) ID for a specific workspace. See the documentationRead-onlyv0.0.2 -
Get Reports
actionGet reports from a Power BI workspace. See the documentationRead-onlyv0.0.6 -
List Dashboards
actionList Power BI dashboards in a workspace. Defaults to the authenticated user's personal My workspace when no workspace is specified. PassworkspaceId(preferred, from List Workspaces) ORworkspaceNameto scope to a specific workspace. Each dashboard includesid,displayName,isReadOnly,webUrl, andembedUrl. Note: dashboards cannot be created via the REST API — they are built interactively in the Power BI service. See the documentationRead-onlyv0.0.3 -
List Datasets
actionList Power BI datasets (semantic models) in a workspace. Defaults to the authenticated user's personal My workspace when no workspace is specified. PassworkspaceId(preferred, from List Workspaces) ORworkspaceNameto scope to a specific workspace. Each dataset includesid,name,webUrl,addRowsAPIEnabled(true for Push Datasets),isRefreshable, anddefaultMode(Push,Streaming,PushStreaming,AsOnPrem,AsAzure). Use this tool to resolve a dataset name → ID before calling Refresh Dataset, Execute DAX Query, Get Refresh History, or Add Rows To Push Dataset. For push-dataset row inserts, call the dataset'sGET tablesendpoint (not exposed as a separate tool) by inspecting the dataset'sname→ tables are defined at dataset creation; the table name is the string configured at creation time (e.g.,Species). See the documentationRead-onlyv0.0.3 -
List Reports
actionList Power BI reports in a workspace. Defaults to the authenticated user's personal My workspace when no workspace is specified. PassworkspaceId(preferred, from List Workspaces) ORworkspaceNameto scope to a specific workspace — the tool resolves the name to an ID server-side. Each report includesid,name,webUrl,embedUrl,datasetId, andreportType(PowerBIReportorPaginatedReport). Note: reports cannot be created via the REST API — they are published from Power BI Desktop. See the documentationRead-onlyv0.0.3 -
List Workspaces
actionList the Power BI workspaces (groups) the authenticated user can access. Use this tool first whenever the user refers to a workspace by name — it returns theidyou need to pass asworkspaceIdto other tools. Power BI has no/meendpoint, so the set of accessible workspaces is the user's primary context (the 'who am I' signal for this app). Every item in the response includesid,name,isReadOnly,isOnDedicatedCapacity, andtype. Note: when a user says 'my workspace' without a name, they may mean personal My workspace (implicit — pass noworkspaceIdto other tools) OR a specific named workspace — ask only if ambiguous. See the documentationRead-onlyv0.0.3 -
Refresh Dataset
actionTrigger a refresh of a Power BI dataset. Returns 202 Accepted on success; the request ID is available in theLocationresponse header (last path segment) andx-ms-request-idheader — use Get Refresh History to check status. Use List Datasets first to resolve a dataset name →datasetId. PassworkspaceId(from List Workspaces) orworkspaceNameto target a specific workspace, or omit both for My workspace.notifyOptioncontrols email notifications on refresh outcome:NoNotification(default),MailOnCompletion, orMailOnFailure. Power BI Pro licenses allow up to 8 scheduled refreshes per day; Premium allows 48. Note: Push datasets accept this endpoint but the refresh is metadata-only (tile refresh), not a data refresh — no cancellable history entry is produced. See the documentationWritev0.1.2
EVENTS
Microsoft Power BI triggers
Event sources your backend can deploy for users and receive through a webhook.
-
Dataset Refresh Completed
triggerEmit new event when a dataset refresh operation has completed. See the documentationv0.0.7 -
Dataset Refresh Failed
triggerEmit new event when a dataset refresh operation has failed in Power BI. See the documentationv0.0.7 -
New Dataset Refresh Created
triggerEmit new event when a new dataset refresh operation is created. See the documentationv0.0.4
MULTI-APP
Use Microsoft Power BI with other popular apps
Most products don't stop at one integration. Pair Microsoft Power BI with the other apps your users rely on, and ship use cases that span both.
REFERENCE
App details
Reference metadata for the Microsoft Power BI connector in the Pipedream registry.
- App slug
- microsoft_power_bi
- Authentication
- OAuth
- Categories
- Data Analytics
- Actions
- 15
- Triggers
- 3
- API proxy
- Available
OAuth scopes
These are the scopes Pipedream's managed Microsoft Power BI OAuth client requests when one of your users connects an account. Supply your own OAuth client to request a different set.
- offline_access
- https://analysis.windows.net/powerbi/api/App.Read.All
- https://analysis.windows.net/powerbi/api/Dashboard.Read.All
- https://analysis.windows.net/powerbi/api/Workspace.Read.All
- https://analysis.windows.net/powerbi/api/Dataset.ReadWrite.All
- https://analysis.windows.net/powerbi/api/Report.Read.All
- https://analysis.windows.net/powerbi/api/Report.ReadWrite.All