Fabric CLI: Command Your Data Platform Like a Pro
Introduction
There's a moment every data engineer knows well: you've got a dozen Fabric workspaces to manage, pipelines to trigger, files to move into OneLake, and deployments to ship — all before standup. Clicking through the Fabric portal is fine for exploration, but when speed, repeatability, and automation matter, you need something sharper.
Meet Fabric CLI (fab) — Microsoft's official open-source command-line interface for Microsoft Fabric. It brings your entire data platform to the terminal, letting you navigate workspaces, run pipelines, manage items, upload data, and wire everything into CI/CD pipelines — all without touching a browser.
This post covers everything you need to get up and running: what Fabric CLI is, why it matters, how to install it, and real command examples you can use today.
What Is the Fabric CLI?
Fabric CLI (fab) is a cross-platform, open-source command-line tool built by Microsoft that gives you direct access to Microsoft Fabric from your terminal. Think of it as a shell that speaks fluent Fabric — it exposes workspaces, lakehouses, pipelines, semantic models, notebooks, and more as a navigable, scriptable file system.
Released as Generally Available (v1.5+), it is fully supported for production use and backed by Microsoft's SLA. It works on:
- Windows Terminal
- macOS Terminal
- Linux shells
- GitHub Actions, Azure DevOps Pipelines, and any CI/CD environment
At its core, fab does two things brilliantly: it mirrors familiar shell UX (think ls, cd, cp, rm) applied to Fabric resources, and it exposes automation-ready commands for running and deploying Fabric items at scale.
Why Does Fabric CLI Matter?
1. Speed and Efficiency
Portal navigation is built for discovery. CLI is built for execution. Once you know what you want to do, fab gets you there in a single command.
2. Automation-First Design
Every fab command works identically in your local terminal and in a CI/CD YAML pipeline. There's no "portal-only" escape hatch — everything is scriptable.
3. DevOps Integration
Fabric CLI bridges the gap between data engineering and modern DevOps practices. You can trigger pipelines, promote deployments, and manage Git-backed workspaces directly inside your GitHub Actions or Azure DevOps workflows.
4. Open Source and Extensible
The CLI is open-source on GitHub (microsoft/fabric-cli), meaning the community can contribute, audit, and extend it.
5. Broad Item Coverage
Fabric CLI supports a wide range of Fabric item types: Lakehouses, Notebooks, Data Pipelines, Semantic Models, Warehouses, Dataflows, GraphQL APIs, CosmosDB Databases, SQL Databases, Variable Libraries, Copy Jobs, Power BI Reports, and more.
Installation
Fabric CLI is distributed via PyPI and requires Python 3.8+.
pip install ms-fabric-cli
Verify your installation:
fab --version
You should see output like:
fab version 1.5.x
Tip: If you're using a virtual environment, activate it before installing to keep dependencies clean.
Authentication
Before running any commands, you need to authenticate. Fabric CLI supports three authentication modes.
Interactive Login (Developer / Local)
fab auth login
This opens a browser window for Microsoft Entra ID (Azure AD) sign-in — perfect for day-to-day local use.
Service Principal (CI/CD / Automation)
fab auth login \ -u $CLIENT_ID \ -p $CLIENT_SECRET \ --tenant $TENANT_ID
Use this in GitHub Actions or Azure DevOps secrets for unattended runs.
Managed Identity (Azure-Hosted Runners)
When running on an Azure-hosted machine with a managed identity, authentication is handled automatically — no credentials to manage.
Navigating Your Fabric Environment
Fabric CLI models your Fabric tenant as a navigable file system. If you've used a Unix shell, this will feel immediately natural.
List All Workspaces
fab ls
Output:
Sales Analytics.Workspace Marketing Data.Workspace Finance Reporting.Workspace DevOps Sandbox.Workspace
Explore a Workspace
fab ls "Sales Analytics.Workspace"
Output:
SalesLakehouse.Lakehouse DailyIngest.DataPipeline SalesModel.SemanticModel SalesReport.Report
Detailed Listing
fab ls -l "Sales Analytics.Workspace"
Type Name Modified ----------------- ----------------------- ------------------- Lakehouse SalesLakehouse 2026-04-28 09:12 DataPipeline DailyIngest 2026-05-01 14:45 SemanticModel SalesModel 2026-05-02 08:30 Report SalesReport 2026-05-02 08:35
Change Working Context
fab cd "Sales Analytics.Workspace" fab ls
Once you cd into a workspace, all relative paths are scoped to it.
Running Data Pipelines
One of the most powerful everyday uses of Fabric CLI is triggering and monitoring Data Pipelines.
Run a Pipeline
fab run "Sales Analytics.Workspace/DailyIngest.DataPipeline"
Output:
Pipeline run started: run_id=abc123 Status: Running... Status: Succeeded ✓ (elapsed: 4m 32s)
Run with Input Parameters
fab run "Sales Analytics.Workspace/DailyIngest.DataPipeline" \
-i '{"param_date": "2026-05-10", "env": "production"}'Schedule a Pipeline Run
fab job run-sch DailyIngest.datapipeline \ --type daily \ --interval "06:00"
Working with Files and OneLake
Fabric CLI makes it trivial to move data between your local machine and OneLake storage inside a Lakehouse.
Upload a Local File to OneLake
fab cp ./data/sales_may.csv \ "Sales Analytics.Workspace/SalesLakehouse.Lakehouse/Files/sales_may.csv"
Download from OneLake to Local
fab cp \ "Sales Analytics.Workspace/SalesLakehouse.Lakehouse/Files/sales_may.csv" \ ./local/downloads/
Sync an Entire Local Folder
fab cp ./reports/ \ "Sales Analytics.Workspace/SalesLakehouse.Lakehouse/Files/reports/" \ --recursive
List Files Inside a Lakehouse
fab ls "Sales Analytics.Workspace/SalesLakehouse.Lakehouse/Files/"
Managing Workspaces and Items
Create a New Workspace
fab mkdir "New Project.Workspace"
Delete an Item
fab rm "Sales Analytics.Workspace/OldPipeline.DataPipeline"
Copy an Item Between Workspaces
fab cp \ "Sales Analytics.Workspace/SalesReport.Report" \ "Finance Reporting.Workspace/SalesReport.Report"
Deployment with fab deploy
Introduced in v1.5, the deploy command enables one-command deployments across environments — perfect for promoting from dev to staging to production.
Simple Deployment
fab deploy \ --source "DevOps Sandbox.Workspace" \ --target "Finance Reporting.Workspace"
Deploy with a Config File
You can define your deployment rules in a deploy.yml:
# deploy.yml source: DevOps Sandbox.Workspace target: Finance Reporting.Workspace items: - DailyIngest.DataPipeline - SalesModel.SemanticModel - SalesReport.Report
Then run:
fab deploy --config deploy.yml
This is especially powerful inside CI/CD pipelines — the same command works locally and in automation.
Power BI Scenarios (New in v1.5)
Fabric CLI v1.5 extended first-class support for Power BI operations.
Rebind a Report to a Different Semantic Model
fab rebind \ "Finance Reporting.Workspace/SalesReport.Report" \ --model "Finance Reporting.Workspace/FinanceModel.SemanticModel"
Refresh a Semantic Model
fab refresh \ "Sales Analytics.Workspace/SalesModel.SemanticModel"
Update Report Properties
fab set \ "Sales Analytics.Workspace/SalesReport.Report" \ --property "description" \ --value "Updated May 2026 sales metrics"
CI/CD Integration
Where Fabric CLI truly shines is in automated pipelines. Here's a complete GitHub Actions workflow that authenticates, runs a pipeline, and deploys on merge to main.
# .github/workflows/fabric-deploy.yml
name: Fabric Deploy
on:
push:
branches:
- main
jobs:
deploy-fabric:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Fabric CLI
run: pip install ms-fabric-cli
- name: Authenticate with Service Principal
run: |
fab auth login \
-u ${{ secrets.FABRIC_CLIENT_ID }} \
-p ${{ secrets.FABRIC_CLIENT_SECRET }} \
--tenant ${{ secrets.FABRIC_TENANT_ID }}
- name: Run data ingest pipeline
run: |
fab run "Sales Analytics.Workspace/DailyIngest.DataPipeline"
- name: Deploy to Production workspace
run: |
fab deploy --config deploy.ymlAnd the equivalent in Azure DevOps Pipelines:
# azure-pipelines.yml
trigger:
branches:
include:
- main
pool:
vmImage: ubuntu-latest
steps:
- script: pip install ms-fabric-cli
displayName: Install Fabric CLI
- script: |
fab auth login \
-u $(FABRIC_CLIENT_ID) \
-p $(FABRIC_CLIENT_SECRET) \
--tenant $(FABRIC_TENANT_ID)
displayName: Authenticate
- script: |
fab run "Sales Analytics.Workspace/DailyIngest.DataPipeline"
displayName: Run Pipeline
- script: |
fab deploy --config deploy.yml
displayName: Deploy to ProductionConfiguration and Debugging
Enable Debug Logging
When something goes wrong, verbose output is your best friend:
fab config set debug_enabled true
Now all CLI commands will output detailed request/response information.
Set a Default Capacity
If you're always working against the same capacity, set it once:
fab config set default_capacity "My Production Capacity"
Dry-Run Mode
Preview what a command will do before executing it:
fab run "Sales Analytics.Workspace/DailyIngest.DataPipeline" --dry-run
This is invaluable for validating automation scripts before they touch production.
Check Current Auth Status
fab auth status
When to Use Fabric CLI vs. the Portal
The portal and CLI are complementary. Start in the portal when exploring; switch to the CLI when you need speed, repeatability, or automation.
Getting Started Checklist
- pip install ms-fabric-cli — install the CLI
- fab auth login — authenticate with your Microsoft account
- fab ls — explore your workspaces
- fab ls -l "Your Workspace.Workspace" — inspect a workspace in detail
- fab run "Your Workspace.Workspace/YourPipeline.DataPipeline" — trigger your first pipeline
- Store credentials as secrets and add fab to your CI/CD pipeline
Resources
- Microsoft Fabric CLI Docs
- GitHub: microsoft/fabric-cli
- Fabric CLI on PyPI
- Fabric CLI — Generally Available Blog Post
- Fabric CLI v1.5 Release Notes
- Fabric CLI in Azure DevOps
- Microsoft Learn: Fabric CLI Reference