dataflows-cli

Manages Fabric Dataflow Gen2 items, Power Query M definitions, and Gen1-to-Gen2 upgrades via REST APIs.

1.1k|301|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/microsoft/skills-for-fabric --skill dataflows-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dataflows-cli
Source: https://github.com/microsoft/skills-for-fabric/tree/main/plugins/fabric-skills/skills/dataflows-cli
Command: npx skills add https://github.com/microsoft/skills-for-fabric --skill dataflows-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Working with Microsoft Fabric Dataflow Gen2 items through raw REST APIs is error-prone: connection bindings use composite ClusterId/DatasourceId formats, definitions require three base64-encoded parts, executeQuery returns Apache Arrow streams with errors embedded in HTTP 200 responses, and Gen1-to-Gen2 upgrades have strict generation boundaries. This Skill encodes the correct endpoints, payload shapes, and guardrails so an AI assistant performs these operations correctly.

Core Features & Use Cases

  • Authoring mode: Create dataflows end-to-end, edit Power Query M with pre-save executeQuery previews, bind connections, and configure output destinations (Lakehouse, Warehouse, ADX, Azure SQL) via updateDefinition.
  • Consumption mode: Read saved dataflow definitions, discover parameters, run saved or ad-hoc M queries, parse Arrow IPC results into tables or CSV, and inspect refresh history — strictly read-only.
  • Upgrade mode: Scan workspaces or tenants for Gen1 dataflows, assess seven upgrade risk signals (BYOSA storage, DirectQuery, incremental refresh, ownership), and execute saveAsNativeArtifact to create Gen2.1 copies.
  • Use Case: Ask the assistant to preview a new M query against a bound connection, persist it into an existing dataflow definition, and trigger a refresh with ApplyChangesIfNeeded — all with correct LRO polling and telemetry headers.

Quick Start

Ask the assistant to show the refresh history and parameters of a named dataflow in your Fabric workspace, and it will resolve the workspace and item IDs, read the consumption reference, and run the appropriate az rest calls.

Frequently Asked Questions about dataflows-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Fabric Dataflow Gen2 via the REST API?

Create the dataflow shell with POST /v1/workspaces/{ws}/dataflows, then persist the definition with POST updateDefinition containing three base64-encoded parts: mashup.pq, queryMetadata.json, and .platform. Connections must be discovered or created first and bound using the composite ClusterId/DatasourceId format.

How do I run a Power Query M query against a Fabric dataflow?

Call the executeQuery endpoint with a top-level QueryName field naming a shared member of the dataflow's mashup, optionally with a full customMashupDocument section for ad-hoc queries. Results return as a raw Apache Arrow IPC stream, so save with --output-file and parse with pyarrow.

Why does executeQuery return HTTP 200 but my query failed?

executeQuery returns 200 with an Arrow stream even when the source query fails; the error is embedded in the stream's PQ Arrow Metadata as an {"Error":"..."} block. Always scan the Arrow body for embedded errors before treating results as successful.

Can I upgrade a Gen2 dataflow to Gen2.1 with saveAsNativeArtifact?

No. saveAsNativeArtifact only works from Gen1 to Gen2.1, and no public in-place upgrade endpoint exists for Gen2 sources. The skill enforces a hard stop for Gen2 or unknown-generation sources and only permits read-only readiness scans in those cases.

What blocks a Gen1 dataflow from being upgraded to Gen2?

Three blocking risk signals apply: BYOSA/custom ADLS Gen2 storage (modelUrl pointing to customer storage), DirectQuery connections, and insufficient permissions (caller must be the dataflow owner or a workspace Contributor/Admin). Non-blocking signals like incremental refresh or pipeline dependencies require manual follow-up after save-as.

Why does verifying a dataflow connection binding return zero connections?

GET /items/{id}/connections reflects refresh-materialized state, not the persisted definition, so it returns empty right after binding. Verify bindings by calling getDefinition and decoding the connections array in queryMetadata.json instead.