dataflows-cli

Author, inspect, and upgrade Microsoft Fabric Dataflow Gen2 items via REST APIs and CLI.

Updated Aug 19, 2026
One-click install
npx skills add https://github.com/paulasilvatech/Fabric-Agentic-SDLC --skill dataflows-cli-paulasilvatech
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dataflows-cli
Source: https://github.com/paulasilvatech/Fabric-Agentic-SDLC/tree/main/.github/skills/dataflows-cli
Command: npx skills add https://github.com/paulasilvatech/Fabric-Agentic-SDLC --skill dataflows-cli-paulasilvatech

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, executeQuery returns Apache Arrow streams instead of JSON, and Gen1-to-Gen2 upgrades require guarded save-as workflows. This Skill provides mode-dispatched, CLI-driven procedures that handle these details correctly. ## Core Features & Use Cases - Authoring mode: Create or modify dataflows end-to-end — connection discovery and creation, Power Query M preview via executeQuery before persisting, updateDefinition with the three-part definition (mashup.pq, queryMetadata.json, .platform), and output destinations to Lakehouse, Warehouse, ADX, or Azure SQL. - Consumption mode: Read-only inspection of saved dataflows — decode definitions, discover parameters, run saved or ad-hoc M queries, parse Arrow IPC results into tables or CSV, and review refresh job history. - Upgrade mode: Scan workspaces or tenants for Gen1 dataflows, assess seven upgrade risk signals (BYOSA storage, DirectQuery, incremental refresh, and more), and execute guarded saveAsNativeArtifact upgrades to Gen2.1. - Use Case: A data engineer needs to migrate a Gen1 dataflow to Gen2.1. The Skill scans the workspace, classifies readiness as Safe/Manual/Blocked, executes the save-as with a file-based request body, and validates the new artifact's provisionState. ## 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 IDs and run the read-only consumption workflow.

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 REST API?▼

Create the dataflow shell with POST /v1/workspaces/{ws}/dataflows, then persist the M code and connection bindings with POST updateDefinition containing three base64-encoded parts: mashup.pq, queryMetadata.json, and .platform. Discover or create the connection first and resolve its ClusterId via the Power BI gatewayClusterDatasources list endpoint.

How to preview Power Query M code before saving a dataflow?▼

Call the executeQuery endpoint with a top-level QueryName field and a customMashupDocument containing a complete section Section1 document. The response is a raw Apache Arrow IPC stream, not JSON, so save it with --output-file and parse it with pyarrow before persisting via updateDefinition.

How do I migrate a Gen1 dataflow to Fabric Dataflow Gen2?▼

Use the Power BI REST API saveAsNativeArtifact endpoint to create a Gen2.1 copy while preserving the original Gen1 dataflow. Run a readiness scan first to check risk signals like BYOSA storage, DirectQuery, and ownership, since blocked dataflows cannot be upgraded.

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 field. Always scan the Arrow body for an embedded error marker before treating results as successful.

Can I upgrade a Gen2 dataflow to Gen2.1 in place?▼

No public save-as or in-place upgrade endpoint exists for Gen2 sources; save-as runs only from Gen1 to Gen2.1. The Skill stops before any API call in this case and asks you to clarify the intended outcome.

Why does my az rest call to Fabric return 401 Unauthorized?▼

A 401 usually means a missing az login session or a wrong token audience. Fabric APIs need --resource https://api.fabric.microsoft.com, while Power BI v2 endpoints need https://analysis.windows.net/powerbi/api without a trailing slash.