Folder Management Examples¶
Enable Folder Listing
By default, the ls
command does not display folders. To enable folder listing, run the following command:
This page demonstrates how to manage folders in Microsoft Fabric using the CLI. Folder operations allow you to organize items and resources within workspaces and supported item types.
Resource Type
Type: .Folder
To explore all folder-related commands and their parameters, run:
Navigation¶
Navigate to a folder using the full workspace path.
Navigate to a workspace using relative path from current context.
Folder Management¶
Create Folder¶
Create a new folder within a workspace.
Folder Existence¶
Check if a folder exists.
Get Folder¶
Get Folder Details¶
Retrieve full folder details.
Query Specific Properties¶
Query folder properties using JMESPath syntax.
Export Query Results¶
Save query results to a local file.
List Folders¶
List the workspace contents. This command returns both items and folders within the workspace.
List Folder Items¶
List the contents of a folder. Use -l
for detailed output.
Update Folder¶
Set or update folder properties (currently only displayName
is supported). Use -f
to force updates.
Remove Folder¶
Remove a folder. Use -f
to force deletion without confirmation.
Folder Operations¶
Copy Folder¶
Copy Folder to Workspace¶
The folder is copied to the root of the destination workspace, preserving its name. This will fail if a folder with the same name already exists.
Result: target.Workspace/source.Folder
Copy Folder to Folder¶
-
If the destination folder exists, the source folder is copied inside it.
Result:
ws.Workspace/dest.Folder/source.Folder
-
If the destination folder does not exist, the source folder is renamed to the destination folder name.
Result:
ws.Workspace/dest.Folder
Move Folder¶
Move Folder To Workspace¶
Move folder to workspace, preserving its name.
This command will fail if a folder with the same name already exists
Move Folder To Folder¶
-
If the destination folder does not exist, the source folder is renamed to the destination folder name.
Result:
ws2.Workspace/dest.Folder
-
If the destination folder exists, the source folder is moved inside it.
Result:
ws2.Workspace/dest.Folder/source.Folder
For managing folders within OneLake storage (e.g., Lakehouse/Files
), see OneLake Examples