sempy_labs.admin package

Module contents

sempy_labs.admin.assign_domain_workspaces(domain_name: str, workspace_names: str | List[str])

Assigns workspaces to the specified domain by workspace.

Parameters:
  • domain_name (str) – The domain name.

  • workspace_names (str | List[str]) – The Fabric workspace(s).

sempy_labs.admin.assign_domain_workspaces_by_capacities(domain_name: str, capacity_names: str | List[str])

Assigns all workspaces that reside on the specified capacities to the specified domain.

Parameters:
  • domain_name (str) – The domain name.

  • capacity_names (str | List[str]) – The capacity names.

sempy_labs.admin.assign_workspaces_to_capacity(source_capacity: str, target_capacity: str, workspace: str | List[str] | None = None)

Assigns a workspace to a capacity. This function is the admin version.

Parameters:
  • source_capacity (str) – The name of the source capacity.

  • target_capacity (str) – The name of the target capacity.

  • workspace (str | List[str], default=None) – The name of the workspace(s). Defaults to None which resolves to migrating all workspaces within the source capacity to the target capacity.

sempy_labs.admin.create_domain(domain_name: str, description: str | None = None, parent_domain_name: str | None = None)

Creates a new domain.

Parameters:
  • domain_name (str) – The domain name.

  • description (str, default=None) – The domain description.

  • parent_domain_name (str, default=None) – The parent domain name.

sempy_labs.admin.delete_domain(domain_name: str)

Deletes a domain.

Parameters:

domain_name (str) – The domain name.

sempy_labs.admin.list_access_entities(user_email_address: str) DataFrame

Shows a list of permission details for Fabric and PowerBI items the specified user can access.

Parameters:

user_email_address (str) – The user’s email address.

Returns:

A pandas dataframe showing a list of permission details for Fabric and PowerBI items the specified user can access.

Return type:

pandas.DataFrame

sempy_labs.admin.list_capacities() DataFrame

Shows the a list of capacities and their properties. This function is the admin version.

Returns:

A pandas dataframe showing the capacities and their properties

Return type:

pandas.DataFrame

sempy_labs.admin.list_capacities_delegated_tenant_settings(return_dataframe: bool = True) DataFrame | dict | None

Returns list of tenant setting overrides that override at the capacities.

Parameters:

return_dataframe (bool, default=True) – If True, returns a dataframe. If False, returns a dictionary

Returns:

A pandas dataframe showing a list of tenant setting overrides that override at the capacities.

Return type:

pandas.DataFrame

sempy_labs.admin.list_datasets() DataFrame

Shows a list of datasets for the organization.

Returns:

A pandas dataframe showing a list of datasets for the organization.

Return type:

pandas.DataFrame

sempy_labs.admin.list_domain_workspaces(domain_name: str) DataFrame

Shows a list of workspaces within the domain.

Parameters:

domain_name (str) – The domain name.

Returns:

A pandas dataframe showing a list of workspaces within the domain.

Return type:

pandas.DataFrame

sempy_labs.admin.list_domains(non_empty_only: bool = False) DataFrame

Shows a list of domains.

Parameters:

non_empty_only (bool, default=False) – When True, only return domains that have at least one workspace containing an item. Defaults to False.

Returns:

A pandas dataframe showing a list of the domains.

Return type:

pandas.DataFrame

sempy_labs.admin.list_external_data_shares()

Lists external data shares in the tenant. This function is for admins.

Returns:

A pandas dataframe showing a list of external data shares in the tenant.

Return type:

pandas.DataFrame

sempy_labs.admin.list_item_access_details(item_name: str, type: str, workspace: str | None = None) DataFrame

Returns a list of users (including groups and service principals) and lists their workspace roles.

Parameters:
  • item_name (str) – Name of the Fabric item.

  • type (str) – Type of Fabric item.

  • workspace (str, default=None) – The Fabric workspace name. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

Returns:

A pandas dataframe showing a list of users (including groups and service principals) and lists their workspace roles.

Return type:

pandas.DataFrame

sempy_labs.admin.list_items(capacity_name: str | None = None, workspace: str | None = None, state: str | None = None, type: str | None = None) DataFrame

Shows a list of active Fabric and PowerBI items.

Parameters:
  • capacity_name (str, default=None) – The capacity name.

  • workspace (str, default=None) – The Fabric workspace name. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

  • state (str, default=None) – The item state.

  • type (str, default=None) – The item type.

Returns:

A pandas dataframe showing a list of active Fabric and Power BI items.

Return type:

pandas.DataFrame

sempy_labs.admin.list_tenant_settings() DataFrame

Lists all tenant settings.

Returns:

A pandas dataframe showing the tenant settings.

Return type:

pandas.DataFrame

sempy_labs.admin.list_workspace_access_details(workspace: str | UUID | None = None) DataFrame

Shows a list of users (including groups and Service Principals) that have access to the specified workspace.

Parameters:

workspace (str, default=None) – The Fabric workspace name. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

Returns:

A pandas dataframe showing a list of users (including groups and Service Principals) that have access to the specified workspace.

Return type:

pandas.DataFrame

sempy_labs.admin.list_workspaces(top: int | None = 5000, skip: int | None = None) DataFrame

Lists workspaces for the organization. This function is the admin version of list_workspaces.

Parameters:
  • top (int, default=5000) – Returns only the first n results. This parameter is mandatory and must be in the range of 1-5000.

  • skip (int, default=None) – Skips the first n results. Use with top to fetch results beyond the first 5000.

Returns:

A pandas dataframe showing a list of workspaces for the organization.

Return type:

pandas.DataFrame

sempy_labs.admin.resolve_domain_id(domain_name: str) UUID

Obtains the domain Id for a given domain name.

Parameters:

domain_name (str) – The domain name

Returns:

The domain Id.

Return type:

UUID

sempy_labs.admin.revoke_external_data_share(external_data_share_id: UUID, item_id: UUID, workspace: str)

Revokes the specified external data share. Note: This action cannot be undone.

Parameters:
  • external_data_share_id (UUID) – The external data share ID.

  • item_id (int, default=None) – The Item ID

  • workspace (str) – The Fabric workspace name.

sempy_labs.admin.unassign_all_domain_workspaces(domain_name: str)

Unassigns all workspaces from the specified domain.

Parameters:

domain_name (str) – The domain name.

sempy_labs.admin.unassign_domain_workspaces(domain_name: str, workspace_names: str | List[str])

Unassigns workspaces from the specified domain by workspace.

Parameters:
  • domain_name (str) – The domain name.

  • workspace_names (str | List[str]) – The Fabric workspace(s).

sempy_labs.admin.unassign_workspaces_from_capacity(workspaces: str | List[str])

Unassigns workspace(s) from their capacity. This function is the admin version of list_workspaces.

Parameters:

workspaces (str | List[str]) – The Fabric workspace name(s).

sempy_labs.admin.update_domain(domain_name: str, description: str | None = None, contributors_scope: str | None = None)

Updates a domain’s properties.

Parameters:
  • domain_name (str) – The domain name.

  • description (str, default=None) – The domain description.

  • contributors_scope (str, default=None) – The domain contributor scope.