Workspace Class

Azure ML workspace.

Creating a Workspace object.


   from azure.ai.ml.entities import Workspace

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

Constructor

Workspace(*, 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, hbi_workspace: bool = False, storage_account: str | None = None, container_registry: str | None = None, key_vault: str | None = None, application_insights: str | None = None, customer_managed_key: CustomerManagedKey | None = None, image_build_compute: str | None = None, public_network_access: str | None = None, network_acls: NetworkAcls | None = None, identity: IdentityConfiguration | None = None, primary_user_assigned_identity: str | None = None, managed_network: ManagedNetwork | None = None, provision_network_now: bool | None = None, system_datastores_auth_mode: str | None = None, enable_data_isolation: bool = False, allow_roleassignment_on_rg: bool | None = None, hub_id: str | None = None, workspace_hub: str | None = None, serverless_compute: ServerlessComputeSettings | None = None, **kwargs: Any)

Parameters

Name Description
name
Required
str

Name of the workspace.

description
Required
str

Description of the workspace.

tags
Required

Tags of the workspace.

display_name
Required
str

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

location
Required
str

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

resource_group
Required
str

Name of resource group to create the workspace in.

hbi_workspace
Required

Whether the customer data is of high business impact (HBI), containing sensitive business information. For more information, see https://learn.microsoft.com/azure/machine-learning/concept-data-encryption#encryption-at-rest.

storage_account
Required
str

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

container_registry
Required
str

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

key_vault
Required
str

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

application_insights
Required
str

The resource ID of an existing application insights to use instead of creating a new one.

customer_managed_key
Required

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

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.

public_network_access
Required
str

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

network_acls
Required

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

identity
Required

workspace's Managed Identity (user assigned, or system assigned)

primary_user_assigned_identity
Required
str

The workspace's primary user assigned identity

managed_network
Required

workspace's Managed Network configuration

provision_network_now
Required

Set to trigger the provisioning of the managed vnet with the default options when creating a workspace with the managed vnet enable, or else it does nothing

system_datastores_auth_mode
Required
str

The authentication mode for system datastores.

enable_data_isolation
Required

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.

allow_roleassignment_on_rg
Required

Determine whether allow workspace role assignment on resource group level.

serverless_compute
Required

The serverless compute settings for the workspace.

workspace_hub
Required

Deprecated resource ID of an existing workspace hub to help create project workspace. Use the Project class instead now.

kwargs
Required

A dictionary of additional configuration parameters.

Keyword-Only Parameters

Name Description
name
Required
description
Default value: None
tags
Default value: None
display_name
Default value: None
location
Default value: None
resource_group
Default value: None
hbi_workspace
Default value: False
storage_account
Default value: None
container_registry
Default value: None
key_vault
Default value: None
application_insights
Default value: None
customer_managed_key
Default value: None
image_build_compute
Default value: None
public_network_access
Default value: None
network_acls
Default value: None
identity
Default value: None
primary_user_assigned_identity
Default value: None
managed_network
Default value: None
provision_network_now
Default value: None
system_datastores_auth_mode
Default value: None
enable_data_isolation
Default value: False
allow_roleassignment_on_rg
Default value: None
hub_id
Default value: None
workspace_hub
Default value: None
serverless_compute
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

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.

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.