Command-line reference¶
fabric-dw is a command-line interface for administering Microsoft Fabric Data Warehouses and SQL Analytics Endpoints. The general invocation pattern is:
Name-or-GUID arguments — wherever a synopsis shows WORKSPACE, WAREHOUSE, ENDPOINT, or SNAPSHOT, the value can be either the display name or the item's GUID. The CLI resolves names to GUIDs automatically and caches the mapping locally (see fabric-dw cache).
Positional arguments with defaults — positional arguments shown in [brackets] may be omitted when a default has been set with fabric-dw config set. See Defaults — fabric-dw config for details.
Global options¶
These options can be placed immediately after fabric-dw, before the noun.
| Flag | Description | Default |
|---|---|---|
--json |
Emit machine-readable JSON instead of Rich tables. | off |
--auth {default\|sp\|interactive} |
Override FABRIC_AUTH for this invocation. |
default |
-y / --yes |
Skip confirmation prompts on destructive commands. | off |
-v / --verbose |
Enable DEBUG-level logging. | INFO |
The --auth flag and the FABRIC_AUTH environment variable accept the same three values. See Authentication for the full credential chain.
Defaults — fabric-dw config¶
fabric-dw can store a default workspace and/or warehouse so you do not have to repeat them on every invocation.
Once set, any positional WORKSPACE or WAREHOUSE argument shown in [brackets] in the synopsis below can be omitted. The stored value is resolved in the same way as an explicit argument (name or GUID).
--all-workspaces (where available) and a configured default workspace are mutually exclusive — passing -A always ignores the stored default.
Resolution order for the workspace:
- Explicit positional argument on the command line.
FABRIC_DW_DEFAULT_WORKSPACEenvironment variable.- Value stored by
fabric-dw config set workspace.
The warehouse follows the same order using FABRIC_DW_DEFAULT_WAREHOUSE.
For authentication configuration, see Authentication.
Manage your defaults with:
| Command | Effect |
|---|---|
fabric-dw config show |
Print the current defaults. |
fabric-dw config set workspace VALUE |
Set the default workspace (name or GUID). |
fabric-dw config set warehouse VALUE |
Set the default warehouse (name or GUID). |
fabric-dw config unset workspace |
Clear the default workspace. |
fabric-dw config unset warehouse |
Clear the default warehouse. |
fabric-dw config clear |
Wipe all configuration defaults. |
fabric-dw workspaces¶
Manage Microsoft Fabric workspaces.
workspaces list¶
List all workspaces the authenticated principal has access to.
Synopsis
Example
id displayName capacityId
------------------------------------ ---------------- ------------------------------------
3f2a1c5d-... MyWorkspace ab12cd34-...
workspaces get¶
Get details for a workspace, including its default Data Warehouse collation.
Synopsis
Example
id 3f2a1c5d-...
displayName MyWorkspace
capacityId ab12cd34-...
defaultDataWarehouseCollation Latin1_General_100_CI_AS_KS_WS_SC_UTF8
workspaces set-collation¶
Set the default Data Warehouse collation for a workspace. COLLATION must be one of the supported Fabric collations.
Synopsis
Example
fabric-dw warehouses¶
Manage Microsoft Fabric Data Warehouses and SQL Analytics Endpoints.
warehouses list¶
List all warehouses in a workspace. Pass -A / --all-workspaces to aggregate across every visible workspace. WORKSPACE and --all-workspaces are mutually exclusive.
Synopsis
| Option | Description |
|---|---|
-A / --all-workspaces |
Scan all visible workspaces and aggregate results. |
Example
workspace displayName id
-------------- -------------- ------------------------------------
MyWorkspace SalesWH 7c3f...
OtherWS AnalyticsWH 1a2b...
warehouses get¶
Get details for a specific warehouse.
Synopsis
Example
warehouses create¶
Create a new warehouse in a workspace.
Synopsis
| Option | Description |
|---|---|
--collation TEXT |
Default collation for the new warehouse. |
--description TEXT |
Description for the new warehouse. |
Example
warehouses rename¶
Rename a warehouse and optionally update its description.
Synopsis
| Option | Description |
|---|---|
--description TEXT |
Optional new description. |
Example
warehouses delete¶
Delete a warehouse. You will be asked to confirm unless --yes is passed.
Synopsis
Example
warehouses takeover¶
Take ownership of a warehouse. Not supported for SQL Analytics Endpoints.
Synopsis
Example
fabric-dw sql-endpoints¶
Manage Microsoft Fabric SQL Analytics Endpoints.
sql-endpoints list¶
List all SQL Analytics Endpoints in a workspace. Supports -A / --all-workspaces to scan every visible workspace.
Synopsis
| Option | Description |
|---|---|
-A / --all-workspaces |
Scan all visible workspaces and aggregate results. |
Example
sql-endpoints get¶
Get details for a specific SQL Analytics Endpoint.
Synopsis
Example
sql-endpoints refresh¶
Refresh metadata for a SQL Analytics Endpoint by triggering a sync from the underlying Lakehouse delta tables. This is a long-running operation (LRO) that is polled to completion.
Synopsis
Example
fabric-dw audit¶
Manage SQL audit settings for Microsoft Fabric Data Warehouses.
audit get¶
Get the current audit settings for a warehouse.
Synopsis
Example
audit enable¶
Enable SQL auditing on a warehouse.
Synopsis
| Option | Description | Default |
|---|---|---|
--retention-days INTEGER |
Audit log retention in days. 0 means unlimited. |
0 |
Example
audit disable¶
Disable SQL auditing on a warehouse.
Synopsis
Example
audit set-groups¶
Set the audit action groups for a warehouse. Pass --group / -g once per action group. This replaces the existing list of groups.
Synopsis
| Option | Description |
|---|---|
-g / --group TEXT |
Audit action group name. Repeat for multiple groups. (required) |
Example
fabric-dw audit set-groups \
-g BATCH_COMPLETED_GROUP \
-g SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP \
MyWorkspace SalesWH
fabric-dw queries¶
Inspect and manage running queries on Microsoft Fabric Data Warehouses and SQL Analytics Endpoints.
queries list¶
List all currently running queries on a warehouse or SQL Analytics Endpoint.
Synopsis
Example
sessionId loginName startTime commandText
----------- ----------- --------------------- -------------------------
42 user@co.io 2026-06-08T10:01:00Z SELECT * FROM sales ...
queries list-connections¶
List all active SQL connections on a warehouse or SQL Analytics Endpoint. This queries sys.dm_exec_connections and shows lower-level connection info (including idle connections) that is not visible in queries list.
Synopsis
Example
session_id connect_time client_net_address auth_scheme encrypt_option net_transport most_recent_session_id
---------- -------------------- ------------------ ----------- -------------- ------------- ----------------------
10 2026-06-08T10:00:00Z 192.168.1.100 NTLM TRUE TCP 10
20 2026-06-08T10:01:00Z 192.168.1.101 KERBEROS FALSE TCP 20
queries kill¶
Kill a specific session on a warehouse or SQL Analytics Endpoint. You will be asked to confirm unless --yes is passed.
Synopsis
Example
fabric-dw restore-points¶
Manage Microsoft Fabric Warehouse restore points.
A restore point captures the state of a warehouse at a point in time. User-defined restore points can be created, renamed, and deleted. System-created restore points are managed automatically by Fabric and cannot be deleted. Restore point IDs are timestamp-based strings (e.g. "1726617378000"), not GUIDs.
restore-points list¶
List all restore points for a warehouse.
Synopsis
Example
id displayName creationMode eventDateTime
--------------- ------------------ -------------- ---------------------
1726617378000 Before migration UserDefined 2024-10-18T22:17:09Z
restore-points get¶
Get details for a single restore point by ID.
Synopsis
Example
restore-points create¶
Create a new restore point for a warehouse at the current timestamp.
Synopsis
| Option | Description |
|---|---|
--name TEXT |
Optional display name (max 128 chars). |
--description TEXT |
Optional description (max 512 chars). |
Example
fabric-dw restore-points create MyWorkspace SalesWH \
--name "Before migration" \
--description "Pre-migration checkpoint"
restore-points rename¶
Rename a restore point and optionally update its description.
Synopsis
| Option | Description |
|---|---|
--description TEXT |
Optional new description. |
Example
restore-points delete¶
Delete a user-defined restore point. System-created restore points cannot be deleted. You will be asked to confirm unless --yes is passed.
Synopsis
Example
restore-points restore¶
Restore a warehouse in-place to a restore point. This is a destructive operation — the warehouse will be unavailable for approximately 10 minutes. You will be asked to confirm unless --yes is passed.
Synopsis
Example
fabric-dw views¶
Manage SQL views on Microsoft Fabric Data Warehouses and SQL Analytics Endpoints.
views list¶
List all views on a warehouse or SQL Analytics Endpoint. Pass --schema to filter to a single schema.
Synopsis
| Option | Description |
|---|---|
--schema TEXT |
Only list views in this schema. |
Example
schema_name name created modified
------------ ------------ --------------------- ---------------------
dbo vw_sales 2026-01-10T08:00:00Z 2026-06-01T12:00:00Z
dbo vw_monthly 2026-02-01T09:00:00Z 2026-05-15T14:00:00Z
views get¶
Get the full definition of a single view.
Synopsis
QUALIFIED_NAME must be a dot-separated schema.view_name string, e.g. dbo.vw_sales.
Example
schema_name dbo
name vw_sales
qualified_name dbo.vw_sales
created 2026-01-10T08:00:00Z
modified 2026-06-01T12:00:00Z
definition SELECT id, amount FROM dbo.sales
views create¶
Create a new SQL view.
Synopsis
SELECT_BODY is the verbatim SELECT statement that forms the view body.
Example
fabric-dw views create MyWorkspace SalesWH dbo.vw_recent \
"SELECT id, amount FROM dbo.sales WHERE sale_date >= '2026-01-01'"
views update¶
Redefine an existing view using CREATE OR ALTER VIEW.
Synopsis
Example
fabric-dw views update MyWorkspace SalesWH dbo.vw_recent \
"SELECT id, amount, region FROM dbo.sales WHERE sale_date >= '2026-01-01'"
views drop¶
Drop a SQL view. You will be asked to confirm unless --yes is passed.
Synopsis
Example
fabric-dw snapshots¶
Manage Microsoft Fabric Data Warehouse snapshots.
snapshots list¶
List all snapshots for a warehouse.
Synopsis
Example
displayName id createdTime
---------------- ------------ ---------------------
snap-2026-06-01 d1e2... 2026-06-01T00:00:00Z
snapshots create¶
Create a new snapshot for a warehouse. Optionally pin it to a specific point in time.
Synopsis
| Option | Description |
|---|---|
--description TEXT |
Optional description. |
--snapshot-dt TEXT |
Optional snapshot datetime (ISO 8601, UTC). Defaults to the current timestamp. |
Example
snapshots rename¶
Rename a snapshot and optionally update its description.
Synopsis
| Option | Description |
|---|---|
--description TEXT |
Optional new description. |
Example
snapshots delete¶
Delete a snapshot. You will be asked to confirm unless --yes is passed.
Synopsis
Example
snapshots roll¶
Roll a snapshot on a warehouse to a new timestamp. SNAPSHOT_NAME must be the display name of the snapshot database. WORKSPACE and WAREHOUSE accept name or GUID.
Synopsis
| Option | Description |
|---|---|
--at TEXT |
Target datetime (ISO 8601, UTC). Defaults to CURRENT_TIMESTAMP. |
Example
fabric-dw cache¶
Manage the local name-to-UUID lookup cache. fabric-dw caches workspace and item name-to-GUID mappings to avoid repeated API round-trips. Use these commands if you rename items outside the CLI or need to force a fresh lookup.
cache clear¶
Clear all cached entries.
Synopsis
Example
fabric-dw completion¶
Manage shell completion scripts. See Shell Completion for full installation details.
completion install¶
Generate and optionally install the tab-completion script for bash, zsh, or fish. Without --print, the script is written to the conventional location for the chosen shell (idempotent for bash and zsh). With --print, the script is sent to stdout so you can inspect or source it manually.
Synopsis
| Option | Description |
|---|---|
--print |
Print the completion script to stdout instead of installing it. |
| Shell | Install location |
|---|---|
bash |
Appended to ~/.bashrc (idempotent) |
zsh |
Appended to ~/.zshrc (idempotent) |
fish |
Written to ~/.config/fish/completions/fabric-dw.fish |
Example
# Install for zsh
fabric-dw completion install zsh
# Inspect the bash script before installing
fabric-dw completion install bash --print
For AI-assistant (MCP) usage there is no shell completion — see MCP server instead.
Exit codes¶
| Code | Meaning |
|---|---|
0 |
Success. |
1 |
Usage error, aborted confirmation prompt, or a Fabric API error. |
2 |
Reserved. |