This page demonstrates how to manage Microsoft Fabric workspaces using the CLI. Workspaces are containers for Fabric items and provide collaboration and security boundaries.
!!! note "Resource Type"
Type: .Workspace
To explore all workspace commands and their parameters, run:
fab desc .Workspace
Navigate to a workspace using the full workspace path.
fab cd /ws1.Workspace
Navigate to a workspace using relative path from current context.
fab cd ../../ws1.Workspace
Navigate to your personal workspace using the workspace name or shortcut.
# Using workspace name
fab cd "My workspace.Personal"
# Using shortcut
fab cd ~
Create a workspace. Use -P capacityName=<capacity name> to specify inline capacity (default: CLI-configured capacity config set default_capacity <>).
Create a workspace using the CLI-configured default capacity.
fab create ws1.Workspace
Create a workspace and assign it to a specific capacity.
fab create ws1.Workspace -P capacityname=capac1
Create a workspace without assigning it to any capacity.
fab create ws1.Workspace -P capacityname=none
Check if a workspace exists and is accessible.
fab exists ws1.Workspace
Retrieve full workspace details.
fab get ws1.Workspace
Query workspace properties using JMESPath syntax.
fab get ws1.Workspace -q id
Save query results to a local file.
fab get ws1.Workspace -q sparkSettings -o /tmp
Display available workspaces with different detail levels.
# Simple list
fab ls
# Detailed list
fab ls -l
# Include hidden elements
fab ls -l -a
Hidden elements at tenant level include:
- Capacities (
.capacities) - Connections (
.connections) - Domains (
.domains) - Gateways (
.gateways)
Display items within a specific workspace.
# Simple list
fab ls ws1.Workspace
# Detailed list
fab ls ws1.Workspace -l
# Include hidden workspace elements
fab ls ws1.Workspace -la
Hidden elements at workspace level include:
- External Data Shares (
.ExternalDataShare) - Managed Identities (
.ManagedIdentity) - Managed Private Endpoints (
.ManagedPrivateEndpoint) - Spark Pools (
.SparkPool)
!!! tip "To always show hidden elements without using -a, configure: fab config set show_hidden true"
Change the workspace display name.
fab set ws1.Workspace -q displayName -i ws2r
Set or modify the workspace description.
fab set ws1.Workspace -q description -i "New description"
Update the Spark runtime version for the workspace.
fab set ws1.Workspace -q sparkSettings.environment.runtimeVersion -i 1.2
Assign the Starter Pool as the default pool for the workspace.
fab set ws1.Workspace -q sparkSettings.pool.defaultPool -i '{"name": "Starter Pool","type": "Workspace"}'
Assign a custom Spark pool as the default pool.
fab set ws1.Workspace -q sparkSettings.pool.defaultPool -i '{"name": "spool1","type": "Workspace","id": "00000000-0000-0000-0000-000000000000"}'
Select and remove multiple workspaces (interactive mode only).
fab rm .
Remove specific items from a workspace (interactive mode).
fab rm ws1.Workspace
Delete workspace and all its contents without confirmation.
fab rm ws1.Workspace -f
!!! warning "Using -f flag will delete the entire workspace and all items permanently. Use with extreme caution"
!!! info "When you export item definition, the sensitivity label is not part of the definition"
Export items from a workspace to an output path. Supported for exportable items; use -a to export all the items.
Export items from a workspace to a local directory.
!!! warning "Windows OS File Name Restrictions"
In Windows, items with names containing \ / : * ? " < > | will cause export errors. Provide a valid name in the output path to resolve this:
fab export "ws1.Workspace/n?1.Notebook" -o "/tmp/n1.Notebook"
fab export ws1.Workspace -o /tmp
# Export all items
fab export ws1.Workspace -o /tmp -aExport workspace items directly to a Lakehouse Files location.
fab export ws1.Workspace -o /ws1.Workspace/lh1.Lakehouse/Files
# Export all items
fab export ws1.Workspace -o /ws1.Workspace/lh1.Lakehouse/Files -aDeploy workspace items from local content to target workspaces using configuration files.
Deploy entire workspace content to a target workspace.
fab deploy --config config.yml -tenv dev
Copy items from one workspace to another. Supported for exportable items.
fab cp ws1.Workspace ws2.Workspace
Move items from one workspace to another (interactive mode only).
fab mv ws1.Workspace ws2.Workspace
Launch the workspace in your default web browser.
fab open ws1.Workspace