The Microsoft Fabric CLI (fab
) is a powerful, file-system-inspired command-line interface for Microsoft Fabric. Explore, automate, and script your Fabric environment directly from your terminal with familiar commands like ls
, cd
, mkdir
, cp
, and more.
# Install the CLI
pip install ms-fabric-cli
# Authenticate
fab auth login
# Start exploring
fab ls # List workspaces and items
fab cd MyWorkspace.workspace # Navigate to a workspace
fab ls -l # List items with details
fab get MyNotebook.notebook # Get item properties
Navigate Microsoft Fabric like your local file system with intuitive commands:
ls
,cd
,pwd
- Navigate workspaces and itemsmkdir
,rm
,mv
,cp
- Create, delete, move, and copy itemsexists
,open
- Check existence and open items in the Fabric portal
- Import/Export items with
import
andexport
commands - OneLake file operations - Upload, download, and manage files
- Table operations - Load data, optimize tables, manage schemas
- Shortcut management - Create and manage OneLake shortcuts
- Scripting mode - Perfect for CI/CD pipelines and automation
- Interactive mode - Live shell experience for exploration
- Job management - Run, schedule, and monitor Fabric jobs
- API access - Direct REST API calls with authentication handled
- Interactive login - Browser-based authentication
- Service Principal - Client secrets, certificates, and federated tokens
- Managed Identity - System and user-assigned identities
- Environment variables - Headless authentication for automation
- Windows, macOS, Linux - Native support across all platforms
- Multiple shells - PowerShell, Bash, Zsh, and more
- Shell completion - Autocomplete for commands and arguments (in command-line mode)
- Python 3.10, 3.11, or 3.12
- A Microsoft Fabric account with access to your tenant/workspaces.
pip install ms-fabric-cli
pip install --upgrade ms-fabric-cli
fab --version
fab auth login
# Select: "Interactive with a web browser"
fab auth login -u <client_id> -p <client_secret> --tenant <tenant_id>
The CLI supports additional authentication methods including certificates, managed identity, and environment variables. See the authentication documentation) for complete details.
# List all workspaces
fab ls
# Navigate to a workspace
fab cd "Sales Analytics.workspace"
# List items in current workspace
fab ls -l
# Get current location
fab pwd
# Create a new notebook
fab mkdir MyNotebook.notebook
# Copy an item between workspaces
fab cp notebook1.notebook /TargetWorkspace.workspace/
# Export an item definition
fab export MyReport.report -o ./backup/
# Import an item
fab import NewNotebook.notebook -i ./definitions/notebook.json
# Navigate to lakehouse files
fab cd MyLakehouse.lakehouse/Files
# Upload a file
fab cp ./local-data.csv ./remote-data.csv
# Download files
fab cp ./remote-data.csv ~/Downloads/
# List files with details
fab ls -l
# Run a notebook synchronously
fab job run MyNotebook.notebook
# Schedule a pipeline
fab job run-sch MyPipeline.datapipeline --type daily --interval "09:00"
# Check job status
fab job run-status MyNotebook.notebook --id <job-id>
# Load CSV data into a table
fab table load Tables/SalesData --file Files/sales.csv --mode append
# Optimize a table
fab table optimize Tables/SalesData --vorder --zorder ProductID,Date
# View table schema
fab table schema Tables/SalesData
# Make authenticated API calls
fab api workspaces
# Query with JMESPath
fab api workspaces -q "value[?name=='MyWorkspace']"
# POST request with data
fab api capacities -X POST -i capacity-config.json
# Switch to interactive mode
fab config set mode interactive
fab auth login # Re-authenticate for interactive mode
# Switch back to command-line mode
fab config set mode command_line
# Enable debug logging
fab config set debug_enabled true
# Set default capacity
fab config set default_capacity "My Capacity"
# Configure output sorting
fab config set output_item_sort_criteria bytype
# View all settings
fab config ls
Resource | Description |
---|---|
Command Reference | Complete command documentation |
Usage Examples | Real-world scenarios and scripts |
API Integration | Direct REST API access patterns |
CI/CD Integration | GitHub Actions and Azure Pipelines |
Settings | CLI Configuration |
We welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or helping other users, your contributions are valuable.
- Check existing issues - Look for issues labeled
help-wanted
- Read our guidelines - See CONTRIBUTING.md for detailed instructions
- Fork and clone - Set up your development environment
- Create a pull request - Link it to the related issue
Before contributing, please review our Contributing Guidelines and Code of Conduct.
- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - Questions and community support
- Documentation - Comprehensive guides and examples
- Microsoft Community - Connect with other Fabric developers
- GitHub Issues - Technical feature requests
- Fabric Ideas Portal - Product-level feature suggestions
- Contact your Microsoft account manager
- Microsoft Fabric Support - Official Microsoft support
- β¨ Added support for folders in
fs
commands - β¨ JSON output format support
- β¨ Context persistence in command-line mode
- β¨ Autocomplete support for commands (in command-line mode)
- π GraphQLApi items support
- π§ Multiple bug fixes and improvements
See the full Release Notes for detailed changelog.
This project is licensed under the MIT License - see the LICENSE file for details.
This project is part of Microsoft's commitment to open source. We follow Microsoft's Open Source Code of Conduct.
For questions or concerns, contact opencode@microsoft.com.
Explore, Automate, and Build with Microsoft Fabric CLI
π Documentation β’ π Report Bug β’ π¬ Discuss β’ π‘ Request Feature