admin Package
Admin API module for Microsoft Fabric.
This module provides functions to interact with Microsoft Fabric Admin APIs for managing workspaces, users, and other administrative tasks.
Functions
add_user_to_workspace
Grant user permissions to the specified workspace.
add_user_to_workspace(user: str | UUID, role: str = 'Member', principal_type: str = 'User', workspace: str | UUID | None = None, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
user
Required
|
The user identifier or email address. For service principals and groups, use the identifier (ID). |
|
role
|
The role to assign to the user. Options: 'Admin', 'Contributor', 'Member', 'None', 'Viewer'. Default value: Member
|
|
principal_type
|
The principal type of the user. Options: 'App', 'Group', 'None', 'User'. Default value: User
|
|
workspace
|
The Fabric workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook. Default value: None
|
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If an invalid role or principal type is provided. |
|
|
If the workspace cannot be found. |
assign_domain_workspaces
Assign workspaces to a domain.
This function assigns one or more workspaces to the specified domain. Requires admin permissions to assign domain workspaces.
assign_domain_workspaces(domain: str | UUID, workspaces: str | UUID | List[str | UUID], verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
domain
Required
|
The domain name or ID. |
|
workspaces
Required
|
The workspace name(s) or ID(s) to assign to the domain. |
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If the domain cannot be found. |
|
|
If any of the specified workspaces are not found. |
assign_domain_workspaces_by_capacities
Assign all workspaces from specified capacities to a domain.
This function assigns all workspaces that reside on the specified capacities to the specified domain. Requires admin permissions.
assign_domain_workspaces_by_capacities(domain: str | UUID, capacities: str | UUID | List[str | UUID], lro_config: LroConfig | None = None, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
domain
Required
|
The domain name or ID. |
|
capacities
Required
|
The capacity name(s) or ID(s) whose workspaces should be assigned. |
|
lro_config
|
<xref:sempy.fabric.admin.LroConfig>
Options to control long-running operation polling. See LroConfig for available keys and defaults. Default value: None
|
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If the domain cannot be found. |
|
|
If any of the specified capacities are not found. |
assign_workspaces_to_capacity
Assign workspaces to a capacity.
assign_workspaces_to_capacity(target_capacity: str | UUID, workspace: str | UUID | List[str | UUID] | None = None, source_capacity: str | UUID | None = None, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
target_capacity
Required
|
The name or ID of the target capacity. |
|
workspace
|
The name(s) or ID(s) of the workspace(s) to assign. If None, all workspaces from source_capacity will be assigned. Default value: None
|
|
source_capacity
|
The name or ID of the source capacity. Required if workspace is None. Default value: None
|
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If neither workspace nor source_capacity is provided, |
|
|
If some of the specified workspaces are not found. |
|
|
If the target or source capacity cannot be found. |
bulk_remove_labels
Remove sensitivity labels from Fabric items (Admin API).
bulk_remove_labels(items: List[Dict[str, str | UUID]], credential: TokenCredential | None = None, verbose: int = 0) -> None
Parameters
| Name | Description |
|---|---|
|
items
Required
|
A list of dictionaries containing item details. Each dictionary must have
an Example:
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
|
verbose
|
If greater than 0, print status messages. Default value: 0
|
bulk_set_labels
Set sensitivity labels on Fabric items (Admin API).
bulk_set_labels(items: List[Dict[str, str | UUID]], label_id: str | UUID, assignment_method: Literal['Standard', 'Priviledged'] = 'Standard', delegated_principal: Dict[str, Any] | None = None, credential: TokenCredential | None = None, verbose: int = 0) -> None
Parameters
| Name | Description |
|---|---|
|
items
Required
|
A list of dictionaries containing item details. Each dictionary must have
an Example:
|
|
label_id
Required
|
The sensitivity label ID. Must be in the user's label policy. |
|
assignment_method
|
<xref:Literal>[<xref:
”Standard”, "Priviledged"]
Specifies whether the assigned label was set by a standard or privileged process. Default value: Standard
|
|
delegated_principal
|
The service principal object used for delegated operations.
When provided, it is included in the request payload as Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
|
verbose
|
If greater than 0, print status messages. Default value: 0
|
Exceptions
| Type | Description |
|---|---|
|
If assignment_method is not "Standard" or "Priviledged". |
create_domain
Create a new domain.
This function creates a new domain in the tenant. Requires admin permissions to create domains.
create_domain(domain_name: str, description: str | None = None, parent_domain: str | UUID | None = None, verbose: int = 0, credential: TokenCredential | None = None) -> str
Parameters
| Name | Description |
|---|---|
|
domain_name
Required
|
The domain name. |
|
description
|
The domain description. Default value: None
|
|
parent_domain
|
The parent domain name or ID. If specified, creates a subdomain. Default value: None
|
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The ID of the created domain. |
Exceptions
| Type | Description |
|---|---|
|
If the parent domain cannot be found. |
create_tags
Create one or more new tags (Admin API).
Each tag name must be 40 characters or less. Tags that already exist are skipped.
create_tags(tags: str | List[str], verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
tags
Required
|
The name of the tag or tags to create. |
|
verbose
|
If greater than 0, print status messages. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If any tag name exceeds 40 characters. |
delete_capacity_tenant_setting_override
Delete a tenant setting override for a capacity.
This function removes the specified tenant setting override from the given capacity. Requires admin permissions.
delete_capacity_tenant_setting_override(capacity: str | UUID, tenant_setting: str, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
capacity
Required
|
The capacity name or ID. |
|
tenant_setting
Required
|
The tenant setting name (identifier).
Example: |
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If the capacity cannot be found. |
|
|
If the API request fails. |
delete_domain
Delete a domain.
This function deletes an existing domain from the tenant. Requires admin permissions to delete domains.
delete_domain(domain: str | UUID, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
domain
Required
|
The domain name or ID. |
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If the domain cannot be found. |
delete_tag
Delete a tag (Admin API).
delete_tag(tag: str | UUID, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
tag
Required
|
The name or ID of the tag to delete. |
|
verbose
|
If greater than 0, print status messages. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If the tag cannot be found. |
delete_user_from_workspace
Remove user permissions from the specified workspace.
delete_user_from_workspace(user: str | UUID, workspace: str | UUID | None = None, is_group: bool | None = None, profile_id: str | None = None, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
user
Required
|
The user identifier or email address. For service principals and groups, use the identifier (ID). |
|
workspace
|
The Fabric workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook. Default value: None
|
|
is_group
|
Whether the user being deleted is a group. This parameter is required when deleting a group. Default value: None
|
|
profile_id
|
The service principal profile ID to delete. Default value: None
|
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If the workspace cannot be found. |
export_dataflow
Export a dataflow definition as JSON (Admin API).
Returns the JSON definition of the specified dataflow.
export_dataflow(dataflow: str | UUID, workspace: str | UUID | None = None, credential: TokenCredential | None = None) -> dict
Parameters
| Name | Description |
|---|---|
|
dataflow
Required
|
The dataflow name or ID. |
|
workspace
|
The Fabric workspace name or ID. Only used when resolving a dataflow by name. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The exported dataflow definition as a JSON dictionary. |
get_capacity_assignment_status
Get the status of the assignment-to-capacity operation for the specified workspace.
get_capacity_assignment_status(workspace: str | UUID | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
workspace
|
The workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
get_capacity_state
Get the state of a capacity.
get_capacity_state(capacity: str | UUID | None = None, credential: TokenCredential | None = None) -> str
Parameters
| Name | Description |
|---|---|
|
capacity
|
The capacity name or ID. Defaults to None which resolves to the capacity of the attached lakehouse or if no lakehouse attached, resolves to the capacity of the current workspace. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The capacity state. |
Exceptions
| Type | Description |
|---|---|
|
If the capacity cannot be found. |
get_item
Get a specific Fabric or Power BI item in the tenant (Admin API).
This function returns details of a specific item by name or ID. Requires admin permissions to access item information.
get_item(item: str | UUID, item_type: str | None = None, workspace: str | UUID | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
item
Required
|
The item name or ID. |
|
item_type
|
The type of item (e.g., "SemanticModel", "Report", "Lakehouse"). Helps narrow down the search when multiple items have the same name. See Item Types. Default value: None
|
|
workspace
|
The workspace name or ID containing the item. Required when item is specified by name. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with a single row containing the following columns:
|
Exceptions
| Type | Description |
|---|---|
|
If item is specified by name but workspace is not provided. If multiple items match the criteria. |
|
|
If the item cannot be found. |
get_refreshables
Get a list of refreshables for the organization within a capacity.
Power BI retains a seven-day refresh history for each dataset, up to a maximum of sixty refreshes.
get_refreshables(top: int | None = None, expand: str | None = None, filter: str | None = None, skip: int | None = None, capacity: str | UUID | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
top
|
Returns only the first n results. Default value: None
|
|
expand
|
Accepts a comma-separated list of data types, which will be expanded inline in the response. Supports 'capacities' and 'groups'. Default value: None
|
|
filter
|
Returns a subset of results based on OData filter query parameter condition. Default value: None
|
|
skip
|
Skips the first n results. Use with top to fetch results beyond the first 1000. Default value: None
|
|
capacity
|
The capacity name or ID. If None, returns refreshables for all capacities. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with information about refreshables including workspace, item, capacity, refresh statistics, schedule details, and last refresh information. |
Exceptions
| Type | Description |
|---|---|
|
If the specified capacity cannot be found. |
list_access_entities
List permission details for Fabric and Power BI items a user can access.
Returns a list of permission details for Fabric and Power BI items that the specified user can access.
list_access_entities(user_email_address: str, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
user_email_address
Required
|
The user's email address. |
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_activity_events
List audit activity events for a tenant.
Returns a list of audit activity events for a tenant within a specified time window. The start and end times must be within the same UTC day.
list_activity_events(start_time: str, end_time: str, activity: str | None = None, user_id: str | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
start_time
Required
|
Start date and time of the window for audit event results. Must be in ISO 8601 compliant UTC format. Example: "2024-09-25T07:55:00". |
|
end_time
Required
|
End date and time of the window for audit event results. Must be in ISO 8601 compliant UTC format. Example: "2024-09-25T08:55:00". |
|
activity
|
Filter value for activities. Example: 'ViewReport'. Default value: None
|
|
user_id
|
Email address of the user to filter events for. Example: "<xref:mailto:john@contoso.com>". Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
Exceptions
| Type | Description |
|---|---|
|
If start_time and end_time are not within the same UTC day. |
list_app_users
List users that have access to the specified app (Admin API).
Returns a list of users (including groups and service principals) that have access to the specified app along with their access rights.
list_app_users(app: str | UUID, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
app
Required
|
The app name or ID. |
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_apps
List apps in the organization (Admin API).
Returns a list of apps across the tenant with admin-level visibility.
list_apps(top: int | None = 1000, skip: int | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
top
|
Returns only the first n results. Default value: 1000
|
|
skip
|
Skips the first n results. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_capacities
List capacities for the organization (Admin API).
This is the admin version of list_capacities that returns all capacities in the tenant that the admin has access to.
list_capacities(capacity: str | UUID | None = None, include_tenant_key: bool = False, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
capacity
|
Filter to return the capacity with the specific name or ID. Default value: None
|
|
include_tenant_key
|
If True, obtains the tenant key properties. Default value: False
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_capacity_tenant_settings_overrides
List tenant setting overrides for capacities.
This function returns a list of tenant setting overrides at the capacity level. If a capacity is specified, returns overrides for that specific capacity. Otherwise, returns overrides for all capacities. Requires admin permissions.
Note
This function wraps the Fabric REST API
Tenants - List Capacities Tenant Settings Overrides
and
Tenants - List Capacity Tenant Settings Overrides By Capacity Id.
list_capacity_tenant_settings_overrides(capacity: str | UUID | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
capacity
|
The capacity name or ID. If None, returns overrides for all capacities. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
Exceptions
| Type | Description |
|---|---|
|
If the capacity cannot be found. |
list_capacity_users
List users that have access to the specified capacity.
list_capacity_users(capacity: str | UUID | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
capacity
|
The capacity name or ID. Defaults to None which resolves to the capacity of the attached lakehouse or if no lakehouse attached, resolves to the capacity of the current workspace. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
Exceptions
| Type | Description |
|---|---|
|
If the capacity cannot be found. |
list_dataset_users
List users that have access to the specified dataset (Admin API).
Returns a list of users (including groups and service principals) that have access to the specified dataset along with their access rights.
list_dataset_users(dataset: str | UUID, workspace: str | UUID | None = None, query: str | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
dataset
Required
|
The dataset name or ID. |
|
workspace
|
Filter datasets by workspace name or ID. Used when resolving dataset by name to narrow down matches. Default value: None
|
|
query
|
Additional OData filter query to append when resolving dataset by name.
For example, Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_datasets
List datasets for the organization (Admin API).
Returns a list of datasets across the tenant with admin-level visibility.
list_datasets(query: str | None = None, top: int | None = None, skip: int | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
query
|
Returns a subset of results based on OData filter query parameter condition. Default value: None
|
|
top
|
Returns only the first n results. Default value: None
|
|
skip
|
Skips the first n results. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_domain_tenant_settings_overrides
List tenant setting overrides for domains.
This function returns a list of tenant setting overrides at the domain level. Requires admin permissions.
list_domain_tenant_settings_overrides(credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_domain_workspaces
List workspaces within a domain (Admin API).
This function returns a list of workspaces assigned to the specified domain. Requires admin permissions to access domain information.
list_domain_workspaces(domain: str | UUID, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
domain
Required
|
The domain name or ID. |
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
Exceptions
| Type | Description |
|---|---|
|
If the domain cannot be found. |
list_domains
List domains for the organization (Admin API).
This function returns a list of domains across the tenant. Requires admin permissions to access domain information.
list_domains(domain: str | UUID | None = None, non_empty_only: bool = False, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
domain
|
Filter to return the domain with the specific name or ID. Default value: None
|
|
non_empty_only
|
When True, only return domains that have at least one workspace containing an item. Defaults to False. Default value: False
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_external_data_shares
List external data shares in the tenant (Admin API).
Returns a list of external data shares across the tenant with creator, recipient, status, and expiration information.
Note
This function wraps the Fabric REST API
Admin - External Data Shares Provider List External Data Shares.
list_external_data_shares(credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_git_connections
List Git connections across workspaces (Admin API).
Returns a list of Git connections configured on workspaces in the tenant, including organization, project, repository, branch, and directory information.
list_git_connections(credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_item_access_details
List users and their permissions for a specific item (Admin API).
This function returns a list of users (including groups and service principals) that have access to the specified item, along with their permissions.
list_item_access_details(item: str | UUID, item_type: str, workspace: str | UUID | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
item
Required
|
The item name or ID. |
|
item_type
Required
|
The type of item (e.g., "SemanticModel", "Report", "Lakehouse"). See Item Types. |
|
workspace
|
The workspace name or ID containing the item. Required when item is specified by name. If None, searches across all workspaces (only valid when item is a UUID). Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
Exceptions
| Type | Description |
|---|---|
|
If item is specified by name but workspace is not provided. |
|
|
If the item cannot be found. |
|
|
If the API request fails. |
list_items
List all Fabric and Power BI items in the tenant (Admin API).
This function returns a list of active Fabric and Power BI items across the tenant. Requires admin permissions to access item information.
list_items(capacity: str | UUID | None = None, workspace: str | UUID | None = None, state: str | None = None, item: str | UUID | None = None, item_type: str | None = None, top_n: int | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
capacity
|
Filter items by capacity name or ID. Default value: None
|
|
workspace
|
Filter items by workspace name or ID. Defaults to None which lists items across all workspaces. Default value: None
|
|
state
|
Filter items by state (e.g., "Active"). See Item States. Default value: None
|
|
item
|
Filter items by item name or ID. If specified, only items matching this name or ID are returned. Default value: None
|
|
item_type
|
Filter items by type (e.g., "SemanticModel", "Report", "Lakehouse"). See Item Types. Default value: None
|
|
top_n
|
Limit the number of items returned to the top N items. If None, all matching items are returned. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_modified_workspaces
Get a list of workspace IDs that have been modified in the organization.
list_modified_workspaces(modified_since: str | None = None, exclude_inactive_workspaces: bool = False, exclude_personal_workspaces: bool = False, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
modified_since
|
Last modified date (must be in ISO compliant UTC format). Example: "2024-11-02T05:51:30" or "2024-11-02T05:51:30.0000000Z". Default value: None
|
|
exclude_inactive_workspaces
|
Whether to exclude inactive workspaces. Default value: False
|
|
exclude_personal_workspaces
|
Whether to exclude personal workspaces. Default value: False
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following column:
|
list_orphaned_workspaces
List orphaned workspaces (those with no users or no admins).
list_orphaned_workspaces(top: int = 100, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
top
|
The maximum number of results to return. Default value: 100
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_report_subscriptions
List subscriptions for the specified report (Admin API).
Returns a list of report subscriptions along with subscriber details. This is a preview API call.
list_report_subscriptions(report: str | UUID, workspace: str | UUID | None = None, query: str | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
report
Required
|
The report name or ID. |
|
workspace
|
Filter reports by workspace name or ID. Used when resolving report by name to narrow down matches. Default value: None
|
|
query
|
Additional OData filter query to append when resolving report by name.
For example, Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_report_users
List users that have access to the specified report (Admin API).
Returns a list of users (including groups and service principals) that have access to the specified report along with their access rights.
list_report_users(report: str | UUID, workspace: str | UUID | None = None, query: str | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
report
Required
|
The report name or ID. |
|
workspace
|
Filter reports by workspace name or ID. Used when resolving report by name to narrow down matches. Default value: None
|
|
query
|
Additional OData filter query to append when resolving report by name.
For example, Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_reports
List reports for the organization (Admin API).
Returns a list of reports across the tenant with admin-level visibility.
list_reports(top: int | None = None, skip: int | None = None, query: str | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
top
|
Returns only the first n results. Default value: None
|
|
skip
|
Skips the first n results. Default value: None
|
|
query
|
Returns a subset of results based on OData filter query parameter condition. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_tags
List all tags in the tenant (Admin API).
Returns a list of all tags available in the tenant.
list_tags(credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_tenant_keys
List encryption keys for the tenant (Admin API).
Returns the encryption keys configured for the Power BI tenant.
list_tenant_keys(credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_tenant_settings
List all tenant settings for the organization.
This function returns a list of all tenant settings in the organization. Requires admin permissions.
list_tenant_settings(credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_unused_artifacts
List unused artifacts in a workspace (Admin API).
Returns a list of datasets, reports, and dashboards that have not been used within 30 days for the specified workspace.
list_unused_artifacts(workspace: str | UUID | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
workspace
|
The Fabric workspace name or ID. Defaults to the current workspace. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_user_subscriptions
List subscriptions for the specified user (preview API).
Returns a list of subscriptions for the specified user. This is a preview API.
list_user_subscriptions(user: str | UUID, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
user
Required
|
The graph ID or user principal name (UPN) of the user. |
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_widely_shared_artifacts
List widely shared artifacts (Admin API).
Returns a list of Power BI artifacts that are shared with the whole organization through links or published to the web.
Note
This function wraps the Power BI REST APIs
Admin - WidelySharedArtifacts LinksSharedToWholeOrganization
and
list_widely_shared_artifacts(api_name: Literal['LinksSharedToWholeOrganization', 'PublishedToWeb'] = 'LinksSharedToWholeOrganization', credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
api_name
|
<xref:Literal>[<xref:
”LinksSharedToWholeOrganization”, "PublishedToWeb"]
The API variant to call. "LinksSharedToWholeOrganization" returns artifacts shared with the whole organization. "PublishedToWeb" returns artifacts published to the web. Default value: LinksSharedToWholeOrganization
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_workspace_access_details
List users (including groups and Service Principals) that have access to the specified workspace.
list_workspace_access_details(workspace: str | UUID | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
workspace
|
The workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
Exceptions
| Type | Description |
|---|---|
|
If the workspace cannot be found. |
list_workspace_tenant_settings_overrides
List tenant setting overrides for workspaces.
This function returns a list of tenant setting overrides at the workspace level. Requires admin permissions.
-[ Notes ]-
In order to retrieve workspace delegation settings, you must enable the workspace's delegated OneLake settings. Navigate to the workspace -> Workspace Settings -> Delegated Settings -> OneLake settings -> Set to 'On'.
list_workspace_tenant_settings_overrides(credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
list_workspace_users
List users that have access to the specified workspace.
list_workspace_users(workspace: str | UUID | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
workspace
|
The workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
Exceptions
| Type | Description |
|---|---|
|
If the workspace cannot be found. |
list_workspaces
List workspaces for the organization (Admin API).
This is the admin version of list_workspaces that returns all workspaces in the tenant that the admin has access to.
list_workspaces(capacity: str | UUID | None = None, workspace: str | UUID | None = None, workspace_state: str | None = None, workspace_type: str | None = None, credential: TokenCredential | None = None) -> DataFrame
Parameters
| Name | Description |
|---|---|
|
capacity
|
Filter to return only workspaces in the specified capacity. Default value: None
|
|
workspace
|
Filter to return the workspace with the specific name or ID. Default value: None
|
|
workspace_state
|
Filter to return only workspaces with the specified state (e.g. "Active", "Deleted"). See Workspace States. Default value: None
|
|
workspace_type
|
Filter to return only workspaces of the specified type (e.g. "Personal", "Workspace", "AdminWorkspace"). See Workspace Types. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A DataFrame with the following columns:
|
patch_capacity
Change specific capacity information.
Currently, this API call only supports changing the capacity's encryption key.
patch_capacity(capacity: str | UUID, tenant_key_id: str | UUID, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
capacity
Required
|
The capacity name or ID. |
|
tenant_key_id
Required
|
The ID of the encryption key. |
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If the capacity cannot be found. |
remove_all_sharing_links
Delete all organization sharing links for all Fabric items in the tenant (Admin API).
This action cannot be undone.
remove_all_sharing_links(sharing_link_type: str = 'OrgLink', lro_config: LroConfig | None = None, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
sharing_link_type
|
Specifies the type of sharing link to delete. Additional sharing link types may be added over time. See SharingLinkType for all available types. Default value: OrgLink
|
|
lro_config
|
<xref:sempy.fabric.admin.LroConfig>
Options to control long-running operation polling. See LroConfig for available keys and defaults. Default value: None
|
|
verbose
|
If greater than 0, print status messages. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
remove_sharing_links
Delete organization sharing links for the specified Fabric items (Admin API).
This action cannot be undone.
remove_sharing_links(items: List[Dict[str, str | UUID]], sharing_link_type: str = 'OrgLink', lro_config: LroConfig | None = None, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
items
Required
|
A list of dictionaries, each representing an item. The Example:
|
|
sharing_link_type
|
Specifies the type of sharing link to delete. See SharingLinkType for all available types. Default value: OrgLink
|
|
lro_config
|
<xref:sempy.fabric.admin.LroConfig>
Options to control long-running operation polling. See LroConfig for available keys and defaults. Default value: None
|
|
verbose
|
If greater than 0, print status messages. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
resolve_capacity_id
Resolve a capacity name or ID to its capacity ID.
This function uses admin APIs to resolve capacity information, which can access any capacity in the tenant.
resolve_capacity_id(capacity: str | UUID | None = None, credential: TokenCredential | None = None) -> str
Parameters
| Name | Description |
|---|---|
|
capacity
|
The capacity name or ID. Defaults to None which resolves to the capacity of the attached lakehouse or if no lakehouse attached, resolves to the capacity of the current workspace. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The capacity ID. |
Exceptions
| Type | Description |
|---|---|
|
If the capacity cannot be found. |
resolve_capacity_name
Resolve a capacity name or ID to its capacity name.
This function uses admin APIs to resolve capacity information, which can access any capacity in the tenant.
resolve_capacity_name(capacity: str | UUID | None = None, credential: TokenCredential | None = None) -> str
Parameters
| Name | Description |
|---|---|
|
capacity
|
The capacity name or ID. Defaults to None which resolves to the capacity of the attached lakehouse or if no lakehouse attached, resolves to the capacity of the current workspace. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The capacity name. |
Exceptions
| Type | Description |
|---|---|
|
If the capacity cannot be found. |
resolve_dataset_id
Resolve a dataset name or ID to its dataset ID (Admin API).
This function uses admin APIs to resolve dataset information, which can access any dataset in the tenant.
resolve_dataset_id(dataset: str | UUID, workspace: str | UUID | None = None, query: str | None = None, credential: TokenCredential | None = None) -> str
Parameters
| Name | Description |
|---|---|
|
dataset
Required
|
The dataset name or ID. |
|
workspace
|
Filter datasets by workspace name or ID. Default value: None
|
|
query
|
Additional OData filter query to append. For example,
Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The dataset ID. |
Exceptions
| Type | Description |
|---|---|
|
If the dataset cannot be found. |
resolve_dataset_name
Resolve a dataset ID to its dataset name (Admin API).
This function uses admin APIs to resolve dataset information, which can access any dataset in the tenant.
resolve_dataset_name(dataset: str | UUID, workspace: str | UUID | None = None, query: str | None = None, credential: TokenCredential | None = None) -> str
Parameters
| Name | Description |
|---|---|
|
dataset
Required
|
The dataset name or ID. |
|
workspace
|
Filter datasets by workspace name or ID. Default value: None
|
|
query
|
Additional OData filter query to append. For example,
Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The dataset name. |
Exceptions
| Type | Description |
|---|---|
|
If the dataset cannot be found. |
resolve_domain_id
Resolve a domain name or ID to its domain ID.
This function uses admin APIs to resolve domain information, which can access any domain in the tenant.
resolve_domain_id(domain: str | UUID, credential: TokenCredential | None = None) -> str
Parameters
| Name | Description |
|---|---|
|
domain
Required
|
The domain name or ID. |
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The domain ID. |
Exceptions
| Type | Description |
|---|---|
|
If the domain cannot be found. |
resolve_domain_name
Resolve a domain name or ID to its domain name.
This function uses admin APIs to resolve domain information, which can access any domain in the tenant.
resolve_domain_name(domain: str | UUID, credential: TokenCredential | None = None) -> str
Parameters
| Name | Description |
|---|---|
|
domain
Required
|
The domain name or ID. |
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The domain name. |
Exceptions
| Type | Description |
|---|---|
|
If the domain cannot be found. |
resolve_item_id
Resolve an item name or ID to its item ID (Admin API).
This function uses admin APIs to resolve item information, which can access any item in the tenant.
resolve_item_id(item: str | UUID, item_type: str | None = None, workspace: str | UUID | None = None, credential: TokenCredential | None = None) -> str
Parameters
| Name | Description |
|---|---|
|
item
Required
|
The item name or ID. |
|
item_type
|
The type of item (e.g., "SemanticModel", "Report", "Lakehouse"). Required when item is specified by name to narrow down the search. Default value: None
|
|
workspace
|
The workspace name or ID containing the item. Helps narrow down the search when multiple items have the same name. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The item ID. |
Exceptions
| Type | Description |
|---|---|
|
If multiple items match the criteria and more specific parameters are needed. |
|
|
If the item cannot be found. |
resolve_item_name
Resolve an item ID to its item name (Admin API).
This function uses admin APIs to resolve item information, which can access any item in the tenant.
resolve_item_name(item: str | UUID, item_type: str | None = None, workspace: str | UUID | None = None, credential: TokenCredential | None = None) -> str
Parameters
| Name | Description |
|---|---|
|
item
Required
|
The item name or ID. |
|
item_type
|
The type of item (e.g., "SemanticModel", "Report", "Lakehouse"). Required when item is specified by name to narrow down the search. Default value: None
|
|
workspace
|
The workspace name or ID containing the item. Helps narrow down the search when multiple items have the same name. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The item name. |
Exceptions
| Type | Description |
|---|---|
|
If multiple items match the criteria and more specific parameters are needed. |
|
|
If the item cannot be found. |
resolve_report_id
Resolve a report name or ID to its report ID (Admin API).
This function uses admin APIs to resolve report information, which can access any report in the tenant.
resolve_report_id(report: str | UUID, workspace: str | UUID | None = None, query: str | None = None, credential: TokenCredential | None = None) -> str
Parameters
| Name | Description |
|---|---|
|
report
Required
|
The report name or ID. |
|
workspace
|
Filter reports by workspace name or ID. Default value: None
|
|
query
|
Additional OData filter query to append. For example,
Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The report ID. |
Exceptions
| Type | Description |
|---|---|
|
If the report cannot be found. |
resolve_report_name
Resolve a report ID to its report name (Admin API).
This function uses admin APIs to resolve report information, which can access any report in the tenant.
resolve_report_name(report: str | UUID, workspace: str | UUID | None = None, query: str | None = None, credential: TokenCredential | None = None) -> str
Parameters
| Name | Description |
|---|---|
|
report
Required
|
The report name or ID. |
|
workspace
|
Filter reports by workspace name or ID. Default value: None
|
|
query
|
Additional OData filter query to append. For example,
Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The report name. |
Exceptions
| Type | Description |
|---|---|
|
If the report cannot be found. |
resolve_workspace_id
Resolve a workspace name or ID to its workspace ID.
This function uses admin APIs to resolve workspace information, which can access any workspace in the tenant.
resolve_workspace_id(workspace: str | UUID | None = None, capacity: str | UUID | None = None, credential: TokenCredential | None = None) -> str
Parameters
| Name | Description |
|---|---|
|
workspace
|
The workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook. Default value: None
|
|
capacity
|
The capacity name or ID to resolve the workspace against. Defaults to None which resolves across all capacities. Should only be set when workspace is not None. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The workspace ID. |
Exceptions
| Type | Description |
|---|---|
|
If capacity is provided but workspace is None. |
|
|
If the workspace cannot be found. |
resolve_workspace_name
Resolve a workspace name or ID to its workspace name.
This function uses admin APIs to resolve workspace information, which can access any workspace in the tenant.
resolve_workspace_name(workspace: str | UUID | None = None, capacity: str | UUID | None = None, credential: TokenCredential | None = None) -> str
Parameters
| Name | Description |
|---|---|
|
workspace
|
The workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook. Default value: None
|
|
capacity
|
The capacity name or ID to resolve the workspace against. Defaults to None which resolves across all capacities. Should only be set when workspace is not None. Default value: None
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The workspace name. |
Exceptions
| Type | Description |
|---|---|
|
If capacity is provided but workspace is None. |
|
|
If the workspace cannot be found. |
restore_deleted_workspace
Restore a deleted workspace.
restore_deleted_workspace(workspace_id: str | UUID, name: str, email_address: str, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
workspace_id
Required
|
The ID of the workspace to restore. |
|
name
Required
|
The name to assign to the restored workspace. |
|
email_address
Required
|
The email address of the owner of the workspace to be restored. |
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
revoke_external_data_share
Revoke an external data share (Admin API).
Revokes the specified external data share. This action cannot be undone.
Note
This function wraps the Fabric REST API
Admin - External Data Shares Provider Revoke External Data Share.
revoke_external_data_share(external_data_share_id: str | UUID, item_id: str | UUID, workspace: str | UUID, credential: TokenCredential | None = None, verbose: int = 0) -> None
Parameters
| Name | Description |
|---|---|
|
external_data_share_id
Required
|
The external data share ID. |
|
item_id
Required
|
The item ID. |
|
workspace
Required
|
The Fabric workspace name or ID. |
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
|
verbose
|
If greater than 0, print status messages. Default value: 0
|
rotate_tenant_key
Rotate an encryption key for Power BI workspaces assigned to a capacity (Admin API).
rotate_tenant_key(tenant_key_id: str | UUID, key_vault_key_identifier: str, credential: TokenCredential | None = None, verbose: int = 0) -> None
Parameters
| Name | Description |
|---|---|
|
tenant_key_id
Required
|
The tenant key ID. |
|
key_vault_key_identifier
Required
|
The URI that uniquely specifies the encryption key in Azure Key Vault. |
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
|
verbose
|
If greater than 0, print status messages. Default value: 0
|
scan_workspaces
Scan one or more workspaces and return metadata scan results.
This function initiates a workspace scan, polls for completion, and returns the scan results. It wraps three Power BI REST APIs in a single call.
Note
This function wraps the following Power BI REST APIs:
Admin - WorkspaceInfo PostWorkspaceInfo
scan_workspaces(data_source_details: bool = False, dataset_schema: bool = False, dataset_expressions: bool = False, lineage: bool = False, artifact_users: bool = False, workspace: str | List[str] | UUID | List[UUID] | None = None, return_dataframe: bool = True, retry_after_seconds: float = 1.0, timeout_seconds: float = 120.0, backoff_factor: float = 2.0, credential: TokenCredential | None = None) -> DataFrame | dict
Parameters
| Name | Description |
|---|---|
|
data_source_details
|
Whether to return data source details. Requires metadata scanning to be fully enabled in the tenant. Default value: False
|
|
dataset_schema
|
Whether to return dataset schema (tables, columns and measures). Requires metadata scanning to be fully enabled in the tenant. Default value: False
|
|
dataset_expressions
|
Whether to return dataset expressions (DAX and Mashup queries). Requires metadata scanning to be fully enabled in the tenant. Default value: False
|
|
lineage
|
Whether to return lineage info (upstream dataflows, tiles, data source IDs). Default value: False
|
|
artifact_users
|
Whether to return user details for Power BI items (such as reports or dashboards). Default value: False
|
|
workspace
|
The workspace name(s) or ID(s) to scan. Supports up to 100 workspaces. Only IDs in GUID format are sent to the API; names are resolved to IDs. If None, scans the default workspace from the environment context. Default value: None
|
|
return_dataframe
|
If True, returns a pandas DataFrame with primitive fields as columns and object fields (reports, dashboards, datasets, etc.) as dict columns. If False, returns the raw JSON dict from the API. Default value: True
|
|
retry_after_seconds
|
Initial polling interval in seconds between status checks.
Subsequent intervals will be multiplied by Default value: 1.0
|
|
timeout_seconds
|
Maximum total wait time in seconds for the scan to complete. Default value: 120.0
|
|
backoff_factor
|
Multiplier applied to the polling interval after each status check. Set to 1.0 for constant polling, >1.0 for exponential backoff. Default value: 2.0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Returns
| Type | Description |
|---|---|
|
If If |
Exceptions
| Type | Description |
|---|---|
|
If more than 100 workspaces are provided. |
|
|
If the scan does not complete within |
|
|
If the scan initiation, status check, or result retrieval fails. |
sync_role_assignments_to_subdomains
Sync role assignments from a domain to its subdomains.
This function synchronizes the role assignments from the specified domain to all of its subdomains. Requires admin permissions.
sync_role_assignments_to_subdomains(domain: str | UUID, role: Literal['Admin', 'Contributor'], verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
domain
Required
|
The domain name or ID. |
|
role
Required
|
The role to sync. Valid values: 'Admin', 'Contributor'. |
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If an invalid role is specified. |
|
|
If the domain cannot be found. |
unassign_all_domain_workspaces
Unassign all workspaces from a domain.
This function unassigns all workspaces from the specified domain. Requires admin permissions to unassign domain workspaces.
unassign_all_domain_workspaces(domain: str | UUID, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
domain
Required
|
The domain name or ID. |
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If the domain cannot be found. |
unassign_domain_workspaces
Unassign workspaces from a domain.
This function unassigns one or more workspaces from the specified domain. Requires admin permissions to unassign domain workspaces.
unassign_domain_workspaces(domain: str | UUID, workspaces: str | UUID | List[str | UUID], verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
domain
Required
|
The domain name or ID. |
|
workspaces
Required
|
The workspace name(s) or ID(s) to unassign from the domain. |
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If the domain cannot be found. |
|
|
If any of the specified workspaces are not found. |
unassign_workspaces_from_capacity
Unassign workspaces from their capacity.
unassign_workspaces_from_capacity(workspaces: str | UUID | List[str | UUID], verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
workspaces
Required
|
The workspace name(s) or ID(s) to unassign. |
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If some of the specified workspaces are not found. |
update_capacity_tenant_setting_override
Update a tenant setting override for a capacity.
This function updates the specified tenant setting override for the given capacity. Requires admin permissions.
update_capacity_tenant_setting_override(capacity: str | UUID, tenant_setting: str, enabled: bool, delegate_to_workspace: bool | None = None, enabled_security_groups: List[Dict[str, str]] | None = None, excluded_security_groups: List[Dict[str, str]] | None = None, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
capacity
Required
|
The capacity name or ID. |
|
tenant_setting
Required
|
The tenant setting name (identifier).
Example: |
|
enabled
Required
|
The status of the tenant setting. False - Disabled, True - Enabled. |
|
delegate_to_workspace
|
Indicates whether the tenant setting can be delegated to a workspace admin. False - Workspace admin cannot override. True - Workspace admin can override. Default value: None
|
|
enabled_security_groups
|
A list of enabled security groups. Each dict should contain 'graphId' and 'name'.
Example: Default value: None
|
|
excluded_security_groups
|
A list of excluded security groups. Each dict should contain 'graphId' and 'name'.
Example: Default value: None
|
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If the capacity cannot be found. |
|
|
If the API request fails. |
update_domain
Update a domain's properties.
This function updates the properties of an existing domain. Requires admin permissions to update domains.
update_domain(domain: str | UUID, description: str | None = None, contributors_scope: Literal['AdminsOnly', 'AllTenant', 'SpecificUsersAndGroups'] | None = None, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
domain
Required
|
The domain name or ID. |
|
description
|
The new domain description. Default value: None
|
|
contributors_scope
|
The domain contributor scope. Valid values: 'AdminsOnly', 'AllTenant', 'SpecificUsersAndGroups'. Default value: None
|
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If an invalid contributors_scope is specified. |
|
|
If the domain cannot be found. |
update_tag
Update the name of a tag (Admin API).
update_tag(name: str, tag: str | UUID, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The new name of the tag. |
|
tag
Required
|
The current name or ID of the tag to update. |
|
verbose
|
If greater than 0, print status messages. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If the tag cannot be found. |
update_tenant_setting
Update a tenant setting.
This function updates the specified tenant setting. Requires admin permissions.
update_tenant_setting(tenant_setting: str, enabled: bool, delegate_to_capacity: bool | None = None, delegate_to_domain: bool | None = None, delegate_to_workspace: bool | None = None, enabled_security_groups: List[Dict[str, str]] | None = None, excluded_security_groups: List[Dict[str, str]] | None = None, properties: List[Dict[str, str]] | None = None, verbose: int = 0, credential: TokenCredential | None = None) -> None
Parameters
| Name | Description |
|---|---|
|
tenant_setting
Required
|
The tenant setting name (identifier).
Example: |
|
enabled
Required
|
The status of the tenant setting. False - Disabled, True - Enabled. |
|
delegate_to_capacity
|
Indicates whether the tenant setting can be delegated to a capacity admin. False - Capacity admin cannot override. True - Capacity admin can override. Default value: None
|
|
delegate_to_domain
|
Indicates whether the tenant setting can be delegated to a domain admin. False - Domain admin cannot override. True - Domain admin can override. Default value: None
|
|
delegate_to_workspace
|
Indicates whether the tenant setting can be delegated to a workspace admin. False - Workspace admin cannot override. True - Workspace admin can override. Default value: None
|
|
enabled_security_groups
|
A list of enabled security groups. Each dict should contain 'graphId' and 'name'.
Example: Default value: None
|
|
excluded_security_groups
|
A list of excluded security groups. Each dict should contain 'graphId' and 'name'.
Example: Default value: None
|
|
properties
|
Tenant setting properties. Each dict should contain 'name', 'value', and 'type'.
Example: Default value: None
|
|
verbose
|
If greater than 0, prints informational messages during execution. Default value: 0
|
|
credential
|
<xref:sempy.fabric.admin.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used. Default value: None
|
Exceptions
| Type | Description |
|---|---|
|
If the API request fails. |