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 |
|---|---|
|
kwargs
Required
|
A dictionary of additional configuration parameters. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
name
|
Name of the workspace. |
|
description
|
Description of the workspace. Default value: None
|
|
tags
|
Tags of the workspace. Default value: None
|
|
display_name
|
Display name for the workspace. This is non-unique within the resource group. Default value: None
|
|
location
|
The location to create the workspace in. If not specified, the same location as the resource group will be used. Default value: None
|
|
resource_group
|
Name of resource group to create the workspace in. Default value: None
|
|
hbi_workspace
|
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. Default value: False
|
|
storage_account
|
The resource ID of an existing storage account to use instead of creating a new one. Default value: None
|
|
container_registry
|
The resource ID of an existing container registry to use instead of creating a new one. Default value: None
|
|
key_vault
|
The resource ID of an existing key vault to use instead of creating a new one. Default value: None
|
|
application_insights
|
The resource ID of an existing application insights 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
|
|
image_build_compute
|
The name of the compute target to use for building environment Docker images with the container registry is behind a VNet. Default value: None
|
|
public_network_access
|
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
|
workspace's Managed Identity (user assigned, or system assigned) Default value: None
|
|
primary_user_assigned_identity
|
The workspace's primary user assigned identity Default value: None
|
|
managed_network
|
workspace's Managed Network configuration Default value: None
|
|
provision_network_now
|
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 Default value: None
|
|
system_datastores_auth_mode
|
The authentication mode for system datastores. 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
|
|
allow_roleassignment_on_rg
|
Determine whether allow workspace role assignment on resource group level. Default value: None
|
|
serverless_compute
|
The serverless compute settings for the workspace. Default value: None
|
|
workspace_hub
|
Deprecated resource ID of an existing workspace hub to help create project workspace. Use the Project class instead now. Default value: None
|
|
hub_id
|
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
|
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
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 |
|---|---|
|
Backend service URLs of the workspace |
id
mlflow_tracking_uri
MLflow tracking uri for the workspace.
Returns
| Type | Description |
|---|---|
|
Returns mlflow tracking uri of the workspace. |