Hub Class

A Hub is a special type of workspace that acts as a parent and resource container for lightweight child workspaces called projects. Resources like the hub's storage account, key vault, and container registry are shared by all child projects.

As a type of workspace, hub management is controlled by an MLClient's workspace operations.

Creating a Hub object.


   from azure.ai.ml.entities import Hub

   ws = Hub(name="sample-ws", location="eastus", description="a sample workspace hub object")

Constructor

Hub(*, name: str, description: str | None = None, tags: Dict[str, str] | None = None, display_name: str | None = None, location: str | None = None, resource_group: str | None = None, managed_network: ManagedNetwork | None = None, storage_account: str | None = None, key_vault: str | None = None, container_registry: str | None = None, customer_managed_key: CustomerManagedKey | None = None, public_network_access: str | None = None, network_acls: NetworkAcls | None = None, identity: IdentityConfiguration | None = None, primary_user_assigned_identity: str | None = None, enable_data_isolation: bool = False, default_resource_group: str | None = None, associated_workspaces: List[str] | None = None, **kwargs: Any)

Parameters

Name Description
image_build_compute
Required
str

The name of the compute target to use for building environment. Docker images with the container registry is behind a VNet.

kwargs
Required

A dictionary of additional configuration parameters.

Keyword-Only Parameters

Name Description
name
str

Name of the hub.

description
str

Description of the hub.

Default value: None
tags

Tags of the hub.

Default value: None
display_name
str

Display name for the hub. This is non-unique within the resource group.

Default value: None
location
str

The location to create the hub in. If not specified, the same location as the resource group will be used.

Default value: None
resource_group
str

Name of resource group to create the hub in.

Default value: None
managed_network

Hub's Managed Network configuration

Default value: None
storage_account
str

The resource ID of an existing storage account to use instead of creating a new one.

Default value: None
key_vault
str

The resource ID of an existing key vault to use instead of creating a new one.

Default value: None
container_registry
str

The resource ID of an existing container registry to use instead of creating a new one.

Default value: None
customer_managed_key

Key vault details for encrypting data with customer-managed keys. If not specified, Microsoft-managed keys will be used by default.

Default value: None
public_network_access
str

Whether to allow public endpoint connectivity. when a workspace is private link enabled.

Default value: None
network_acls

The network access control list (ACL) settings of the workspace.

Default value: None
identity

The hub's Managed Identity (user assigned, or system assigned).

Default value: None
primary_user_assigned_identity
str

The hub's primary user assigned identity.

Default value: None
enable_data_isolation

A flag to determine if workspace has data isolation enabled. The flag can only be set at the creation phase, it can't be updated.

Default value: False
default_resource_group
str

The resource group that will be used by projects created under this hub if no resource group is specified.

Default value: None
associated_workspaces
Default value: None

Methods

dump

Dump the workspace spec into a file in yaml format.

dump

Dump the workspace spec into a file in yaml format.

dump(dest: str | PathLike | IO, **kwargs: Any) -> None

Parameters

Name Description
dest
Required
Union[<xref:PathLike>, str, IO[AnyStr]]

The destination to receive this workspace's spec. Must be either a path to a local file, or an already-open file stream. If dest is a file path, a new file will be created, and an exception is raised if the file exists. If dest is an open file, the file will be written to directly, and an exception will be raised if the file is not writable.

Attributes

associated_workspaces

The workspaces associated with the hub.

Returns

Type Description

The resource group.

base_path

The base path of the resource.

Returns

Type Description
str

The base path of the resource.

creation_context

The creation context of the resource.

Returns

Type Description

The creation metadata for the resource.

default_resource_group

The default resource group for this hub and its children.

Returns

Type Description

The resource group.

discovery_url

Backend service base URLs for the workspace.

Returns

Type Description
str

Backend service URLs of the workspace

id

The resource ID.

Returns

Type Description

The global ID of the resource, an Azure Resource Manager (ARM) ID.

mlflow_tracking_uri

MLflow tracking uri for the workspace.

Returns

Type Description
str

Returns mlflow tracking uri of the workspace.