Lists the Fabric workspaces the signed-in user or application can access. A workspace is the top-level container that holds Lakehouses, Warehouses, semantic models, notebooks, and other Fabric items.
Usage
fabric_workspaces(
roles = NULL,
prefer_workspace_endpoints = FALSE,
tenant_id = Sys.getenv("FABRICQUERYR_TENANT_ID"),
client_id = Sys.getenv("FABRICQUERYR_CLIENT_ID", unset =
"04b07795-8ddb-461a-bbee-02f9e1bf7b46"),
token = NULL,
auth_args = list(),
api_base = .fabric_api_base,
allow_custom_endpoint = FALSE
)Arguments
- roles
Optional workspace roles to include, such as
"Viewer","Contributor","Member", or"Admin". LeaveNULLto return every visible workspace.- prefer_workspace_endpoints
Logical. Set to
TRUEto ask Fabric for a workspace-specific API endpoint, which can be needed with workspace-level private links. When such an endpoint is returned, Warehouse and Lakehouse SQL details are resolved through the dedicated connection-string API withprivateLinkType=Workspace. Most users should keep the default,FALSE.- tenant_id
Microsoft Entra tenant ID. Defaults to
FABRICQUERYR_TENANT_ID.- client_id
Microsoft Entra application/client ID. Defaults to
FABRICQUERYR_CLIENT_ID, then the Azure CLI application ID.- token
Preferred token input: an
AzureAuth::AzureTokenobject, bearer-token string, or token-provider function. WithNULL(the default),AzureAuthreuses a matching cached token or starts its normal interactive login flow when a new token is required.- auth_args
Named list of additional arguments passed to
AzureAuth::get_azure_token()when no token source is supplied. Discovery uses thehttps://api.fabric.microsoft.com/.defaultaudience and requiresWorkspace.Read.AllorWorkspace.ReadWrite.All.- api_base
Fabric REST API base URL. Leave unchanged unless using a different Fabric cloud or a test service.
- allow_custom_endpoint
Logical. Set to
TRUEonly whenapi_baseis a non-Microsoft HTTPS origin that you trust to receive a Fabric token.