API Examples¶
This page demonstrates how to interact with various Microsoft APIs through the Fabric CLI. The API functionality allows direct REST API calls to Fabric, OneLake, Azure Resource Manager, and Power BI services.
To explore all API commands and their parameters, run:
When using interactive authentication, some api
commands may have limited functionality. If you encounter permission issues while using certain api
commands, consider using service principal authentication as an alternative
Fabric REST API¶
Interact with the Fabric REST API to manage Fabric resources programmatically.
List All Fabric Workspaces¶
List Lakehouses in a Workspace¶
Post request with inline payload¶
fab api -X post workspaces/00000000-0000-0000-0000-000000000000/lakehouses -i '{"displayName": "lakehouseitem"}'
Post request with local file payload¶
fab api -X post workspaces/00000000-0000-0000-0000-000000000000/lakehouses -i /tmp/lakehouse-config.json
Example JSON file content:
OneLake REST API¶
Interact with the OneLake REST API using the storage audience for data operations.
Get Files and Folders from Lakehouse¶
Access content from a Lakehouse Files section with specific parameters.
Get Files Using Parameters¶
Alternative method using parameters instead of query string.
ARM REST API¶
Interact with Azure Resource Manager (ARM) REST API for Fabric capacities using the Azure audience.
List Capacities by Subscription¶
Retrieve all Fabric capacities within a specific Azure subscription.
fab api -A azure subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Fabric/capacities?api-version=2023-11-01
Get Available Fabric SKUs¶
List all available Fabric capacity SKUs for a subscription.
fab api -A azure subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Fabric/skus?api-version=2023-11-01
Power BI REST API¶
Interact with the Power BI REST API using the Power BI audience for legacy Power BI operations.
Get Datasets in a Workspace¶
Retrieve all datasets within a specific Power BI workspace.
List Power BI groups¶
List all accessible Power BI workspaces.