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.
Item targets: Data Warehouse vs SQL Analytics Endpoint¶
Fabric has two SQL-surface item kinds:
- Data Warehouse — read-write, supports full DDL (CREATE/DROP/TRUNCATE TABLE, CREATE/DROP SCHEMA, CREATE/ALTER VIEW, etc.).
- SQL Analytics Endpoint — read-only SQL surface auto-generated over a Lakehouse. DDL and mutating operations are not supported; only read/query operations are allowed.
Each command below is labelled with one of:
Targets: Data Warehouse · SQL Analytics Endpoint— the command works on both item kinds.Targets: Data Warehouse only— the command is blocked on SQL Analytics Endpoints (either by an explicit client-side guard in the source code, because it requires write/DDL capability that endpoints do not have, or because it calls warehouse-scoped REST API paths that are not available for SQL Analytics Endpoints).Targets: SQL Analytics Endpoint— the command operates on SQL Analytics Endpoints specifically (not on Data Warehouses).Targets: Workspace (not item-specific)— the command operates at the workspace level and does not target a specific DW or SQL Analytics Endpoint item.
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¶
Targets: Workspace (not item-specific)
List all workspaces the authenticated principal has access to.
Synopsis
Example
id displayName capacityId
------------------------------------ ---------------- ------------------------------------
3f2a1c5d-... MyWorkspace ab12cd34-...
workspaces get¶
Targets: Workspace (not item-specific)
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¶
Targets: Workspace (not item-specific)
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¶
Targets: Data Warehouse · SQL Analytics Endpoint
List all Data Warehouses and SQL Analytics Endpoints 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¶
Targets: Data Warehouse only
Get details for a specific Data Warehouse. Uses the warehouse-scoped REST path (GET /workspaces/{ws}/warehouses/{id}); passing a SQL Analytics Endpoint GUID will return a 404. Use sql-endpoints get to retrieve endpoint details.
Synopsis
Example
warehouses create¶
Targets: Data Warehouse only
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¶
Targets: Data Warehouse only
Rename a warehouse and optionally update its description.
Synopsis
| Option | Description |
|---|---|
--description TEXT |
Optional new description. |
Example
warehouses delete¶
Targets: Data Warehouse only
Delete a warehouse. You will be asked to confirm unless --yes is passed.
Synopsis
Example
warehouses takeover¶
Targets: Data Warehouse only
Take ownership of a warehouse. Not supported for SQL Analytics Endpoints.
Synopsis
Example
warehouses permissions¶
Targets: Data Warehouse · SQL Analytics Endpoint
List all principals (users, groups, service principals) with access to a warehouse, including their effective permissions. Requires Fabric Administrator role.
Synopsis
| Option | Description |
|---|---|
--json |
Emit raw JSON instead of a Rich table. Pass on the root command. |
Example
# Tabular output
fabric-dw warehouses permissions MyWorkspace SalesWH
# Raw JSON
fabric-dw --json warehouses permissions MyWorkspace SalesWH
Display Name UPN / App ID Type Permissions Additional Permissions
--------------- ------------------------ ------- -------------- ----------------------
Alice alice@contoso.com User Read, Write
DataPipeline 00000000-0000-... ServicePrincipal Read
fabric-dw sql-endpoints¶
Manage Microsoft Fabric SQL Analytics Endpoints.
sql-endpoints list¶
Targets: SQL Analytics Endpoint
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¶
Targets: SQL Analytics Endpoint
Get details for a specific SQL Analytics Endpoint.
Synopsis
Example
sql-endpoints refresh¶
Targets: SQL Analytics Endpoint
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.
Results are shown as a Rich table (Table, Status, End Time, Error). Pass --json on the root command to emit raw JSON instead.
Synopsis
Options
| Flag | Description |
|---|---|
--recreate-tables |
Drop and recreate all tables during the refresh. Use to resolve inconsistencies or force a clean rebuild. Destructive — use with caution. |
Example
# Standard refresh — shows a per-table Rich table
fabric-dw sql-endpoints refresh MyWorkspace MyLakehouseEP
# Force a full table recreate
fabric-dw sql-endpoints refresh --recreate-tables MyWorkspace MyLakehouseEP
# Emit raw JSON
fabric-dw --json sql-endpoints refresh MyWorkspace MyLakehouseEP
sql-endpoints permissions¶
Targets: SQL Analytics Endpoint
List all principals (users, groups, service principals) with access to a SQL Analytics Endpoint, including their effective permissions. Requires Fabric Administrator role.
Synopsis
| Option | Description |
|---|---|
--json |
Emit raw JSON instead of a Rich table. Pass on the root command. |
Example
# Tabular output
fabric-dw sql-endpoints permissions MyWorkspace MyLakehouseEP
# Raw JSON
fabric-dw --json sql-endpoints permissions MyWorkspace MyLakehouseEP
Display Name UPN / App ID Type Permissions Additional Permissions
--------------- ------------------------ ------- -------------- ----------------------
Alice alice@contoso.com User Read, Write
DataPipeline 00000000-0000-... ServicePrincipal Read
fabric-dw sql¶
Execute SQL against a Fabric Data Warehouse or SQL Analytics Endpoint.
sql exec¶
Targets: Data Warehouse · SQL Analytics Endpoint
Execute a SQL statement or file against a warehouse or SQL Analytics Endpoint. Provide the query via -q/--query or -f/--file (not both). Multi-statement batches are supported; only the last result set is returned. DDL/DML statements return empty columns and rows.
Warning: This command executes arbitrary SQL, including DDL and DML. Ensure you have the correct target before running destructive statements.
Synopsis
| Option | Description |
|---|---|
-q / --query TEXT |
SQL statement or batch to execute inline. |
-f / --file PATH |
Path to a .sql file to execute. UTF-8 and UTF-8 BOM files are both supported. |
Output defaults to a Rich table (rows/columns). Pass --json on the root command to emit machine-readable JSON ({"columns": [...], "rows": [...], "rowcount": N}).
Example
# Inline query, Rich table output (default)
fabric-dw sql exec MyWorkspace SalesWH -q "SELECT TOP 5 * FROM dbo.Sales"
# File input, JSON output
fabric-dw --json sql exec MyWorkspace SalesWH -f ./queries/report.sql
fabric-dw audit¶
Manage SQL audit settings for Microsoft Fabric Data Warehouses.
audit get¶
Targets: Data Warehouse only
Get the current audit settings for a warehouse.
Synopsis
Example
audit enable¶
Targets: Data Warehouse only
Enable SQL auditing on a warehouse.
Synopsis
| Option | Description | Default |
|---|---|---|
--retention-days INTEGER |
Audit log retention in days (>= 1). Mutually exclusive with --unlimited. |
— |
--unlimited |
Set unlimited audit log retention (service value 0). Mutually exclusive with --retention-days. |
off |
Omitting both --retention-days and --unlimited defaults to unlimited retention. Passing 0 for --retention-days is rejected — use --unlimited for no-limit retention.
Example
# Retain logs for 90 days
fabric-dw audit enable --retention-days 90 MyWorkspace SalesWH
# Unlimited retention
fabric-dw audit enable --unlimited MyWorkspace SalesWH
audit disable¶
Targets: Data Warehouse only
Disable SQL auditing on a warehouse.
Synopsis
Example
audit set-retention¶
Targets: Data Warehouse only
Update the audit log retention period without changing the audit enabled/disabled state. Audit must already be enabled; if it is disabled, run audit enable first.
Synopsis
| Option | Description |
|---|---|
--days INTEGER |
Retention period in days (1–3653; 3653 ≈ 10 years). (required) |
Example
audit set-groups¶
Targets: Data Warehouse only
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
audit add-group¶
Targets: Data Warehouse only
Add a single audit action group without overwriting the others. Idempotent — if the group is already present the command succeeds without modifying the configuration. Auditing must already be enabled.
Synopsis
Example
audit remove-group¶
Targets: Data Warehouse only
Remove a single audit action group without overwriting the others. Idempotent — if the group is not present the command succeeds without modifying the configuration. Auditing must already be enabled.
Synopsis
Example
fabric-dw queries¶
Inspect and manage running queries on Microsoft Fabric Data Warehouses and SQL Analytics Endpoints.
queries list¶
Targets: Data Warehouse · SQL Analytics Endpoint
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¶
Targets: Data Warehouse · SQL Analytics Endpoint
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¶
Targets: Data Warehouse · SQL Analytics Endpoint
Kill a specific session on a warehouse or SQL Analytics Endpoint. You will be asked to confirm unless --yes is passed.
Synopsis
Example
queries request-history¶
Targets: Data Warehouse · SQL Analytics Endpoint
List completed SQL requests from queryinsights.exec_requests_history. Supports optional time-range filtering with --since and --until (ISO-8601 strings). The --limit option caps the number of rows returned (default: 100, max: 10 000).
Synopsis
| Option | Description | Default |
|---|---|---|
--limit INTEGER |
Maximum rows to return (1–10 000). | 100 |
--since ISO8601 |
Return rows with timestamp >= this value. | — |
--until ISO8601 |
Return rows with timestamp <= this value. | — |
Example
queries session-history¶
Targets: Data Warehouse · SQL Analytics Endpoint
List completed sessions from queryinsights.exec_sessions_history.
Synopsis
| Option | Description | Default |
|---|---|---|
--limit INTEGER |
Maximum rows to return (1–10 000). | 100 |
--since ISO8601 |
Return rows with session_start_time >= this value. | — |
--until ISO8601 |
Return rows with session_start_time <= this value. | — |
Example
queries frequent¶
Targets: Data Warehouse · SQL Analytics Endpoint
List frequently-run queries from queryinsights.frequently_run_queries.
Synopsis
| Option | Description | Default |
|---|---|---|
--limit INTEGER |
Maximum rows to return (1–10 000). | 100 |
--since ISO8601 |
Return rows with last_run_start_time >= this value. | — |
--until ISO8601 |
Return rows with last_run_start_time <= this value. | — |
Example
queries long-running¶
Targets: Data Warehouse · SQL Analytics Endpoint
List long-running queries from queryinsights.long_running_queries.
Synopsis
| Option | Description | Default |
|---|---|---|
--limit INTEGER |
Maximum rows to return (1–10 000). | 100 |
--since ISO8601 |
Return rows with last_run_start_time >= this value. | — |
--until ISO8601 |
Return rows with last_run_start_time <= this value. | — |
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¶
Targets: Data Warehouse only
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¶
Targets: Data Warehouse only
Get details for a single restore point by ID.
Synopsis
Example
restore-points create¶
Targets: Data Warehouse only
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¶
Targets: Data Warehouse only
Rename a restore point and optionally update its description.
Synopsis
| Option | Description |
|---|---|
--description TEXT |
Optional new description. |
Example
restore-points delete¶
Targets: Data Warehouse only
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¶
Targets: Data Warehouse only
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¶
Targets: Data Warehouse · SQL Analytics Endpoint
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¶
Targets: Data Warehouse · SQL Analytics Endpoint
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¶
Targets: Data Warehouse · SQL Analytics Endpoint
Create a new SQL view.
Synopsis
| Option | Description |
|---|---|
--name SCHEMA.VIEW |
Required. Qualified view name (e.g. dbo.vw_sales). |
--select TEXT |
Inline SELECT statement for the view body. |
--from-file PATH |
Path to a .sql file containing the SELECT statement. |
Exactly one of --select or --from-file must be provided.
Example
fabric-dw views create MyWorkspace SalesWH \
--name dbo.vw_recent \
--select "SELECT id, amount FROM dbo.sales WHERE sale_date >= '2026-01-01'"
views update¶
Targets: Data Warehouse · SQL Analytics Endpoint
Redefine an existing view using CREATE OR ALTER VIEW.
Synopsis
QUALIFIED_NAME is the dot-separated schema.view_name to update.
| Option | Description |
|---|---|
--select TEXT |
Inline SELECT statement for the new view body. |
--from-file PATH |
Path to a .sql file containing the new SELECT statement. |
Exactly one of --select or --from-file must be provided.
Example
fabric-dw views update MyWorkspace SalesWH dbo.vw_recent \
--select "SELECT id, amount, region FROM dbo.sales WHERE sale_date >= '2026-01-01'"
views drop¶
Targets: Data Warehouse · SQL Analytics Endpoint
Drop a SQL view. You will be asked to confirm unless --yes is passed.
Synopsis
Example
views rename¶
Targets: Data Warehouse · SQL Analytics Endpoint
Rename a SQL view via sp_rename. The new name must be an unqualified (bare) identifier — sp_rename cannot move a view to a different schema.
Synopsis
QUALIFIED_NAME is the current dot-separated schema.view_name.
| Option | Description |
|---|---|
--new-name TEXT |
Required. New bare view name (no schema prefix). |
Example
views read¶
Targets: Data Warehouse · SQL Analytics Endpoint
Read up to --count rows from a view and emit them as JSON (default), CSV, or Parquet.
CSV and Parquet formats require --output. JSON is emitted to stdout by default.
Synopsis
| Option | Description | Default |
|---|---|---|
--count N |
Maximum rows to return. | 10 |
--format {json\|csv\|parquet} |
Output format. | json |
--output PATH |
Write to file instead of stdout. Required for csv and parquet. |
Example
fabric-dw procedures¶
Manage stored procedures on Microsoft Fabric Data Warehouses and SQL Analytics Endpoints.
procedures list¶
Targets: Data Warehouse · SQL Analytics Endpoint
List stored procedures on a warehouse or SQL Analytics Endpoint. Pass --schema to filter to a single schema.
Synopsis
| Option | Description |
|---|---|
--schema TEXT |
Only list procedures in this schema. |
Example
schema_name name created modified
------------ --------------- --------------------- ---------------------
dbo usp_load_sales 2026-01-10T08:00:00Z 2026-06-01T12:00:00Z
procedures get¶
Targets: Data Warehouse · SQL Analytics Endpoint
Get the full definition of a single stored procedure.
Synopsis
QUALIFIED_NAME must be a dot-separated schema.proc_name string, e.g. dbo.usp_load_sales.
Example
procedures create¶
Targets: Data Warehouse · SQL Analytics Endpoint
Create a new stored procedure.
Synopsis
| Option | Description |
|---|---|
--name SCHEMA.PROC |
Required. Qualified procedure name (e.g. dbo.usp_load_sales). |
--body TEXT |
Inline procedure body (the AS … section). |
--from-file PATH |
Path to a .sql file containing the procedure body. |
Exactly one of --body or --from-file must be provided.
Example
fabric-dw procedures create MyWorkspace SalesWH \
--name dbo.usp_archive_orders \
--body "BEGIN INSERT INTO dbo.archive SELECT * FROM dbo.orders; END"
procedures update¶
Targets: Data Warehouse · SQL Analytics Endpoint
Redefine an existing stored procedure via CREATE OR ALTER PROCEDURE.
Synopsis
QUALIFIED_NAME is the dot-separated schema.proc_name to update.
| Option | Description |
|---|---|
--body TEXT |
Inline procedure body. |
--from-file PATH |
Path to a .sql file containing the procedure body. |
Exactly one of --body or --from-file must be provided. You will be asked to confirm unless --yes is passed.
Example
fabric-dw procedures update MyWorkspace SalesWH dbo.usp_archive_orders \
--from-file ./procs/usp_archive_orders_v2.sql
procedures drop¶
Targets: Data Warehouse · SQL Analytics Endpoint
Drop a stored procedure. You will be asked to confirm unless --yes is passed.
Synopsis
Example
fabric-dw tables¶
Manage SQL tables on Microsoft Fabric Data Warehouses and SQL Analytics Endpoints.
List-source note — no public REST API exists for enumerating warehouse tables.
tables listfalls back to TDS viasys.tables JOIN sys.schemas, the same approach used byviews list.
tables list¶
Targets: Data Warehouse · SQL Analytics Endpoint
List all tables on a warehouse or SQL Analytics Endpoint. Pass --schema to filter to a single schema.
Synopsis
| Option | Description |
|---|---|
--schema TEXT |
Only list tables in this schema. |
Example
schema_name name created modified
------------ --------- --------------------- ---------------------
dbo customers 2026-01-10T08:00:00Z 2026-06-01T12:00:00Z
dbo orders 2026-02-01T09:00:00Z 2026-05-15T14:00:00Z
tables read¶
Targets: Data Warehouse · SQL Analytics Endpoint
Read up to --count rows from a table and emit them as JSON (default), CSV, or Parquet.
CSV and Parquet formats require --output. JSON is emitted to stdout by default.
Synopsis
| Option | Description | Default |
|---|---|---|
--count N |
Maximum rows to return. | 10 |
--format {json\|csv\|parquet} |
Output format. | json |
--output PATH |
Write to file instead of stdout. Required for csv and parquet. |
Example
tables create¶
Targets: Data Warehouse only
Create a new table via CTAS (CREATE TABLE … AS SELECT). The body must start with SELECT (leading block and line comments are allowed).
Synopsis
| Option | Description |
|---|---|
--name SCHEMA.TABLE |
Required. Qualified table name. |
--select TEXT |
Inline SELECT statement. |
--from-file PATH |
Path to a .sql file containing the SELECT body (UTF-8/UTF-8-sig). |
Exactly one of --select or --from-file must be provided.
Example
fabric-dw tables create MyWorkspace SalesWH \
--name dbo.orders_2026 \
--select "SELECT * FROM dbo.orders WHERE YEAR(sale_date) = 2026"
tables delete¶
Targets: Data Warehouse only
Drop a table. You will be asked to confirm unless --yes is passed.
Synopsis
Example
tables clear¶
Targets: Data Warehouse only
Truncate a table (delete all rows, keep structure). You will be asked to confirm unless --yes is passed.
Synopsis
Example
tables clone¶
Targets: Data Warehouse only
Create a zero-copy clone of a table using CREATE TABLE … AS CLONE OF. Pass --at to clone from a point in time within the warehouse data-retention window.
Synopsis
| Option | Description |
|---|---|
--source SCHEMA.TABLE |
Required. Qualified source table to clone. |
--name SCHEMA.TABLE |
Required. Qualified name for the new clone. |
--at ISO8601 |
Optional UTC timestamp for a historical clone (e.g. 2024-05-20T14:00:00). Must be within the data-retention window. |
Example
# Clone to the current state
fabric-dw tables clone MyWorkspace SalesWH \
--source dbo.orders \
--name dbo.orders_backup
# Point-in-time clone
fabric-dw tables clone MyWorkspace SalesWH \
--source dbo.orders \
--name dbo.orders_may_snapshot \
--at 2024-05-20T14:00:00
tables rename¶
Targets: Data Warehouse only
Rename a table via sp_rename. The new name must be an unqualified (bare) identifier — sp_rename cannot move a table to a different schema.
Synopsis
QUALIFIED_NAME is the current dot-separated schema.table_name.
| Option | Description |
|---|---|
--new-name TEXT |
Required. New bare table name (no schema prefix). |
Example
fabric-dw schemas¶
Manage SQL schemas on Microsoft Fabric Data Warehouses and SQL Analytics Endpoints.
List-source note — no public REST API exists for enumerating warehouse schemas.
schemas listfalls back to TDS viasys.schemas, filtering out well-known system schemas (sys,INFORMATION_SCHEMA,guest,db_*fixed-role schemas).dbois always included because it is user-writable.SQL Analytics Endpoints —
schemas list,schemas create, andschemas deleteall work on both Fabric Data Warehouses and SQL Analytics Endpoints. Whenschemas delete --cascadeis used on a SQL Analytics Endpoint, views, stored procedures, and functions in the schema are dropped, but tables are not dropped (becauseDROP TABLEis a Warehouse-only operation on Fabric). If the schema contains tables, the finalDROP SCHEMAwill be rejected by the engine; remove the tables manually first or omit--cascadeand drop the schema only after it is empty.
schemas list¶
Targets: Data Warehouse · SQL Analytics Endpoint
List all user-defined schemas on a warehouse or SQL Analytics Endpoint. System schemas are excluded.
Usage
Example
schemas create¶
Targets: Data Warehouse · SQL Analytics Endpoint
Create a new SQL schema on a warehouse.
Usage
Example
schemas delete¶
Targets: Data Warehouse · SQL Analytics Endpoint
Drop a schema from a warehouse. You will be asked to confirm unless --yes is passed.
Pass --cascade to also drop all tables and views inside the schema before dropping the schema itself. This is a destructive, irreversible operation.
Usage
| Option | Description |
|---|---|
--cascade |
Drop all tables and views in the schema first. WARNING: permanently deletes all contained objects and data. |
Example
# Drop an empty schema
fabric-dw --yes schemas delete MyWorkspace SalesWH staging
# Drop a schema and all its tables/views
fabric-dw --yes schemas delete MyWorkspace SalesWH staging --cascade
fabric-dw snapshots¶
Manage Microsoft Fabric Data Warehouse snapshots.
snapshots list¶
Targets: Data Warehouse only
List all snapshots for a warehouse.
Synopsis
Example
displayName id createdTime
---------------- ------------ ---------------------
snap-2026-06-01 d1e2... 2026-06-01T00:00:00Z
snapshots create¶
Targets: Data Warehouse only
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¶
Targets: Data Warehouse only
Rename a snapshot and optionally update its description.
Synopsis
| Option | Description |
|---|---|
--description TEXT |
Optional new description. |
Example
snapshots delete¶
Targets: Data Warehouse only
Delete a snapshot. You will be asked to confirm unless --yes is passed.
Synopsis
Example
snapshots roll¶
Targets: Data Warehouse only
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 sql-pools¶
Beta / preview feature
Manages workspace SQL Pools (currently in preview; the API may change before GA). Callers must hold the workspace admin role.
Manage custom SQL Pools at the workspace level with sub-resource commands that mirror the Azure CLI style.
sql-pools get¶
Targets: Workspace (not item-specific)
Fetch the full SQL Pools configuration (enabled flag + pool list) for a workspace.
Synopsis
Example
sql-pools list¶
Targets: Workspace (not item-specific)
List all SQL pools in a workspace.
Synopsis
Example
sql-pools show¶
Targets: Workspace (not item-specific)
Show details for a single SQL pool.
Synopsis
| Option | Description |
|---|---|
--name TEXT |
Pool name to show. (required) |
Example
sql-pools create¶
Targets: Workspace (not item-specific)
Add a new SQL pool to a workspace.
Synopsis
| Option | Description |
|---|---|
--name TEXT |
Pool name. (required) |
--max-percent INTEGER |
Max resource percentage (1–100). (required) |
--default / --no-default |
Mark as default pool. Default: --no-default. |
--optimize-for-reads / --no-optimize-for-reads |
Enable read optimisation. Default: --optimize-for-reads. |
--classifier-type TEXT |
Classifier type (e.g. Application Name). |
--classifier-value TEXT |
Classifier value. Repeat for multiple values. |
Example
fabric-dw sql-pools create MyWorkspace \
--name ETL \
--max-percent 30 \
--no-optimize-for-reads \
--classifier-type "Application Name" \
--classifier-value "ETL" \
--classifier-value "Load"
sql-pools update¶
Targets: Workspace (not item-specific)
Update an existing SQL pool. Only the flags you provide are changed; all other fields are preserved.
Synopsis
| Option | Description |
|---|---|
--name TEXT |
Pool name to update. (required) |
--max-percent INTEGER |
New max resource percentage. |
--default / --no-default |
Set or clear the default flag. |
--optimize-for-reads / --no-optimize-for-reads |
Enable or disable read optimisation. |
--classifier-type TEXT |
New classifier type. |
--classifier-value TEXT |
New classifier value(s). Replaces all existing values. |
Example
sql-pools delete¶
Targets: Workspace (not item-specific)
Remove a SQL pool from a workspace. You will be asked to confirm unless --yes is passed.
Synopsis
| Option | Description |
|---|---|
--name TEXT |
Pool name to delete. (required) |
--yes |
Skip confirmation prompt. |
Example
sql-pools enable¶
Targets: Workspace (not item-specific)
Enable custom SQL Pools for a workspace. Preserves the existing pool configuration.
Synopsis
Example
sql-pools disable¶
Targets: Workspace (not item-specific)
Disable custom SQL Pools for a workspace without deleting pool definitions. Re-enabling with sql-pools enable restores the previously saved configuration.
Synopsis
Example
sql-pools insights¶
Targets: Data Warehouse · SQL Analytics Endpoint
List SQL pool insight events from queryinsights.sql_pool_insights. Supports optional time-range filtering with --since and --until (ISO-8601 strings). The --limit option caps the number of rows returned (default: 100, max: 10 000).
Synopsis
| Option | Description | Default |
|---|---|---|
--limit INTEGER |
Maximum rows to return (1–10 000). | 100 |
--since ISO8601 |
Return rows with timestamp >= this value. | — |
--until ISO8601 |
Return rows with timestamp <= this value. | — |
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¶
Targets: Workspace (not item-specific)
Clear all cached entries.
Synopsis
Example
fabric-dw completion¶
Manage shell completion scripts. See Shell Completion for full installation details.
completion install¶
Targets: Workspace (not item-specific)
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. |