Dataflows CLI
MicrosoftOfficialPublished by Microsoft
- Skill
- Tool integration
- Automation and integrations
- MIT
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The dataflows-cli skill provides a structured interface for interacting with Fabric Dataflow Gen2 items. It operates as a mode-based dispatcher, requiring users to select between authoring, consumption, or upgrade modes. The skill handles complex tasks such as M language definition updates, connection management, output destination configuration, and the migration of legacy Gen1 dataflows to Gen2.1. It emphasizes safe, intentional operations by requiring users to read specific reference documentation before executing state-changing API calls.
What it does
- Creates and updates Fabric Dataflow Gen2 items and their definitions.
- Manages connections, credentials, and output destinations for dataflows.
- Previews Power Query M definitions using executeQuery to validate logic before persistence.
- Facilitates the upgrade of Gen1 dataflows to Gen2.1 via save-as operations.
- Retrieves refresh history and inspects existing dataflow definitions.
- Provides a framework for executing and testing ad-hoc M queries.
When to use it
- When you need to programmatically create or modify Fabric Dataflow Gen2 items.
- When performing maintenance on Power Query M definitions or data connections.
- When migrating legacy Gen1 dataflows to the Gen2.1 architecture.
- When you need to audit refresh history or validate dataflow configurations.
- When testing M query logic against live data sources before saving changes.
Advantages
- Enforces a structured, mode-based workflow to prevent accidental mutations.
- Provides granular control over Dataflow Gen2 definitions and metadata.
- Supports complex lifecycle tasks like Gen1-to-Gen2 upgrades.
- Integrates directly with Fabric REST APIs for automated data pipeline management.
Usage examples
- “Show me the refresh history and parameters of the SalesIngest dataflow.”
- The agent enters consumption mode, reads the consumption reference, and retrieves the requested refresh history and parameters for the specified dataflow.
- “Preview this M query, then save it into the SalesIngest dataflow definition.”
- The agent enters authoring mode, previews the M query to validate it, and then executes the updateDefinition call to persist the changes.
- “Is my Gen1 dataflow ready to upgrade to Gen2.1?”
- The agent enters upgrade mode, performs a readiness assessment, and reports on the risk and requirements for upgrading the specified Gen1 dataflow.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/microsoft/dataflows-cli/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip dataflows-cli.zip -d .agents/skills
Documentation by Microsoft
Telemetry — MANDATORY. Every
api.fabric.microsoft.comcall must carryx-ms-fabric-skill: dataflows-cli(az rest:--headers "x-ms-fabric-skill=dataflows-cli"), including every LRO poll,fabric_lroand retry. Snippets omit it — add it anyway.
CRITICAL NOTES
To find the workspace details (including its ID) from workspace name: list all workspaces and, then, use JMESPath filtering
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
Skill disambiguation: use
dataflows-clifor every Fabric Dataflow Gen2 item and Power Query M concern. Synapse / ADF pipeline and dataset JSON translation ispipeline-migration; Spark notebook transformations arespark-cli; T-SQL transformations aresqldw-cli.
Fabric Dataflow Gen2 -- CLI Skill
This one skill owns Fabric Dataflow Gen2 items: connections, Power Query M, output destinations, saved definitions, refresh history, and Gen1 upgrades.
It is a mode dispatcher and contains NO procedures. Pick the mode that matches the request from the table below, then read the matching references/<mode>.md file end to end with your file-reading tool BEFORE issuing a single command. That file holds the endpoints, payload shapes, templates and gotchas; acting without it produces wrong payloads and wrong results.
Read it once per session. A file you have already read stays in context, so do not re-read it on a later turn; open the deeper files under references/<mode>/ only when a row in that file's reference table matches what you still need, and open only that row's file.
Mode selection
| Mode | Use when the request ... | Example triggers | Read this first |
|---|---|---|---|
authoring | creates or changes a dataflow: connections, credentials, M edits previewed before save, output destinations, updateDefinition | executeQuery preview, updateDefinition, connection setup, supportedConnectionTypes, credentialType, add output destination | references/authoring.md |
consumption | reads a saved dataflow: definition, parameters, refresh history, or runs a saved/ad-hoc read-only M query and parses Arrow | getDefinition, executeQuery saved query, ad-hoc query, Arrow IPC, refresh history | references/consumption.md |
upgrade | upgrades a Gen1 dataflow to Gen2.1 via save-as and rebind, or assesses upgrade readiness/risk | Gen1 Gen2 readiness, saveAsNativeArtifact, clone Gen1 dataflow, upgrade risk assessment | references/upgrade.md |
Mode boundary rule
consumption is read-only. A preview run that exists to validate M before updateDefinition, and any capability lookup (supportedConnectionTypes, credentialType), belong to authoring even though they issue the same executeQuery call -- classify by intent, not by endpoint.
If a request genuinely spans modes, handle them one at a time and read each reference before you start that part. If the mode is ambiguous after reading this table, ask one short clarifying question instead of guessing.
Terminal write -- the step you must not skip
Reading the reference and planning the change is NOT completing the task. Each mutating mode ends with one state-changing call. If you did not issue it, nothing was persisted -- say so explicitly rather than reporting success.
| Mode | Terminal write |
|---|---|
authoring | POST /v1/workspaces/{ws}/dataflows/{id}/updateDefinition to persist the M, connections and output destinations; a NEW dataflow needs POST /v1/workspaces/{ws}/items (or /dataflows) first. executeQuery is a preview and writes nothing. If the user asked for a refresh, also POST .../jobs/instances?jobType=Refresh. |
consumption | none -- this mode is read-only |
upgrade | saveAsNativeArtifact to create the Gen2.1 artefact, then rebind. A readiness report alone does not upgrade anything. |
Before you report the task done, confirm the terminal call returned success and, where the reference documents a readback, read the artefact back to prove the change landed.
upgrade generation boundary -- HARD STOP (mandatory)
Save-as runs only from Gen1 to Gen2.1. For an execution request whose source is Gen2, or whose source generation is not established, state that no public save-as or in-place upgrade endpoint is available and stop before any API call. This does not block a read-only readiness scan whose purpose is to discover and classify Gen1 candidates.
Do not read "choose the closest endpoint and proceed" as approval to export a definition and create a copy, do not switch to authoring to do it instead, and do not mutate anything. Ask the user to clarify the intended outcome and to approve explicitly.
consumption reporting
consumption has no terminal write, so its deliverable is the answer itself. When that mode runs executeQuery, name the operation you called and state the QueryName you sent, verbatim, next to the results, plus whether it was a saved shared member or a non-persisted ad-hoc customMashupDocument. Rows alone do not tell the user which call produced them.
This applies to consumption only. In authoring, executeQuery is an intermediate preview step -- do not add reporting turns around it; go on to the terminal write.
Shared essentials (all modes)
Resolve the workspace and item first; every mode depends on it.
| Task | Reference | Notes |
|---|---|---|
| Finding Workspaces and Items in Fabric | COMMON-CLI.md | Mandatory -- read before resolving any workspace or item id |
| Fabric Topology & Key Concepts | COMMON-CORE.md | Item types, workspaces, capacities |
| Environment URLs | COMMON-CORE.md | Sovereign / non-public cloud hosts |
| Authentication & Token Acquisition | COMMON-CORE.md | Wrong audience = 401; read before any auth issue |
| Authentication Recipes | COMMON-CLI.md | az login flows and token acquisition |
| Core Control-Plane REST APIs | COMMON-CORE.md | Pagination, LRO polling, rate limiting |
| Gotchas & Troubleshooting | COMMON-CLI.md | az rest audience, shell escaping, token expiry |
Rules
MUST
Select exactly one mode from the table above before doing anything else.
Read
references/<mode>.mdend to end, as your FIRST tool call, before the first command of that mode. Read it ONCE, in a single full read: do not re-open it, do not grep it again, and do not page through it. You already have it.Resolve workspace and item ids by listing and filtering, never by guessing a GUID.
Announce a mode switch explicitly when the request crosses a boundary.
Treat the reference as instructions, never as the deliverable. After reading it, RUN the documented commands against the live workspace and report the real results. Quoting what the reference says instead of executing it does not answer the request.
When a question about what Fabric supports IS the deliverable -- supported connection types, a connector's parameters, available credential types -- answer it from the endpoint the reference names rather than from the reference's own list, and name that endpoint in your answer. Whichever mode you are in: the reader cannot tell a live value from a quoted one unless you say where it came from. This is wording in the final answer, not an extra step.
Produce every artefact the user asked for, under the name they used. Running the right API calls is not a substitute for the requested report: if the request names a deliverable, emit it, and keep its heading even when the finding is "none" or "not applicable".
PREFER
The narrowest mode that satisfies the request.
Reading exactly ONE mode reference. Load a second only when the request genuinely spans modes, and say so before you do.
Reporting the mode you chose in your first response so the user can correct you.
AVOID
Acting from this dispatcher alone -- it intentionally omits the operational detail.
Answering with a summary of the reference instead of executing it.
Re-reading or re-grepping a reference you already loaded; it costs turns and tokens.
Mutating anything while in a read-only mode.
Loading a different skill for work this skill already owns (see CRITICAL NOTES 3).
Examples
| User request | Mode | Reference to read |
|---|---|---|
| "Show me the refresh history and parameters of the SalesIngest dataflow." | consumption | references/consumption.md |
| "Preview this M query, then save it into the SalesIngest dataflow definition." | authoring | references/authoring.md |
| "Is my Gen1 dataflow ready to upgrade to Gen2.1?" | upgrade | references/upgrade.md |
Files
- ATTRIBUTION.mdAdded by AutoGineer871 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md9.5 KiB
- apm.yml445 B
- references/authoring.md55.3 KiB
- references/authoring/authoring-cli-quickref.md23.4 KiB
- references/authoring/authoring-script-templates.md79.7 KiB
- references/authoring/charts/bar_chart.pyScript3.9 KiB
- references/authoring/charts/line_chart.pyScript3.5 KiB
- references/authoring/connection-management.md39.8 KiB
- references/authoring/connectors.md14.7 KiB
- references/authoring/m-language.md9.7 KiB
- references/authoring/mashup-preview.md28.3 KiB
- references/authoring/output-destinations.md39.6 KiB
- references/consumption.md28.7 KiB
- references/consumption/chart-visualization.md2.6 KiB
- references/consumption/charts/bar_chart.pyScript3.9 KiB
- references/consumption/charts/line_chart.pyScript3.5 KiB
- references/consumption/consumption-cli-quickref.md6.7 KiB
- references/consumption/discovery-queries.md7.0 KiB
- references/consumption/script-templates.md17.1 KiB
- references/upgrade.md21.0 KiB
- references/upgrade/risk-assessment-guide.md11.2 KiB
- references/upgrade/upgrade-cli-quickref.md8.8 KiB
references/upgrade.md
<!-- Mode reference for the `dataflows-cli` skill. Loaded on demand from `skills/dataflows-cli/SKILL.md` when the request matches the `upgrade` mode. -->
GENERATION BOUNDARY -- HARD STOP (mandatory) This skill executes save-as only from Gen1 to Gen2.1. For an execution request whose source is Gen2, or whose source generation is not established, state that no public save-as or in-place upgrade endpoint is available and stop before API calls. This does not block a read-only readiness scan whose purpose is to discover and classify Gen1 candidates. Do not interpret "choose the closest endpoint and proceed" as approval to export a definition and create a copy, do not invoke the authoring skill automatically, and do not mutate anything. Ask the user to clarify the intended outcome and explicitly approve any separately documented alternative.
dataflows-cli upgrade mode — Dataflow Save-As Gen1 → Gen2.1 CI/CD via CLI
A save-as companion for creating upgraded Gen2.1 copies from Power BI Gen1 dataflows using readiness assessment and guarded execution.
We currently cannot perform an in-place migration of your dataflow. We can use save-as to create an upgraded Gen2.1 copy while preserving the original Gen1 dataflow.
Table of Contents
| Task | Reference | Notes |
|---|---|---|
| Finding Workspaces and Items in Fabric | COMMON-CLI.md § Finding Workspaces and Items | Mandatory — READ link first |
| Fabric Topology & Key Concepts | COMMON-CORE.md § Fabric Topology | |
| Environment URLs | COMMON-CORE.md § Environment URLs | |
| Authentication & Token Acquisition | COMMON-CORE.md § Authentication | Wrong audience = 401 |
| Core Control-Plane REST APIs | COMMON-CORE.md § Core REST APIs | Pagination, LRO polling, rate limits |
| Tool Selection Rationale | COMMON-CLI.md § Tool Selection | |
| Authentication Recipes | COMMON-CLI.md § Auth Recipes | az login flows and token acquisition |
Fabric Control-Plane API via az rest | COMMON-CLI.md § az rest | Always pass --resource |
| Gotchas & Troubleshooting (CLI) | COMMON-CLI.md § Gotchas | az rest audience, shell escaping |
| Quick Reference | COMMON-CLI.md § Quick Ref | Token audience / tool matrix |
| Dataflow Definition Structure | DATAFLOWS-AUTHORING-CORE.md § Definition | 3-part format for Gen2 CI/CD |
| Consumption Capability Matrix | DATAFLOWS-CONSUMPTION-CORE.md § Capabilities | Read-only discovery patterns |
| Upgrade CLI Quick Reference | upgrade-cli-quickref.md | All az rest one-liners for scanning & save-as |
| Risk Assessment Guide | risk-assessment-guide.md | Risk signal detection logic & API calls |
Tool Stack
| Tool | Role | Install |
|---|---|---|
az CLI | Primary: Auth (az login), REST API calls (az rest) against both Fabric and Power BI APIs. | Pre-installed in most dev environments |
jq | Parse and filter JSON responses (dataflow lists, risk signal extraction). | Pre-installed or trivial |
base64 | Decode dataflow definitions for inspection. | Built into bash / [Convert]::ToBase64String() in PowerShell |
Agent check — verify before first operation:
az --version 2>/dev/null || echo "INSTALL: https://aka.ms/install-azure-cli" jq --version 2>/dev/null || echo "INSTALL: apt-get install jq OR brew install jq"
Authentication & API Audiences
This skill uses two distinct API audiences. Using the wrong audience returns 401.
| API | Audience (--resource) | Use For |
|---|---|---|
| Fabric Items API | https://api.fabric.microsoft.com | List Gen2 dataflows (Fabric-native), workspace discovery |
| Power BI REST API | https://analysis.windows.net/powerbi/api | Gen1 dataflow discovery, saveAsNativeArtifact, data sources, upstream dataflows, Admin API scanning |
# Fabric Items API — list Gen2 dataflows in a workspace
az rest --method get \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/workspaces/$WS_ID/dataflows"
# Power BI REST API — list all dataflows (Gen1 + Gen2) in a workspace
az rest --method get \
--resource "https://analysis.windows.net/powerbi/api" \
--url "https://api.powerbi.com/v1.0/myorg/groups/$WS_ID/dataflows"
# Power BI Admin API — list all dataflows tenant-wide (requires admin role)
az rest --method get \
--resource "https://analysis.windows.net/powerbi/api" \
--url "https://api.powerbi.com/v1.0/myorg/admin/dataflows"Phase 1 — Awareness & Readiness
Goal: "Should I use save-as, and what will happen when I create a Gen2.1 copy?"
Agentic Workflow: Discover → Assess → Classify → Report
Follow this sequence for every save-as assessment:
Discover — Scan workspace(s) to inventory all dataflows, identifying Gen1 vs Gen2
Assess — For each Gen1 dataflow, check seven risk signals
Classify — Assign a readiness category: ✅ Safe / ⚠️ Manual followups / ❌ Blocked
Report — Output a Save-As Readiness Snapshot (markdown table + JSON)
Step 1: Discover — Identify Gen1 Dataflows
The Power BI REST API returns a generation property (value 1 or 2) on each dataflow. This is the preferred detection method — a single API call per workspace.
Non-Admin Path (per workspace)
WS_ID="<workspaceId>"
RESOURCE_PBI="https://analysis.windows.net/powerbi/api"
# List all dataflows — the `generation` property distinguishes Gen1 from Gen2
ALL_DATAFLOWS=$(az rest --method get \
--resource "$RESOURCE_PBI" \
--url "https://api.powerbi.com/v1.0/myorg/groups/$WS_ID/dataflows" \
--query "value[].{id:objectId, name:name, generation:generation, modelUrl:modelUrl, configuredBy:configuredBy}" -o json)
# Filter Gen1 dataflows
echo "$ALL_DATAFLOWS" | jq '[.[] | select(.generation == 1)]'
# Filter Gen2 dataflows
echo "$ALL_DATAFLOWS" | jq '[.[] | select(.generation == 2)]'Tip: A
modelUrlpointing todfs.core.windows.netadditionally indicates BYOSA (customer-managed storage) — a save-as blocker.
Admin Path (tenant-wide)
Requires Fabric administrator role or service principal with Tenant.Read.All scope. Rate limited to 200 requests/hour.
RESOURCE_PBI="https://analysis.windows.net/powerbi/api"
# List ALL dataflows in the tenant
ADMIN_DATAFLOWS=$(az rest --method get \
--resource "$RESOURCE_PBI" \
--url "https://api.powerbi.com/v1.0/myorg/admin/dataflows" \
--query "value[].{id:objectId, name:name, workspaceId:workspaceId, modelUrl:modelUrl, configuredBy:configuredBy}" \
-o json)
# Filter Gen1 dataflows — those with a modelUrl indicate CDM/Gen1 storage
# Note: Admin API may not expose the `generation` property; use modelUrl as fallback
echo "$ADMIN_DATAFLOWS" | jq '[.[] | select(.modelUrl != null and .modelUrl != "")]'Note: The Admin API supports
$filter,$top, and$skipfor pagination on large tenants.
Step 2: Assess — Check Risk Signals
For each Gen1 dataflow found, evaluate seven risk signals. See risk-assessment-guide.md for detailed API calls.
| # | Risk Signal | Detection Method | Impact |
|---|---|---|---|
| 1 | Incremental refresh | Check dataflow definition for incremental refresh policy configuration | ⚠️ Schedule migrates in disabled state; must re-enable and validate |
| 2 | BYOSA / Custom ADLS Gen2 storage | Check modelUrl — if points to customer storage account (not Power BI managed) | ❌ Data stays in old storage; Gen2 CI/CD uses Fabric-managed storage |
| 3 | Power Automate / API triggers | Check for external orchestration referencing the Gen1 dataflow ID | ⚠️ All integrations must update to new Gen2 artifact ID |
| 4 | Downstream pipeline dependencies | Check Fabric pipelines for dataflow activity references | ⚠️ Pipeline activities reference dataflow by ID; must re-bind |
| 5 | Linked / computed entities | Inspect dataflow definition for entity references to other dataflows | ⚠️/❌ Cross-dataflow references may break if source dataflows are not saved first |
| 6 | DirectQuery connections | Inspect data source types in definition | ❌ DirectQuery not supported in Gen2 CI/CD dataflows |
| 7 | Caller is not owner / insufficient role | Compare configuredBy against az account show --query user.name -o tsv — or attempt call and catch DataflowUnauthorizedError | ❌ saveAsNativeArtifact requires the caller to be the dataflow owner or have Contributor/Admin in the source workspace; Viewer/Member without ownership cannot execute save-as |
Step 3: Classify — Readiness Categories
| Category | Criteria | Action |
|---|---|---|
| ✅ Safe | No risk signals detected | Create a Gen2.1 save-as copy with saveAsNativeArtifact |
| ⚠️ Manual followups | Risk signals 1, 3, 4, or 5 (non-blocking) | Execute save-as, then remediate flagged issues |
| ❌ Blocked | Risk signals 2, 6, or 7 (blocking) | Cannot execute save-as until blocker is resolved |
Tip — detect ownership before save-as: The
configuredByfield in the dataflow list response contains the owner's email. Compare it against the currently logged-in user (az account show --query user.name -o tsv). If they don't match and your workspace role is below Contributor, flag the dataflow as ❌ Blocked (signal 7) and escalate to the owner.
Step 4: Report — Save-As Readiness Snapshot
Markdown Output (terminal)
## Save-As Readiness Snapshot
| Workspace | Dataflow | Type | Readiness | Risk Signals | Recommendation |
|---|---|---|---|---|---|
| Sales Analytics | SalesETL | Gen1 | ✅ Safe | None | Save as Gen2.1 copy now |
| Sales Analytics | CustomerLoad | Gen1 | ⚠️ Manual | Incremental refresh, Pipeline dep | Save as Gen2.1 copy, then re-enable schedule & update pipeline |
| Finance | FinanceDaily | Gen1 | ❌ Blocked | BYOSA storage | Resolve storage dependency first |JSON Output (automation)
{
"snapshotDate": "2025-04-13T10:00:00Z",
"summary": { "total": 3, "safe": 1, "manual": 1, "blocked": 1 },
"dataflows": [
{
"workspaceName": "Sales Analytics",
"workspaceId": "...",
"dataflowName": "SalesETL",
"dataflowId": "...",
"type": "Gen1",
"readiness": "safe",
"riskSignals": [],
"recommendation": "Save as Gen2.1 copy now",
"saveAsPath": "saveAsNativeArtifact"
}
]
}Save JSON to file: pipe to
jq '.' > readiness-snapshot.json
Execute with Guardrails
Goal: Invoke save-as and capture outcomes safely.
Gen1 → Gen2.1 CI/CD: saveAsNativeArtifact API
POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/dataflows/{gen1DataflowId}/saveAsNativeArtifactThis is a Preview API. It creates a new Gen2.1 CI/CD artifact copy while preserving the original Gen1 dataflow.
WS_ID="<workspaceId>"
GEN1_ID="<gen1DataflowId>"
# Write body to a temp file — az rest wraps inline --body in an envelope
# on some platforms, causing "saveAsRequest is a required parameter" errors.
cat > /tmp/save-as-body.json <<'EOF'
{
"displayName": "MyDataflow_Gen2CICD",
"description": "Saved as Gen2.1 copy from Gen1",
"includeSchedule": true,
"targetWorkspaceId": "<targetWorkspaceId>"
}
EOF
az rest --method post \
--resource "https://analysis.windows.net/powerbi/api" \
--url "https://api.powerbi.com/v1.0/myorg/groups/$WS_ID/dataflows/$GEN1_ID/saveAsNativeArtifact" \
--headers "Content-Type=application/json" \
--body @/tmp/save-as-body.jsonGotcha — inline body: Passing JSON inline via
--body '{...}'can causeaz restto wrap the payload in an extra envelope, resulting in"saveAsRequest is a required parameter"errors. Always use file-based body (--body @file.json) for this endpoint.
Gotcha — Windows
az.cmd: On Windows, omit-o jsonfromsaveAsNativeArtifactcalls — the flag produces"A value that is not valid (json) was specified for the outputFormat parameter"when routed throughaz.cmd. Capture output without-o jsonand parse withConvertFrom-Jsonin PowerShell, or pipe tojqin bash.
Gotcha — not idempotent (duplicate artifacts on retry):
saveAsNativeArtifactcreates a new artifact every time it is called. If a batch is interrupted and re-run, you will end up with multiple copies in the target workspace. To make retries safe: (1) check whether a Gen2 artifact with the intended name already exists before calling, or (2) include a timestamp indisplayNameand treat each run as a distinct artifact.
Gotcha — owner permissions: You must be the dataflow owner or have Contributor/Admin in the source workspace to call
saveAsNativeArtifact. If you are only a Viewer or Workspace Member who does not own the dataflow, the API returnsDataflowUnauthorizedError. Ask the dataflow owner or a workspace admin to run the save-as operation for those dataflows.
Request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
displayName | string (max 200) | No | Name for new artifact. Auto-generated with _copy1 suffix if omitted |
description | string (max 4000) | No | Description. Copied from source if omitted |
includeSchedule | boolean | No | Copy refresh schedule in disabled state |
targetWorkspaceId | string (uuid) | No | Target workspace. Same workspace if omitted |
Response: 200 OK with SaveAsNativeDataflowResponse:
artifactMetadata— full metadata of the new Gen2 CI/CD artifact (includingobjectId,provisionState)errors[]— non-fatal warning codes (save-as succeeds even if these occur):FailedToCopySchedule— schedule could not be copiedSetDataflowOriginFailed— origin tracking not setConnectionsUpdateFailed— connection strings could not be updated to Fabric format
Gen2 → Gen2 CI/CD: In-Place Upgrade
NOT YET AVAILABLE — This API is not available in the current public surface. This skill will be updated when the endpoint is published. Do not attempt to call a non-existent endpoint.
Post-Save-As Validation Checklist
Run these checks after save-as before any Gen1 cleanup:
Confirm
artifactMetadata.provisionStatereachesActive.Review
errors[]inSaveAsNativeDataflowResponseand create follow-up tasks for each warning.Confirm the new artifact exists in the target workspace and has expected name/description.
Verify dependent orchestration (pipelines, flows, API callers) is updated to the new artifact ID.
Only trigger refresh when the user explicitly approves.
Must/Prefer/Avoid
MUST DO
Always pass
--resourcetoaz rest— use the correct audience per the API table above. Wrong audience = silent 401.Always include
--headers "Content-Type=application/json"on POST calls to the Power BI REST API.Use file-based body for
saveAsNativeArtifact— pass--body @file.jsoninstead of inline JSON. Inline--body '{...}'can causeaz restto wrap the payload in an extra envelope, producing"saveAsRequest is a required parameter"errors.On Windows, omit
-o jsononsaveAsNativeArtifactcalls — useConvertFrom-Jsonin PowerShell or pipe tojqinstead. The-o jsonflag fails with"A value that is not valid (json)"error when routed throughaz.cmd.Verify you are the dataflow owner or Contributor before save-as —
saveAsNativeArtifactreturnsDataflowUnauthorizedErrorfor non-owners who are only Workspace Members or Viewers.Check for existing Gen2 artifacts before retrying —
saveAsNativeArtifactis not idempotent; interrupted batch runs create duplicate copies on retry. Either verify the target name is absent before calling, or use a unique timestampeddisplayNameper run.Scan before save-as — always run the readiness scan before execution.
Never refresh without explicit user consent — the Gen2 CI/CD artifact schedule is created in disabled state for safety.
Check
errors[]in saveAsNativeArtifact response — save-as may succeed with non-fatal warnings.Verify
provisionStateisActiveafter save-as — poll the artifact metadata until terminal state.Preserve the original Gen1 dataflow —
saveAsNativeArtifactleaves the Gen1 intact. Do not delete it until post-save-as validation passes.
PREFER
Admin API for tenant-wide scanning — more efficient than workspace-by-workspace for large tenants.
JSON output for automation — markdown is for human review, JSON for scripting and CI/CD integration.
Topological save-as order — save upstream dataflows (with linked entities) before downstream consumers.
Readiness-first execution — do not skip readiness assessment before save-as.
generationproperty for Gen1 detection — the Power BI REST API returnsgeneration: 1orgeneration: 2on each dataflow. Use this single-API-call approach over cross-API comparison.modelUrlcheck as secondary signal — dataflows with amodelUrlpointing todfs.core.windows.netare Gen1 using customer storage (BYOSA blocker).
AVOID
Saving blocked (❌) dataflows — resolve BYOSA storage and DirectQuery issues first.
Batch save-as without review — always review the readiness snapshot before saving multiple dataflows.
Hardcoded workspace/dataflow IDs — resolve dynamically via REST API.
Ignoring non-fatal errors —
FailedToCopySchedule,ConnectionsUpdateFailed, etc. require manual follow-up.Calling the Gen2→Gen2 CI/CD in-place save-as API — it does not exist yet. Do not fabricate endpoints.
Deleting Gen1 artifacts without explicit user consent — never delete Gen1 dataflows unless the user explicitly approves deletion, even after post-save-as validation confirms data integrity.
Using
-o jsonwithsaveAsNativeArtifacton Windows — omit the flag; capture raw output and parse it explicitly.Re-running batch save-as scripts without idempotency checks — always verify the target artifact doesn't already exist to avoid duplicate copies in the workspace.
Examples
Example 1: Full Phase 1 — Readiness Scan for a Single Workspace
Prompt: "Scan my Sales workspace for Gen1 dataflows and show me a readiness snapshot"
Agent response:
# Step 1 — Resolve workspace ID
WS_ID=$(az rest --method get \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/workspaces" \
--query "value[?displayName=='Sales'].id" -o tsv)
# Step 2 — List all dataflows with generation property
ALL_DFS=$(az rest --method get \
--resource "https://analysis.windows.net/powerbi/api" \
--url "https://api.powerbi.com/v1.0/myorg/groups/$WS_ID/dataflows" -o json)
# Step 3 — Filter Gen1 dataflows by generation property
GEN1_DFS=$(echo "$ALL_DFS" | jq '[.value[] | select(.generation == 1) |
{id: .objectId, name: .name, generation: .generation, modelUrl: .modelUrl}]')
echo "Gen1 dataflows found: $(echo $GEN1_DFS | jq length)"
echo "$GEN1_DFS" | jq '.'Example 2: Save-As a Gen1 Dataflow to Gen2.1
Prompt: "Migrate or upgrade the SalesETL Gen1 dataflow in my Sales workspace"
Agent response:
WS_ID="<workspaceId>"
GEN1_ID="<gen1DataflowId>"
# Write body to file (avoids az rest envelope wrapping)
cat > /tmp/save-as-body.json <<'EOF'
{"displayName": "SalesETL_Gen2CICD", "includeSchedule": true}
EOF
# Execute save-as
RESPONSE=$(az rest --method post \
--resource "https://analysis.windows.net/powerbi/api" \
--url "https://api.powerbi.com/v1.0/myorg/groups/$WS_ID/dataflows/$GEN1_ID/saveAsNativeArtifact" \
--headers "Content-Type=application/json" \
--body @/tmp/save-as-body.json)
# Check result
echo "$RESPONSE" | jq '{
newId: .artifactMetadata.objectId,
state: .artifactMetadata.provisionState,
errors: .errors
}'Example 3: Tenant-Wide Admin Scan
Prompt: "Show me all Gen1 dataflows across the entire tenant"
Agent response:
# Requires Fabric administrator role
ALL_DFS=$(az rest --method get \
--resource "https://analysis.windows.net/powerbi/api" \
--url "https://api.powerbi.com/v1.0/myorg/admin/dataflows" -o json)
# Gen1 dataflows have a modelUrl
echo "$ALL_DFS" | jq '[.value[] | select(.modelUrl != null and .modelUrl != "") |
{id: .objectId, name: .name, workspace: .workspaceId,
owner: .configuredBy, storage: .modelUrl}]'Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Python
Security
What our scanner noticed· Low risk
- Instructions that use the network
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Microsoft
- Publisher
- Microsoft (Official)
- Source
- microsoft/skills-for-fabric · skills/dataflows-cli · commit f8fac11
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Also distributed in
- microsoft/skills-for-fabric
AutoGineer is not affiliated with or endorsed by Microsoft or Microsoft.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download dataflows-cli.zip