p00318821-eng/skills-plugins-hooks-agents/dataflows-authoring-cli
Claude Code and agent skill by p00318821-eng/skills-plugins-hooks-agents
- community
Checking that the SKILL.md file is still in the repository.
Create, update, delete, and refresh Fabric Dataflows Gen2 via write-side CLI against Fabric Items and Connections APIs. Builds mashup.pq + queryMetadata definitions, triggers parameterized refreshes, manages connections, and configures output destinations (Lakehouse, Warehouse, ADX, Azure SQL). Includes preview-driven authoring loop (executeQuery + customMashupDocument). For executing saved queries or reading refresh status, use `dataflows-consumption-cli`. Triggers: "create dataflow", "update dataflow", "delete dataflow", "trigger dataflow refresh", "refresh dataflow", "preview Power Query M", "preview mashup", "preview before save", "iterate dataflow M", "create Fabric data source connection", "create dataflow connection", "bind connection", "list supportedConnectionTypes", "dataflow output destination", "dataflow write to lakehouse", "dataflow write to warehouse", "dataflow write to ADX", "DataDestinations annotation", "author dataflow".
Install
npx vskill@latest install p00318821-eng/skills-plugins-hooks-agents/dataflows-authoring-cliSKILL.md
Update Check — ONCE PER SESSION (mandatory)The first time this skill is used in a session, run the check-updates skill before proceeding.- GitHub Copilot CLI / VS Code: invoke thecheck-updatesskill.- Claude Code / Cowork / Cursor / Windsurf / Codex: compare local vs remote package.json version.- Skip if the check was already performed earlier in this session.
CRITICAL NOTES1. To find the workspace details (including its ID) from workspace name: list all workspaces and, then, use JMESPath filtering2. To find the item details (including its ID) from workspace ID, item type, and item name: list all items of that type in that workspace and, then, use JMESPath filtering
dataflows-authoring-cli — Dataflows Gen2 Authoring via CLI
Table of Contents
This skill (`SKILL.md`)
| Section | Notes | |
|---|---|---|
| Tool Stack | az + jq + base64 + curl | |
| Connection | Workspace/dataflow ID discovery | |
| Agentic Workflows | Start here. A: create end-to-end; B: modify existing; C: preview loop | |
| MUST DO / AVOID / PREFER | Authoring rules | |
| Troubleshooting | Symptom → fix table | |
| Examples | Runnable bash + PowerShell recipes | |
| Output Expectations | Response conventions |
References (in `references/`)
| File | When to read | |
|---|---|---|
| authoring-cli-quickref.md | One-liner recipes, status enums, base64 helpers, connection-binding quick patterns | |
| authoring-script-templates.md | Full bash + PowerShell templates; end-to-end smoke test; LRO polling pattern | |
| connection-management.md | List/create/inspect connections; supportedConnectionTypes; resolve ClusterId; ID format cheat sheet | |
| mashup-preview.md | executeQuery contract: bootstrap branch, auto-wrap rule, hard avoid for unbounded preview | |
| output-destinations.md | Output destination patterns: Lakehouse Table, Lakehouse Files, Warehouse, ADX, Azure SQL. DataDestinations annotation, hidden query, loadEnabled rules, connection limitations |
Common refs (in `../../common/`)
| File | When to read | |
|---|---|---|
| COMMON-CLI.md | az login, token acquisition, az rest, pagination, LRO polling, CLI gotchas. § Finding Workspaces and Items in Fabric is mandatory. | |
| COMMON-CORE.md | Fabric topology, environment URLs, authentication, core REST API surface | |
| ITEM-DEFINITIONS-CORE.md | Definition envelope; per-item-type payload contracts | |
| DATAFLOWS-AUTHORING-CORE.md | Authoring capability matrix; 3-part definition structure; M structure; connection model; ALM / Git integration |
Sister skills
| Skill | Use for | |
|---|---|---|
| dataflows-consumption-cli | Execute persisted queries; ad-hoc read-only customMashupDocument with no intent to persist; Arrow → CSV/pandas conversion; refresh status/history. |
Tool Stack
| Tool | Role | Install | |
|---|---|---|---|
az CLI | Primary: Auth (az login), REST API calls (az rest), token acquisition. | Pre-installed in most dev environments | |
jq | Parse and manipulate JSON responses and definition payloads. | Pre-installed or trivial | |
base64 | Encode/decode definition parts for the REST API. | Built into bash / [Convert]::ToBase64String() in PowerShell | |
curl | Alternative to az rest when raw HTTP control is needed. | Pre-installed | |
uuidgen | Generate per-query / per-platform GUIDs for queryId and logicalId when building a new dataflow definition (Workflow A). | Pre-installed on Linux/macOS; on Windows use PowerShell [guid]::NewGuid().Guid or run via WSL |
Agent check — verifyaz,jq, andcurlare available before first operation.uuidgenis only needed for Workflow A (Create).For installation and auth setup see COMMON-CLI.md.
Connection
Discover Workspace and Dataflow IDs
Per COMMON-CLI.md Finding Workspaces and Items in Fabric:
Reusable Connection Variables
Agentic Workflows
Three workflows cover the typical authoring tasks:
- [A. Create a New Dataflow End-to-End](#a-create-a-new-dataflow-end-to-end) — discover/create a connection, create the dataflow, save M + bindings, validate, optionally refresh.
- [B. Modify an Existing Dataflow](#b-modify-an-existing-dataflow) — read-modify-write the definition; the canonical Discover → Formulate → Execute → Verify loop.
- [C. Preview-Driven Authoring Loop](#c-preview-driven-authoring-loop) — iterate on candidate M via
executeQuerybefore persisting viaupdateDefinition. - [D. Output Destination](#d-output-destination) — write query results to Lakehouse (table/files), Warehouse, ADX, or Azure SQL via
DataDestinationsannotation. Full reference: output-destinations.md.
A. Create a New Dataflow End-to-End
Use this when the dataflow does not yet exist. Covers the full happy path: discover-or-create a connection, create the dataflow shell, save M + bindings in one updateDefinition, validate, optionally refresh.
Steps:
- List existing connections and filter by
connectionDetails.typeand the target URL/host — reuse if a match exists (GET /v1/connections+ JMESPath). - If no match, create the connection. First
GET /v1/connections/supportedConnectionTypesto discover required parameters and supported credential types, thenPOST /v1/connections(sync 201). Body shape and credential schemas: connection-management.md. - Resolve `ClusterId` for the composite binding.
GET https://api.powerbi.com/v2.0/myorg/me/gatewayClusterDatasourceswith--query "value[?id=='$CONN_ID'] | [0].clusterId", audience--resource "https://analysis.windows.net/powerbi/api"(no trailing slash). The per-id route returnsPowerBIEntityNotFoundfor cloud connections. Newly-created connections may take a few seconds to surface — retry on empty. Detail: connection-management.md § Resolving ClusterId. - Create the dataflow shell.
POST /v1/workspaces/{ws}/dataflowswith{"displayName":"…"}returns sync 201. Thedefinitionfield is optional at create time and can be set in the next step. - Save M + connection bindings in one call.
POST /v1/workspaces/{ws}/dataflows/{df}/updateDefinition?updateMetadata=truewith three parts:mashup.pq(realWeb.Contents/Sql.Database/ …),queryMetadata.json(withconnections[]populated; eachconnectionIdis the stringified composite{"ClusterId":"…","DatasourceId":"…"}), and.platform. Typically returns sync 200; may return 202 + LROLocationon large bodies — handle both. - Verify the binding persisted. Re-call
getDefinition, decodequeryMetadata.json, and confirmconnections[]is intact. Do not useGET /items/{id}/connectionsfor verification — that endpoint reflects refresh-materialized state, not the persisted definition, and returns 0 even after a successful bind. See AVOID. - (Optional) Validate via executeQuery before refresh.
POST /v1/workspaces/{ws}/dataflows/{df}/executeQuerywith body{"QueryName":"<shared-member>"}(top-level, PascalCaseQueryName). See Workflow C. - (Optional) Trigger refresh to materialize.
POST .../jobs/instances?jobType=Refreshwith body{"executionData":{"executeOption":"ApplyChangesIfNeeded"}}. `ApplyChangesIfNeeded` is required on the first refresh after any definition change — without it, Fabric refreshes the previously-applied definition. Poll the LRO untilstatusisCompleted(refresh enum) orFailed/Cancelled.
One-shot vs two-step bind+save. Steps 4-5 can be one call (default; saves an HTTP round trip) or split into a bootstrap-bindupdateDefinitionfollowed by a full-MupdateDefinition. Both work — see PREFER.
B. Modify an Existing Dataflow
Use this when the dataflow already exists. Canonical Discover → Formulate → Execute → Verify loop. If the dataflow does not yet exist, see Workflow A instead.
- Discover — list workspaces, list dataflows,
getDefinition(decodemashup.pqandqueryMetadata.json). Validate allconnections[]entries viaGET /v1/connections/{id}. - Formulate — modify M, re-encode parts, ensure every referenced
connectionIdexists in the caller's connection store. - Execute —
POST .../updateDefinition?updateMetadata=truewith all 3 parts (full replacement). Optionally trigger refresh. - Verify — re-call
getDefinitionto confirm changes; poll refresh LRO; for refresh failures, isolate M+source viaexecuteQuerybefore re-triggering.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/dataflows-authoring-cli/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/p00318821-eng/skills-plugins-hooks-agents/dataflows-authoring-cli)