Item Management Examples¶
This page demonstrates how to manage Microsoft Fabric items using the CLI. Items are the core resource types within Fabric workspaces, including notebooks, reports, lakehouses, etc.
Resource Types
Type: .<item_type> (e.g., .Notebook, .Lakehouse, .Report)
To explore commands for any item type, run:
See all available item extensions.
Navigation¶
Navigate to an item using its full path.
Navigate to an item using relative path from current context.
Item Management¶
Create Item¶
Unsupported Items: .Dashboard, .Datamart, .MirroredWarehouse, .PaginatedReport, .SQLEndpoint
Items with Required Parameters:
.MountedDataFactory:subscriptionId,resourceGroup,factoryName
Items with Optional Parameters:
.Lakehouse:enableSchemas.Warehouse:enableCaseInsensitive.KQLDatabase:dbtype,eventhouseId,clusterUri,databaseName.MirroredDatabase:mirrorType,connectionId,defaultSchema,database,mountedTables.Report:semanticModelId
Create Basic Items¶
Create items without special parameters.
Create Items with Parameters¶
Create items with specific configuration parameters.
Check Item Supported Parameters¶
View supported parameters for any item type.
Check Item Existence¶
Check if a specific item exists and is accessible.
Get Item¶
When you get an item definition, the sensitivity label is not a part of the definition
Unsupported Items: .Dashboard, .Datamart, .MirroredWarehouse, .PaginatedReport, .SQLEndpoint
Get Item Details¶
Retrieve full item details.
Get All Properties (Verbose)¶
Show comprehensive item properties including extended metadata.
Query Specific Properties¶
Extract specific properties using JMESPath query.
Export Query Results¶
Save query results to a local directory.
List Items¶
List Items in Workspace¶
Display all items within a workspace.
List Items with Details¶
Show items with comprehensive metadata.
Query List Items in Workspace¶
fab ls ws1.Workspace -q [].name
fab ls ws1.Workspace -q [].{name:name,id:id}
fab ls ws1.Workspace -q [?contains(name, 'Notebook')]
fab ls ws1.Workspace -l -q [?contains(name, 'Dataflow')].{name:name, id:id}
List Item Contents¶
Browse contents of items that support folder structures.
fab ls ws1.Workspace/lh1.Lakehouse
fab ls ws1.Workspace/wh1.Warehouse
fab ls ws1.Workspace/sem1.SemanticModel
Items Supporting OneLake Folder Structure:
Update Item¶
For detailed information on updating item properties, including limitations and property paths, see the set command documentation.
Update Display Name¶
Change the display name of an item.
Set Description¶
Add or update item description.
Remove Item¶
Remove Item with Confirmation¶
Delete an item with interactive confirmation.
Force Remove Item¶
Delete an item without confirmation prompts.
Set Item Properties¶
Set default lakehouse¶
fab set ws1.Workspace/nb1.Notebook -q definition.parts[0].payload.metadata.dependencies.lakehouse -i '{"known_lakehouses": [{"id": "00000000-0000-0000-0000-000000000001"}],"default_lakehouse": "00000000-0000-0000-0000-000000000001", "default_lakehouse_name": "lh1","default_lakehouse_workspace_id": "00000000-0000-0000-0000-000000000000"}'
Set Default Environment for a Notebook¶
fab set ws1.Workspace/nb1.Notebook -q environment -i '{"environmentId": "00000000-0000-0000-0000-000000000002", "workspaceId": "00000000-0000-0000-0000-000000000000"}'
Set Default Warehouse for a Notebook¶
fab set ws1.Workspace/nb1.Notebook -q warehouse -i '{"known_warehouses": [{"id": "00000000-0000-0000-0000-000000000003", "type": "Datawarehouse"}], "default_warehouse": "00000000-0000-0000-0000-000000000003"}'
Rebind Report to Semantic Model¶
For Report PBIR definition version 1:
For Report PBIR definition version 2:
fab set ws1.Workspace/rep1.Report -q definition.parts[0].payload.datasetReference.byConnection.ConnectionString -i "ConnectionStringPrefix....semanticmodelid=00000000-0000-0000-0000-000000000000"
Item Operations¶
Copy Item¶
When you copy an item definition, the sensitivity label is not a part of the definition
Supported Item Types for Copy:
.Notebook,.SparkJobDefinition,.DataPipeline.Report,.SemanticModel.KQLDatabase,.KQLDashboard,.KQLQueryset.Eventhouse,.Eventstream.MirroredDatabase,.Reflex.MountedDataFactory,.CopyJob,.VariableLibrary
Copy Item to Workspace¶
Copy an item to the a workspace, preserving its original name.
Copy Item With to Workspace with a new Item Name¶
Copy an item to the destination and rename.
Copy Item to Folder¶
Copy an item into the destination folder. If the folder does not exist, it will be created.
Move Item¶
When you move item definition, the sensitivity label is not a part of the definition
Move Item to Workspace¶
Move an item to a workspace (removes from source).
Move Item To Workspace with a New Name¶
Move an item to the destination and rename.
Move Item To Folder¶
Move an item into a folder, preserving its original name.
Export Item¶
When you export item definition, the sensitivity label is not a part of the definition
Export to Local¶
Export an item definition to a local directory.
Exportable Item Types:
.Notebook,.SparkJobDefinition,.DataPipeline.Report,.SemanticModel.KQLDatabase,.KQLDashboard,.KQLQueryset.Eventhouse,.Eventstream,.MirroredDatabase.Reflex,.MountedDataFactory,.CopyJob,.VariableLibrary
Export to Lakehouse¶
Export item definition directly to a Lakehouse Files location.
Import Item¶
Import from Local¶
Import an item definition from a local directory into the workspace.
Deploy Items from Configuration¶
Deploy items from local workspace content to a target workspace using a configuration file.
Deploy Specific Item Types¶
Deploy only specific types of items using item_types_in_scope.
fab deploy --config config.yml -tenv dev -P config_override='{"core": {"item_types_in_scope": ["Notebook", "DataPipeline"]}}'
Deploy Specific Items¶
Deploy only specified items using items_to_include.
fab deploy --config config.yml -tenv prod -P config_override='{"publish": {"items_to_include": ["MainNotebook.Notebook", "ProductionPipeline.DataPipeline"]}, "features": ["enable_items_to_include", "enable_experimental_features"]}'
Deploy with Item Exclusions¶
Deploy items while excluding specific items or patterns.
fab deploy --config config.yml -tenv dev -P config_override='{"publish": {"exclude_regex": "^(TEMP|DEBUG|TEST).*"}}'
Configuration Options
All the configuration options shown above with config_override can also be defined directly in the configuration file instead of passing them as command-line overrides. The config_override examples are provided for demonstration and dynamic configuration purposes.
Start/Stop Mirrored Databases¶
Start Mirrored Database¶
Start data synchronization for a mirrored database.
Force Start Mirrored Database¶
Start mirrored database without confirmation.
Stop Mirrored Database¶
Stop data synchronization for a mirrored database.
Force Stop Mirrored Database¶
Stop mirrored database without confirmation.
Semantic Model Refresh¶
For detailed examples on triggering and monitoring semantic model refresh using the API command, see the Semantic Model Refresh Example.
Open in Browser¶
Open Item in Web Interface¶
Launch an item in the default web browser.