Powerbi Report CLI
MicrosoftOfficialPublished by Microsoft
- Skill
- Tool integration
- Data and AI
- MIT
- Low risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The powerbi-report-cli skill provides a structured, mode-based framework for managing the entire Power BI report lifecycle. It acts as a dispatcher across four distinct phases: planning (requirements and scope), design (visual and layout strategy), authoring (local PBIR/PBIP file manipulation and validation), and management (Fabric item transport and rebinding). The skill enforces strict boundaries between these modes to ensure quality, requiring explicit approval for new reports and utilizing a dedicated CLI for metadata-driven validation and authoring tasks.
What it does
- Guides users through report requirements, scope, and page planning.
- Provides design contracts for visual archetypes, layouts, and branding.
- Enables local editing, validation, and previewing of PBIR and PBIP files.
- Handles report item transport to and from Microsoft Fabric.
- Supports re-theming, conditional formatting, and visual configuration.
- Enforces a mandatory approval gate for greenfield report development.
When to use it
- When planning a new Power BI report from a semantic model.
- When you need to define a professional design brief or layout strategy.
- When editing local PBIR/PBIP files, including visuals, filters, and themes.
- When validating report structure and formatting before deployment.
- When publishing or managing report items within a Fabric workspace.
Advantages
- Ensures consistent report quality through a structured, multi-mode workflow.
- Prevents premature publishing by enforcing a mandatory approval barrier.
- Uses a dedicated CLI to eliminate guesswork in PBIR schema and property editing.
- Maintains clear separation between design intent and technical implementation.
- Provides robust validation tools to catch errors before Fabric deployment.
Usage examples
- “Create a new executive report from this semantic model.”
- The agent enters planning mode, inspects the model, generates a report spec, and requests user approval before proceeding.
- “Design an operational page and choose the right charts.”
- The agent enters design mode, produces a design brief with page archetypes and chart recommendations.
- “Add a KPI page to this PBIP, validate it, and take screenshots.”
- The agent enters authoring mode, modifies the local PBIP files, runs validation, and captures screenshots for review.
- “Publish this local PBIP to my Fabric workspace and rebind it.”
- The agent enters management mode, performs the upload to Fabric, and completes the rebind operation.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/microsoft/powerbi-report-cli/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip powerbi-report-cli.zip -d .agents/skills
Documentation by Microsoft
Telemetry — MANDATORY. Every
api.fabric.microsoft.comcall must carryx-ms-fabric-skill: powerbi-report-cli(az rest:--headers "x-ms-fabric-skill=powerbi-report-cli"), including every LRO poll,fabric_lroand retry. Snippets omit it — add it anyway.
CRITICAL NOTES
To find workspace details, including its ID, from a workspace name: list all workspaces, then use JMESPath filtering.
To find item details, including its ID, from a workspace ID, item type, and item name: list all items of that type in that workspace, then use JMESPath filtering.
Use
powerbi-report-clifor the report artifact: requirements, design, PBIR/PBIP page and visual edits, preview, and publishing. Semantic model, measure, and DAX work belongs to a semantic-model skill. Natural-language questions about report data belong tofabriciq.
Power BI Reports - CLI Skill
This skill owns the Power BI report lifecycle end to end: requirements and scope, visual design, local PBIR/PBIP authoring and preview, and report-item transport to and from Microsoft Fabric.
It is a mode dispatcher and intentionally contains no detailed procedures. Select the mode that matches the request, then read the matching mode reference end to end before acting. The mode file holds the required workflow, commands, payloads, templates, and failure rules.
Mode Selection
| Mode | Use when the request... | Existing route examples | Read first |
|---|---|---|---|
planning | creates a new report/dashboard and needs requirements, model/dependency inspection, scope, a page plan, and approval before implementation | create a report, build a dashboard, create from a semantic model, plan then implement, walk me through creating a report | references/planning.md, then references/planning-part-02.md |
design | decides what a report should look like: tone, signature, page archetype, chart type, layout, color, typography, theme direction, accessibility, brand application, redesign, or critique | design a Power BI report, make the dashboard professional, choose a chart, apply a brand, redesign the report, create a design brief | references/design.md |
authoring | reads or edits local PBIR/PBIP files, validates them, previews the report, or captures screenshots | edit PBIR, create/add a report page or visual, format a visual, add filters/slicers/bookmarks/themes, validate PBIR, preview/reload/screenshot in Desktop or service | references/authoring.md |
management | moves a report definition to or from Fabric or manages the workspace report item | publish/upload/download PBIR or PBIP, list reports, get/update/delete a report, rebind a report | references/management.md |
Mode Boundary Rules
Classify by intent, not by which file or tool is already open.
designdecides what the report should look like;authoringwrites the PBIR that realizes it. Choosing a chart type isdesign; encoding it intovisual.jsonisauthoring.Restyling or reformatting an existing local report is
authoring, even when the request uses design language. Usedesignwhen the user wants advice or a design contract rather than a file change.authoringchanges local files and performs preview/validation. It does not publish to Fabric.managementtransports definitions and manages Fabric report items. It does not invent or directly author PBIR content.planningowns the guided requirements-to-approval flow for a new report. A focused edit to an existing report goes directly toauthoring.
A greenfield request can span modes in this order:
planning -> design -> authoring -> managementHandle one mode at a time. Announce each switch and read the new mode reference
before starting that part. The planning approval gate is a turn boundary:
never build or publish until the user explicitly approves the locked spec in a
later reply.
GREENFIELD APPROVAL BARRIER — MANDATORY. When a new-report request asks to plan, build, and/or publish but the user has not approved a locked spec in a prior reply, set the current phase to
approval_pendingand keepplanningas the only active mode. In this phase, do not loadauthoringormanagement, edit/scaffold PBIR or semantic-model files, generate synthetic data, call Fabric write APIs, or publish. Persist_brief/report-spec.md, ask for explicit approval, and end the turn. The build/publish wording in the original request is desired future scope, not approval to cross this barrier.
Required Deliverable by Mode
| Mode | Completion requirement |
|---|---|
planning | Persist _brief/report-spec.md or the user-named equivalent, ask for explicit approval, and stop before implementation. |
design | Produce the complete Design Brief: contract, including design_identity and a page archetype/layout contract for every page. Do not edit PBIR or call Fabric APIs. |
authoring | Persist the requested PBIR/PBIP changes, validate each logical batch, then complete the selected preview and screenshot-review workflow required by the authoring reference. Do not publish. |
management | Complete the requested Fabric report operation, including LRO polling and documented readback verification. |
Rules
MUST
Select the narrowest mode that fully covers the current request.
Read
references/<mode>.mdend to end before the first command or file edit in that mode. When an already-loaded mode explicitly routes one narrow cross-mode operation to a named topic reference, treat that topic reference as the complete handoff; do not load the target mode's umbrella file unless the work expands beyond that operation.In
planningmode, also readreferences/planning-part-02.mdbefore producing_brief/report-spec.md; it contains the required canonical design contract and approval checks.Across a multi-turn task, retain a compact working state containing resolved workspace/item/model IDs, local and downloaded paths, and references already read. Reuse it in later turns unless the user explicitly requests a fresh query or the preceding operation invalidated a value.
Preserve every argument and safety boundary documented by the selected mode.
Announce and perform an explicit mode switch when the request crosses a boundary.
Use the
powerbi-report-authorCLI metadata and validation surfaces instead of guessing PBIR schemas, roles, formatting properties, selectors, or enum values.Keep local edits local unless the user explicitly requests publishing.
Resolve Fabric workspace and item IDs by listing and filtering rather than guessing identifiers.
Produce the artifact the user requested; reading or summarizing a reference is not task completion.
PREFER
Infer facts already present in the prompt, semantic model, existing PBIP, or prior approved spec instead of asking again.
Load only the selected mode and its directly relevant topic references.
Reuse reference guidance already loaded in the current task. Open a new reference only when the requested operation or an observed mismatch requires it.
Preserve the user's existing project structure, schemas, host, operation, binding, and delivery target unless the selected mode explicitly requires a change.
AVOID
Acting from this dispatcher without reading the selected mode reference.
Reloading this dispatcher, a mode file, or a topic reference already read in the current task solely because the conversation advanced to a later turn.
Loading a retired sibling skill name; planning, design, authoring, and management are modes of this skill.
Editing PBIR or calling Fabric APIs in
planningordesign.Publishing from
authoring, or authoring PBIR content frommanagement.Bypassing the planning approval gate because the original request also asked to build or publish.
<!-- BEGIN GENERATED REFERENCE INDEX -->
Complete Reference Index
Open every relevant reference directly from this index. Files named part-XX continue the named topic.
Authoring
Design
Mode Guides
<!-- END GENERATED REFERENCE INDEX -->
Examples
| User request | Mode |
|---|---|
| "Create a new executive report from this semantic model." | planning |
| "Design an operational page and choose the right charts." | design |
| "Add a KPI page to this PBIP, validate it, and take screenshots." | authoring |
| "Publish this local PBIP to my Fabric workspace and rebind it." | management |
Route Compatibility
The merged skill preserves the four previous route surfaces. Treat the following phrases as explicit aliases for the corresponding mode:
| Mode | Preserved route phrases |
|---|---|
planning | create a report; build a report; create a dashboard; create a new report from scratch; create a report from a semantic model or dataset link; build a report for this model; make me a dashboard; plan then implement; walk me through creating a report |
design | design Power BI report; make dashboard look professional; choose chart type; apply brand to report; redesign report; create design brief; Power BI report design archetype |
authoring | edit PBIR; create Power BI report page; add visual to PBIP; format report visual; validate Power BI report; preview Power BI report; Power BI Desktop preview status; preview report in service; preview report in browser; screenshot report page; screenshot all report pages; list preview hosts; implement dashboard in PBIP; add dashboard visuals to report; implement an approved PBIP report spec; edit PBIR pages/visuals; edit a Power BI report |
management | upload PBIR report definition; upload Power BI report; download PBIR definition; publish PBIR definition; publish Power BI report to Fabric; manage Power BI reports; list workspace reports |
Files
- ATTRIBUTION.mdAdded by AutoGineer881 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md16.1 KiB
- apm.yml642 B
- references/authoring-part-02.md14.6 KiB
- references/authoring-part-03.md16.0 KiB
- references/authoring-part-04.md15.9 KiB
- references/authoring.md16.8 KiB
- references/authoring/authoring-workflows.md11.7 KiB
- references/authoring/bookmark.md14.3 KiB
- references/authoring/button-part-02.md16.1 KiB
- references/authoring/button-part-03.md7.7 KiB
- references/authoring/button.md15.7 KiB
- references/authoring/card-part-02.md16.1 KiB
- references/authoring/card-part-03.md8.6 KiB
- references/authoring/card.md6.4 KiB
- references/authoring/cartesian-part-02.md17.7 KiB
- references/authoring/cartesian-part-03.md12.3 KiB
- references/authoring/cartesian-part-04.md15.8 KiB
- references/authoring/cartesian.md18.0 KiB
- references/authoring/color-strategy.md8.4 KiB
- references/authoring/conditional-formatting-part-02.md13.5 KiB
- references/authoring/conditional-formatting-part-03.md16.0 KiB
- references/authoring/conditional-formatting-part-04.md14.0 KiB
- references/authoring/conditional-formatting-part-05.md16.9 KiB
- references/authoring/conditional-formatting-part-06.md14.7 KiB
- references/authoring/conditional-formatting-part-07.md14.5 KiB
- references/authoring/conditional-formatting.md18.2 KiB
- references/authoring/custom-visuals.md13.9 KiB
- references/authoring/expressions.md11.9 KiB
- references/authoring/field-parameters.md5.1 KiB
- references/authoring/filter-pane.md5.0 KiB
- references/authoring/filters.md9.3 KiB
- references/authoring/formatting-overview.md4.8 KiB
- references/authoring/formatting-part-02.md3.3 KiB
- references/authoring/formatting.md17.0 KiB
- references/authoring/image.md12.6 KiB
- references/authoring/kpi.md2.5 KiB
- references/authoring/map.md13.4 KiB
- references/authoring/model-binding.md7.7 KiB
- references/authoring/page-formatting.md4.5 KiB
- references/authoring/powerbi-desktop.md2.4 KiB
- references/authoring/powerbi-report-author-cli-part-02.md3.2 KiB
- references/authoring/powerbi-report-author-cli.md17.7 KiB
- references/authoring/preview-part-02.md16.9 KiB
- references/authoring/preview-part-03.md4.0 KiB
- references/authoring/preview-part-04.md2.5 KiB
- references/authoring/preview.md16.1 KiB
- references/authoring/re-theming-part-02.md16.8 KiB
- references/authoring/re-theming-part-03.md4.9 KiB
- references/authoring/re-theming.md1.5 KiB
- references/authoring/screenshot-review.md5.0 KiB
- references/authoring/shape.md13.6 KiB
- references/authoring/slicers-part-02.md16.3 KiB
- references/authoring/slicers.md15.6 KiB
- references/authoring/table.md17.5 KiB
- references/authoring/textbox.md5.6 KiB
- references/authoring/theming-part-02.md6.7 KiB
- references/authoring/theming.md16.4 KiB
- references/authoring/version-control.md6.6 KiB
- references/design.md17.3 KiB
- references/design/accessibility.md11.4 KiB
- references/design/anti-patterns.md18.5 KiB
- references/design/archetype-composition.md3.4 KiB
- references/design/archetypes/analytical-canvas.md17.7 KiB
- references/design/archetypes/comparative-benchmark-part-02.md5.7 KiB
- references/design/archetypes/comparative-benchmark.md15.8 KiB
- references/design/archetypes/executive-summary.md14.7 KiB
- references/design/archetypes/narrative-story.md18.1 KiB
- references/design/archetypes/operational-monitor.md17.0 KiB
- references/design/assets/base.json7.5 KiB
- references/design/brownfield.md5.7 KiB
- references/design/chart-selection.md9.8 KiB
- references/design/color.md10.5 KiB
- references/design/design-brief-part-02.md13.7 KiB
- references/design/design-brief.md8.8 KiB
- references/design/interactivity.md9.2 KiB
- references/design/layout.md11.3 KiB
- references/design/pre-flight-checklist.md10.8 KiB
- references/design/signatures.md12.3 KiB
- references/design/tone-catalog.md14.4 KiB
- references/design/typography.md9.2 KiB
- references/design/visual-cookbook-part-02.md11.0 KiB
- references/design/visual-cookbook.md16.7 KiB
- references/management-part-02.md17.2 KiB
- references/management-part-03.md7.5 KiB
- references/management-part-04.md16.7 KiB
- references/management.md10.1 KiB
- references/planning-part-02.md11.2 KiB
- references/planning.md19.5 KiB
references/management-part-02.md
powerbi-report-cli management mode -- Power BI Report Items in Fabric - Part 2
Contents
Examples: CRUD Operations
List Reports
Get Report (Properties)
Get Report Definition
Create Report (with Definition)
Update Report Definition
Conceptual fallback safety requirements (not an executable workflow)
Update Report (Properties)
Delete Report
Long-Running Operations (LRO)
PBIR Definition Structure
definition.pbir — Semantic Model Reference
Continuation of management.md. Open this file directly from the skill reference index.
Examples: CRUD Operations
List Reports
Returns all reports in a workspace.
Permissions: Viewer workspace role
Scopes:
Workspace.Read.AllorWorkspace.ReadWrite.All
az rest --method get \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/workspaces/$WS_ID/reports" \
--query "value[].{name:displayName, id:id, description:description}" \
--output tableSupports pagination via continuationToken query parameter.
Get Report (Properties)
Returns properties of a specific report (name, description, ID, workspace, sensitivity label).
Permissions: Read permissions on the report
Scopes:
Report.Read.AllorReport.ReadWrite.All
az rest --method get \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/workspaces/$WS_ID/reports/$REPORT_ID"Get Report Definition
Downloads the full PBIR definition. This is a POST (not GET) and supports LRO.
Permissions: Read and write permissions on the report
Scopes:
Report.ReadWrite.AllorItem.ReadWrite.AllLimitation: Blocked for reports with encrypted sensitivity labels
Always request format=PBIR — without this parameter, older reports may
return PBIR-Legacy format (a single report.json blob), which this skill does
not support.
set -euo pipefail
# Robust file-based flow: save only the final successful PBIR body, then unpack it.
GET_DEF_URL="https://api.fabric.microsoft.com/v1/workspaces/$WS_ID/reports/$REPORT_ID/getDefinition?format=PBIR"
az rest --method post \
--resource "https://api.fabric.microsoft.com" \
--url "$GET_DEF_URL" \
--output-file payload.json \
--verbose 2>&1 | tee get-definition-start.log
# If the initial 202 response appears, payload.json is not the definition yet.
# Capture the operation ID from verbose headers, poll to Succeeded, then save
# the terminal successful getDefinition body to payload.json before unpacking.
OP_ID=$(grep -ioE "x-ms-operation-id[^a-f0-9-]*[a-f0-9-]+" get-definition-start.log | grep -ioE "[a-f0-9-]+$" | head -1 || true)
if [ -n "$OP_ID" ]; then
OP_URL="https://api.fabric.microsoft.com/v1/operations/$OP_ID"
MAX_LRO_ATTEMPTS=60
LRO_ATTEMPT=1
RETRY_AFTER=$(grep -ioE "Retry-After[^0-9]*[0-9]+" get-definition-start.log | grep -oE "[0-9]+$" | head -1 || true)
SLEEP_SECONDS=5
MAX_SLEEP_SECONDS=30
if [ -n "$RETRY_AFTER" ]; then
SLEEP_SECONDS="$RETRY_AFTER"
[ "$SLEEP_SECONDS" -gt "$MAX_SLEEP_SECONDS" ] && SLEEP_SECONDS="$MAX_SLEEP_SECONDS"
fi
while [ "$LRO_ATTEMPT" -le "$MAX_LRO_ATTEMPTS" ]; do
if ! STATUS=$(az rest --method get \
--resource "https://api.fabric.microsoft.com" \
--url "$OP_URL" \
--query status \
--output tsv); then
echo "Failed to poll getDefinition LRO status for operation $OP_ID" >&2
exit 1
fi
case "$STATUS" in
Succeeded) break ;;
Failed|Cancelled)
az rest --method get \
--resource "https://api.fabric.microsoft.com" \
--url "$OP_URL"
exit 1
;;
Running|NotStarted) ;;
"") echo "Empty getDefinition LRO status for operation $OP_ID" >&2; exit 1 ;;
*) echo "Unexpected getDefinition LRO status: $STATUS" >&2; exit 1 ;;
esac
if [ "$LRO_ATTEMPT" -eq "$MAX_LRO_ATTEMPTS" ]; then
echo "Timed out waiting for getDefinition LRO operation $OP_ID" >&2
exit 1
fi
# Honor the initial Retry-After header when present; subsequent Retry-After
# values are not reliably exposed by az rest with --query/--output tsv, so
# use documented bounded backoff without corrupting status parsing.
sleep "$SLEEP_SECONDS"
if [ "$SLEEP_SECONDS" -lt "$MAX_SLEEP_SECONDS" ]; then
SLEEP_SECONDS=$((SLEEP_SECONDS * 2))
[ "$SLEEP_SECONDS" -gt "$MAX_SLEEP_SECONDS" ] && SLEEP_SECONDS="$MAX_SLEEP_SECONDS"
fi
LRO_ATTEMPT=$((LRO_ATTEMPT + 1))
done
az rest --method get \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/operations/$OP_ID/result" \
--output-file payload.json \
--verbose 2>&1 | tee get-definition-result.log
fi
# Only unpack payload.json after it contains either the synchronous 200 body or
# the /operations/$OP_ID/result body from the terminal successful LRO.Format check: After retrieving the definition, verify
definition.format == "PBIR". If it is"PBIR-Legacy", this skill does not support that format.powerbi-report-author unpackalso rejects non-PBIR input early withUNPACK_FORMAT_UNSUPPORTED, so do not hand-decode a legacy blob.
Decode Definition Parts to Local Files
Note:
getDefinitionoften returns202 Accepted(LRO). Check the Long-Running Operations section to extract the operation ID and poll for the result before decoding.
Use powerbi-report-author unpack for the decode + path-normalization step.
The file-based form is recommended for LRO safety and for Windows shells:
powerbi-report-author unpack ./MyReport.Report --input payload.json--input payload.json supersedes stdin. By default unpack refuses to clobber
existing files; pass --force only after the user confirms staged overwrite.
Default stdin form (only when the final PBIR getDefinition JSON is already on
stdout, such as after a completed LRO poll command):
printf '%s' "$DEFINITION_JSON" | powerbi-report-author unpack ./MyReport.ReportCreate Report (with Definition)
Creates a new report with a PBIR definition. Supports LRO.
Permissions: Contributor workspace role
Scopes:
Report.ReadWrite.AllorItem.ReadWrite.All
pack --raw --mode create --display-name '<name>' [--description '<text>']
emits the Fabric create request body with displayName, optional
description, and all qualifying PBIR parts from the .Report directory.
Run Modern-PBIR preflight before pack in management.md first.
Recommended file-based flow (especially on Windows/PowerShell):
set -euo pipefail
powerbi-report-author pack ./MyReport.Report --raw --mode create --display-name "My New Report" --description "Created via Fabric API" --out create-report.json
az rest --method post \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/workspaces/$WS_ID/reports" \
--headers "Content-Type=application/json" \
--body @create-report.json \
--verbose 2>&1 | tee create-report-start.logAfter the POST, follow Long-Running Operations
for 202 Accepted: capture x-ms-operation-id, poll to terminal state, and
never retry the create POST after a 202.
Direct pipe form (Bash/Zsh; PowerShell callers should prefer the file-based form unless they first force UTF-8 console output):
set -euo pipefail
powerbi-report-author pack ./MyReport.Report --raw --mode create --display-name "My New Report" --description "Created via Fabric API" | az rest --method post \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/workspaces/$WS_ID/reports" \
--headers "Content-Type=application/json" \
--body @- \
--verbose 2>&1 | tee create-report-pipe-start.log[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()
$OutputEncoding = [System.Text.UTF8Encoding]::new()
# Then, if you intentionally use the pipe form:
powerbi-report-author pack ./MyReport.Report --raw --mode create --display-name "My New Report" --description "Created via Fabric API" | az rest --method post --resource "https://api.fabric.microsoft.com" --url "https://api.fabric.microsoft.com/v1/workspaces/$WS_ID/reports" --headers "Content-Type=application/json" --body "@-" --verbose 2>&1 | Out-File ".\create-report-pipe-start.log" -Encoding utf8Keep 2>&1 on the az rest side of the PowerShell pipe so verbose response
headers are captured without merging pack diagnostics into the request-body
stdin. Do not put 2>&1 on the powerbi-report-author pack side.
Important:
definition.pbiris always required.packstarts from the.Reportboundary (or locates it from a.pbip) and emits the full PBIR API definition body. Make sure the local.Reportdirectory mirrors the complete PBIR layout before packing.
Update Report Definition
Overwrites the entire definition. This is a POST and supports LRO.
Permissions: Read and write permissions on the report
Scopes:
Report.ReadWrite.AllorItem.ReadWrite.All
pack defaults to update mode. Do not pass --display-name for
updateDefinition; the body contains only definition.parts and pack emits
all qualifying PBIR parts on every invocation.
Preflight: run the Modern-PBIR preflight before pack in
management.mdbefore packing. A legacy.Reportthat still containsdefinition.pbirpacks a partial payload, and replace-allupdateDefinitionthen deletes the omitted parts.
Recommended file-based flow (especially on Windows/PowerShell):
set -euo pipefail
powerbi-report-author pack ./MyReport.Report --raw --out update-definition.json
az rest --method post \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/workspaces/$WS_ID/reports/$REPORT_ID/updateDefinition" \
--headers "Content-Type=application/json" \
--body @update-definition.json \
--verbose 2>&1 | tee update-definition-start.logAfter the POST, follow Long-Running Operations
for 202 Accepted: capture x-ms-operation-id and poll to terminal state.
Direct pipe form (Bash/Zsh; PowerShell callers should prefer the file-based form unless they first force UTF-8 console output):
set -euo pipefail
powerbi-report-author pack ./MyReport.Report --raw | az rest --method post \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/workspaces/$WS_ID/reports/$REPORT_ID/updateDefinition" \
--headers "Content-Type=application/json" \
--body @- \
--verbose 2>&1 | tee update-definition-pipe-start.log[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()
$OutputEncoding = [System.Text.UTF8Encoding]::new()
# Then, if you intentionally use the pipe form:
powerbi-report-author pack ./MyReport.Report --raw | az rest --method post --resource "https://api.fabric.microsoft.com" --url "https://api.fabric.microsoft.com/v1/workspaces/$WS_ID/reports/$REPORT_ID/updateDefinition" --headers "Content-Type=application/json" --body "@-" --verbose 2>&1 | Out-File ".\update-definition-pipe-start.log" -Encoding utf8Keep 2>&1 on the az rest side of the PowerShell pipe so verbose response
headers are captured without merging pack diagnostics into the request-body
stdin. Do not put 2>&1 on the powerbi-report-author pack side.
Critical:
updateDefinitionreplaces the entire definition. Include ALL parts — modified and unmodified. Omitting parts deletes them.
Optional query parameter ?updateMetadata=true updates item metadata from
.platform file if included.
Conceptual fallback safety requirements (not an executable workflow)
powerbi-report-author >= 0.3.0 remains required for all primary documented
workflows in this skill. This section is not permission to continue with a
non-CLI jq/base64/find/PowerShell branch when the preflight check fails. If the
CLI is missing or older than 0.3.0, stop and instruct the user to install or
upgrade @microsoft/powerbi-report-authoring-cli@latest before publishing,
downloading, or updating PBIR definitions.
The safety requirements below exist only to evaluate external legacy/manual
recipes outside this skill. Any such replacement would need safety parity with
pack/unpack, including normalized non-traversing part paths, PBIR
payload-type checks, valid base64 decode/encode, the same part allowlist, and
the same file-exclusion rules before writing files or constructing
create/update request bodies. Because this skill does not provide an
executable, safety-equivalent non-CLI branch, agents must not attempt to
assemble one from these requirements.
Update Report (Properties)
Updates display name and/or description only (not the definition).
Permissions: Read and write permissions on the report
Scopes:
Report.ReadWrite.AllorItem.ReadWrite.All
cat > update-report.json << 'EOF'
{
"displayName": "Renamed Report",
"description": "Updated description"
}
EOF
az rest --method patch \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/workspaces/$WS_ID/reports/$REPORT_ID" \
--headers "Content-Type=application/json" \
--body @update-report.jsonDelete Report
Deletes a report. Supports soft-delete (default) and hard-delete.
Permissions: Write permissions on the report
Scopes:
Report.ReadWrite.AllorItem.ReadWrite.All
# Soft delete (recoverable)
az rest --method delete \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/workspaces/$WS_ID/reports/$REPORT_ID"
# Hard delete (permanent)
az rest --method delete \
--resource "https://api.fabric.microsoft.com" \
--url "https://api.fabric.microsoft.com/v1/workspaces/$WS_ID/reports/$REPORT_ID?hardDelete=true"Long-Running Operations (LRO)
Create Report, Get Report Definition, and Update Report Definition may
return 202 Accepted instead of an immediate result. Capture
x-ms-operation-id from the verbose output and poll until terminal state per
COMMON-CLI.md § Long-Running Operations (see ../../../common/COMMON-CLI.md, section long-running-operations-lro-pattern).
The management-specific guardrails below take precedence over the generic pattern when they conflict.
⚠️ Never retry a create POST after receiving 202. A
202 Acceptedresponse means the operation was accepted and is likely being processed server-side. Retrying the POST risks creating duplicates.Always write
--verboseoutput to a file to reliably capture thex-ms-operation-idheader on every attempt — this is the only reliable way to track the operation. Regex extraction from in-memory strings is fragile across shells and platforms. Once captured, poll the operation to completion just like any other LRO call.# PowerShell — reliable operation ID capture az rest --method post ... --verbose 2>&1 | Out-File "$env:TEMP\lro-response.txt" -Encoding utf8 $opId = (Select-String -Path "$env:TEMP\lro-response.txt" -Pattern "x-ms-operation-id.*?'([a-f0-9-]+)'" | Select-Object -First 1).Matches.Groups[1].ValueAs a last resort, if the operation ID is still lost despite writing to a file, list reports in the workspace to locate the created report — but this should not be the normal path.
For more details, see Long-Running Operations.
PBIR Definition Structure
Reports use the PBIR format — a folder of JSON files:
Report/
├── definition.pbir # Semantic model reference (required)
├── definition/
│ ├── report.json # Report-level settings (required)
│ ├── version.json # Format version (required)
│ ├── pages/
│ │ ├── pages.json # Page listing (required)
│ │ ├── <pageId>/
│ │ │ ├── page.json # Page layout
│ │ │ ├── visuals/
│ │ │ │ ├── <visualId>/
│ │ │ │ │ ├── visual.json # Visual config
│ │ │ │ │ ├── mobile.json # Mobile layout (optional)
│ ├── bookmarks/ # Bookmarks (optional)
├── StaticResources/ # Custom themes, images (optional)All parts are base64-encoded in API payloads using "payloadType": "InlineBase64".
definition.pbir — Semantic Model Reference
For Fabric API, use byConnection (not byPath):
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definitionProperties/2.0.0/schema.json",
"version": "4.0",
"datasetReference": {
"byConnection": {
"connectionString": "semanticmodelid=<SemanticModelId>"
}
}
}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.
Security
What our scanner noticed· Low risk
- Phrasing that asks for actions without confirmation
- Instructions that use the network
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/powerbi-report-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.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download powerbi-report-cli.zip