Finds one item and returns the connection details needed by 'fabricQueryR' Use this when you know the item's name or ID and do not need to list every item in the workspace
Usage
fabric_item(
workspace,
item,
type = NULL,
detail = NULL,
detail_errors = c("abort", "record"),
include = NULL,
personal_workspace_tenant_id = NULL,
personal_workspace_owner = NULL,
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,
output = c("r6", "list")
)Arguments
- workspace
Workspace name, ID, or object returned by
fabric_workspaces(). A name is convenient for interactive use; an object avoids an extra lookup- item
Item GUID, exact display name, or an item object returned by a discovery function. A display name must identify exactly one item of the requested
type; use a GUID or discovered object when names are duplicated- type
Optional Fabric API item type, for example
"Lakehouse","Warehouse","SemanticModel", or"Notebook". Matching is done by Fabric, so use the API spelling. LeaveNULLto list all item types- detail
Whether to retrieve connection details as well as names and IDs. This takes more requests and may require additional permissions. For
fabric_item(),NULLenriches every supported type except User Data Functions, whose detail endpoint does not support application identities. The typed Semantic Model, GraphQL, and User Data Function helpers also default to lightweight records- detail_errors
What to do if some connection details cannot be read
"record"returns the available information and stores an error message with the affected item;"abort"stops the call- include
Optional character vector of additional item properties to request. Fabric currently documents
"DefaultIdentity"; values are sent as the API's comma-separatedincludequery parameter- personal_workspace_tenant_id
Optional Microsoft Entra tenant ID used to build the XMLA endpoint for a Personal workspace
- personal_workspace_owner
Optional owner UPN or Entra object ID used to build the XMLA endpoint for a Personal workspace. Microsoft Fabric's workspace API does not return either personal-workspace identifier, so supply this together with
personal_workspace_tenant_idwhen adax_connection_stringis needed for a semantic model in My Workspace- 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
Optional access token or token-provider function. Leave
NULLto let 'fabricQueryR' use its normal sign-in flow- auth_args
Additional sign-in options passed to
AzureAuth::get_azure_token()- api_base
Fabric REST API base URL. When
workspaceis an object containingapiEndpoint, that workspace-specific endpoint is used unlessapi_baseis supplied explicitly- output
Discovery record representation. The default
"r6"returns R6 objects with type-specific methods. Use"list"when a plain record is specifically required
Value
With output = "r6", a FabricItem object or type-specific
subclass. With output = "list", one fabric_item record containing the
item's name, ID, type, workspace, and available connection details
Details
GUID-based lookup requires read access to the item. A workspace GUID is used
directly without requesting workspace details, so directly shared items do
not require a workspace role. Name lookup requires permission to list the
relevant workspaces or items. To reuse workspace-specific endpoints, pass a
discovered workspace object; alternatively, supply api_base explicitly.
Workload-specific enrichment additionally requires
Item.Read.All/Item.ReadWrite.All or the applicable workload-specific read
scope and access to the item. Microsoft currently limits User Data Function
detail retrieval to delegated user identities, so its automatic default is
lightweight. Set detail = TRUE explicitly when using a supported identity
Examples
if (FALSE) { # \dontrun{
# Discover a workspace and obtain a lightweight Warehouse object
workspace <- fabric_workspaces()[[1L]]
warehouses <- workspace$items(type = "Warehouse")
# Enrich that discovered object with connection details
warehouse <- fabric_item(workspace, warehouses[[1L]])
# `$sql_connection_info()` calls fabric_sql_connection_info()
warehouse$sql_connection_info()
} # }