
Fabric Cli Powerbi
Operate Power BI semantic models, reports, DAX, and refresh pipelines from the Fabric fab CLI with ready-made Python automation scripts.
Install
npx skills add https://github.com/microsoft/fabric-cli --skill fabric-cli-powerbiWhat is this skill?
- Semantic model get/export/refresh/update and TMDL-oriented operations
- Report export, clone, and rebind to different datasets
- DAX execution, refresh schedules, and failure troubleshooting paths
- Python helpers: refresh_model.py, list_refresh_history.py, rebind_report.py with --help
- Requires fabric-cli-core plus fab auth status before mutations
Adoption & trust: 89 installs on skills.sh; 134 GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Journey fit
Connecting BI assets, models, and gateways is integration work during product build, even when the same commands support later analytics ops. Integrations captures CLI binding to Fabric workspaces, semantic models, gateways, and external data sources—not one-off chart design.
Common Questions / FAQ
Is Fabric Cli Powerbi safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Fabric Cli Powerbi
# Fabric CLI Power BI Operations Expert guidance for working with Power BI items (semantic models, reports, dashboards) using the `fab` CLI. ## When to Use This Skill Activate automatically when tasks involve: - Semantic model (dataset) operations — get, export, refresh, update - Report management — export, clone, rebind to different model - Executing DAX queries against semantic models - Managing refresh schedules and troubleshooting failures - Gateway and data source configuration - TMDL (Tabular Model Definition Language) operations ## Prerequisites - Load `fabric-cli-core` skill first for foundational CLI guidance - User must be authenticated: `fab auth status` - Appropriate workspace permissions for target items ## Automation Scripts Ready-to-use Python scripts for Power BI tasks. Run any script with `--help` for full options. | Script | Purpose | Usage | |--------|---------|-------| | `refresh_model.py` | Trigger and monitor semantic model refresh | `python scripts/refresh_model.py <model> [--wait] [--timeout 300]` | | `list_refresh_history.py` | Show refresh history and failure details | `python scripts/list_refresh_history.py <model> [--last N]` | | `rebind_report.py` | Rebind report to different semantic model | `python scripts/rebind_report.py <report> --model <new-model>` | Scripts are located in the `scripts/` folder of this skill. ## 1 - Power BI Item Types | Entity Suffix | Type | Description | |---------------|------|-------------| | `.SemanticModel` | Semantic Model | Power BI dataset (tabular model) | | `.Report` | Report | Power BI report (visualizations) | | `.Dashboard` | Dashboard | Power BI dashboard (pinned tiles) | | `.Dataflow` | Dataflow | Power Query dataflow | | `.PaginatedReport` | Paginated Report | RDL-based paginated report | ### Path Examples ``` # Semantic model Production.Workspace/Sales.SemanticModel # Report connected to model Production.Workspace/SalesReport.Report # Dashboard Production.Workspace/ExecutiveDash.Dashboard ``` ## 2 - Semantic Model Operations ### Get Model Information ```bash # Check if model exists fab exists "ws.Workspace/Model.SemanticModel" # Get model properties fab get "ws.Workspace/Model.SemanticModel" # Get model ID (needed for Power BI API calls) fab get "ws.Workspace/Model.SemanticModel" -q "id" # Get full definition (TMDL) fab get "ws.Workspace/Model.SemanticModel" -q "definition" ``` ### Export Model ```bash # Export to local directory (PBIP format with TMDL) fab export "ws.Workspace/Model.SemanticModel" -o ./exports -f ``` Creates folder structure: ``` Model.SemanticModel/ ├── .platform ├── definition.pbism └── definition/ ├── model.tmdl ├── tables/ │ ├── Sales.tmdl │ └── Date.tmdl └── relationships.tmdl ``` ### Import/Update Model ```bash # Import from PBIP folder fab import "ws.Workspace/Model.SemanticModel" -i ./exports/Model.SemanticModel -f # Copy between workspaces fab cp "Dev.Workspace/Model.SemanticModel" "Prod.Workspace/Model.SemanticModel" -f ``` ## 3 - Refresh Operations ### Trigger Refresh ```bash # Get IDs WS_ID=$(fab get "ws.Workspace" -q "id" | tr -d '"') MODEL_ID=$(fab get "ws.Workspace/Model.SemanticModel" -q "id" | tr -d '"') # Trigger full refresh fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" -X post -i '{"type":"Full"}' # Check refresh status fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes?\$top=1" ``` ### Enhanced Refresh (Partition-Level) ```bash # Refresh specific tables fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" -X post -i '{ "type": "Full", "commitMode": "transactional", "objects": [ {"table": "Sales"}, {"table": "Inventory"} ] }' # R