az ml workspace
Note
This reference is part of the ml extension for the Azure CLI (version 2.15.0 or higher). The extension will automatically install the first time you run an az ml workspace command. Learn more about extensions.
Manage Azure ML workspaces.
An Azure ML workspace is the top-level resource for Azure Machine Learning. It provides a centralized place to track the assets and resources used in your ML workflows, along with the logs and artifacts produced from your training jobs.
If you are upgrading from CLI v1 to v2, you require the following two changes in scope of workspace management:
- Upgrade
az ml workspace private-endpoint
commands to equivalentaz network private-endpoint
commands. - Also, upgrade
az ml workspace share
commands to equivalentaz role assignment create
commands.
Commands
Name | Description | Type | Status |
---|---|---|---|
az ml workspace create |
Create a workspace. |
Extension | GA |
az ml workspace delete |
Delete a workspace. |
Extension | GA |
az ml workspace diagnose |
Diagnose workspace setup problems. |
Extension | GA |
az ml workspace list |
List all the workspaces in a subscription. |
Extension | GA |
az ml workspace list-keys |
List workspace keys for dependent resources such as Azure Storage, Azure Container Registry, and Azure Application Insights. |
Extension | GA |
az ml workspace outbound-rule |
Manage outbound rules for the managed network of an Azure ML workspace. |
Extension | GA |
az ml workspace outbound-rule list |
List all the managed network outbound rules for a workspace. |
Extension | GA |
az ml workspace outbound-rule remove |
Remove an outbound rule from the managed network for a workspace. |
Extension | GA |
az ml workspace outbound-rule set |
Add or update an outbound rule in the managed network for a workspace. |
Extension | GA |
az ml workspace outbound-rule show |
Show details for a managed network outbound rule for a workspace. |
Extension | GA |
az ml workspace provision-network |
Provision workspace managed network. |
Extension | GA |
az ml workspace show |
Show details for a workspace. |
Extension | GA |
az ml workspace sync-keys |
Sync workspace keys for dependent resources such as Azure Storage, Azure Container Registry, and Azure Application Insights. |
Extension | GA |
az ml workspace update |
Update a workspace. |
Extension | GA |
az ml workspace create
Create a workspace.
When a workspace is created, several Azure resources that will be used by Azure ML also get created by default: Azure Storage, Azure Container Registry, Azure Key Vault, and Azure Application Insights. You can instead use existing Azure resource instances for those when creating the workspace by specifying the resource IDs in the workspace configuration YAML file.
az ml workspace create --resource-group
[--allow-roleassignment-on-rg]
[--application-insights]
[--container-registry]
[--default-resource-group]
[--description]
[--display-name]
[--enable-data-isolation]
[--file]
[--hub-id]
[--image-build-compute]
[--key-vault]
[--kind]
[--location]
[--managed-network]
[--name]
[--no-wait]
[--primary-user-assigned-identity]
[--public-network-access]
[--set]
[--storage-account]
[--system-datastores-auth-mode]
[--tags]
[--update-dependent-resources]
Examples
Create a workspace from a YAML specification file.
az ml workspace create --file workspace.yml --resource-group my-resource-group
Required Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
A flag to determine if a workspace could have role assignments on resource group level.
ARM id of the application insights associated with this workspace.
ARM id of the container registry associated with this workspace.
Hub kind only. If set, then child projects of this hub will have their resource group set this by default.
Description of the Azure ML workspace.
Display name for the workspace.
A flag to determine if a workspace has data isolation enabled. The flag can only be set at the creation stage, it can't be updated.
Local path to the YAML file containing the Azure ML workspace specification. The YAML reference docs for workspace can be found at: https://aka.ms/ml-cli-v2-workspace-yaml-reference.
Project kind only: An ARM ID which defines the parent hub of this project.
The name of the compute target to use for building environment Docker images when the container registry is behind a VNet.
ARM id of the key vault associated with this workspace.
Specifies the workspaces as a specific kind, overriding the value assigned in YAML, if it's present. Defaults to default. Valid kinds are: default, hub, and project.
The location to be used for the new workspace.
Managed Network Isolation Mode for the workspace.
Name of the Azure ML workspace.
Do not wait for workspace creation to finish.
ARM identifier of primary user assigned managed identity, in case multiple ones are specified. Also the default managed identity for clusterless compute.
Allow public endpoint connectivity when a workspace is private link enabled.
Update an object by specifying a property path and value to set. Example: --set property1.property2=.
ARM id of the storage account associated with this workspace.
Specifies the auth mode for the system data stores. Valid modes are: accesskey and identity.
Space-separated key-value pairs for the tags of the object.
Specifying --update_dependent_resources, gives your consent to update the workspace dependent resources. Updating the workspace-attached Azure Container Registry or Application Insights resource may break lineage of previous jobs, deployed inference endpoints, or your ability to rerun earlier jobs in this workspace.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az ml workspace delete
Delete a workspace.
By default the dependent resources associated with the workspace (Azure Storage, Azure Container Registry, Azure Key Vault, Azure Application Insights) are not deleted. To delete those as well, include --all-resources. To permanently delete the workspace, include --permanently-delete.
az ml workspace delete --name
--resource-group
[--all-resources]
[--no-wait]
[--permanently-delete]
[--yes]
Required Parameters
Name of the Azure ML workspace. You can configure the default workspace using az configure --defaults workspace=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Delete all the dependent resources associated with the workspace (Azure Storage account, Azure Container Registry, Azure Application Insights, Azure Key Vault).
Do not wait for the long-running-operation to finish. Default is False.
Workspaces are soft-deleted state by default to allow recovery of workspace data. Set this flag to override the soft-delete behavior and permanently delete your workspace.
Do not prompt for confirmation.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az ml workspace diagnose
Diagnose workspace setup problems.
If your workspace is not working as expected, you can run this diagnosis to check if the workspace has been broken. For private endpoint workspace, it will also help check out if the network setup to this workspace and its dependent resource has problem or not.
az ml workspace diagnose --name
--resource-group
[--no-wait]
Examples
diagnose a workspace.
az ml workspace diagnose --name my-workspace-name --no-wait -g my-resource-group
Required Parameters
Name of the Azure ML workspace. You can configure the default workspace using az configure --defaults workspace=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Do not wait for the long-running-operation to finish. Default is False.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az ml workspace list
List all the workspaces in a subscription.
The list of workspaces can be filtered by resource group.
az ml workspace list [--filtered-kinds]
[--max-results]
[--resource-group]
Examples
List all the workspaces in a resource group
az ml workspace list --resource-group my-resource-group
List all the workspace using --query argument to execute a JMESPath query on the results of commands.
az ml workspace list --query "[].{Name:name}" --output table --resource-group my-resource-group
Optional Parameters
List only the specified kinds of workspaces, as a comma separated list. Valid kinds are: default, hub, and project.
Max number of results to return.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az ml workspace list-keys
List workspace keys for dependent resources such as Azure Storage, Azure Container Registry, and Azure Application Insights.
az ml workspace list-keys --name
--resource-group
Required Parameters
Name of the Azure ML workspace. You can configure the default workspace using az configure --defaults workspace=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az ml workspace provision-network
Provision workspace managed network.
Triggers the workspace to provision the managed network. Specifying spark enabled flag prepares the workspace managed network for supporting Spark. The default is false if not specified but can be enabled later by running this command again with this flag. Once enabled it cannot be disabled.
az ml workspace provision-network --name
--resource-group
[--include-spark]
[--no-wait]
Examples
provision managed network.
az ml workspace provision-network --include-spark --name my-workspace-name --no-wait -g my-resource-group
Required Parameters
Name of the Azure ML workspace. You can configure the default workspace using az configure --defaults workspace=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Boolean [true/false] for if managed network should be provisioned to account for spark jobs. The default is false if flag not set. It can be enabled later by running this command again with this flag.
Do not wait for the long-running-operation to finish. Default is False.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az ml workspace show
Show details for a workspace.
az ml workspace show --name
--resource-group
Required Parameters
Name of the Azure ML workspace. You can configure the default workspace using az configure --defaults workspace=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az ml workspace sync-keys
Sync workspace keys for dependent resources such as Azure Storage, Azure Container Registry, and Azure Application Insights.
If the keys for any resource in the workspace are changed, it can take around an hour for them to automatically be updated. This command triggers the workspace to immediately synchronize keys. A possible scenario is needing immediate access to storage after regenerating the storage keys.
az ml workspace sync-keys --name
--resource-group
[--no-wait]
Required Parameters
Name of the Azure ML workspace. You can configure the default workspace using az configure --defaults workspace=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Do not wait for the long-running-operation to finish. Default is False.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az ml workspace update
Update a workspace.
The 'description', 'tags', and 'friendly_name' properties can be updated.
az ml workspace update --name
--resource-group
[--add]
[--allow-roleassignment-on-rg]
[--application-insights]
[--container-registry]
[--description]
[--display-name]
[--file]
[--force-string]
[--image-build-compute]
[--managed-network]
[--no-wait]
[--primary-user-assigned-identity]
[--public-network-access]
[--remove]
[--set]
[--system-datastores-auth-mode]
[--update-dependent-resources]
Examples
update a workspace from a YAML specification file.
az ml workspace update --resource-group my-resource-group --name my-workspace-name --file workspace.yml
Required Parameters
Name of the Azure ML workspace. You can configure the default workspace using az configure --defaults workspace=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>
.
A flag to determine if a workspace could have role assignments on resource group level.
ARM id of the application insights associated with this workspace.
ARM id of the container registry associated with this workspace.
Description of the Azure ML workspace.
Display name for the workspace.
Local path to the YAML file containing the Azure ML workspace specification. The YAML reference docs for workspace can be found at: https://aka.ms/ml-cli-v2-workspace-yaml-reference.
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
The name of the compute target to use for building environment Docker images when the container registry is behind a VNet.
Managed Network Isolation Mode for the workspace.
Do not wait for the long-running-operation to finish. Default is False.
ARM id of the primary user assigned identity associated with this workspace.
Allow public endpoint connectivity when a workspace is private link enabled.
Remove a property or an element from a list. Example: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>
.
Specifies the auth mode for the system data stores. Valid modes are: accesskey and identity.
Specifying --update_dependent_resources, gives your consent to update the workspace dependent resources. Updating the workspace-attached Azure Container Registry or Application Insights resource may break lineage of previous jobs, deployed inference endpoints, or your ability to rerun earlier jobs in this workspace.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.