az ml workspace

Note

This reference is part of the ml extension for Azure CLI and requires 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 equivalent az network private-endpoint commands.
  • Also, upgrade az ml workspace share commands to equivalent az role assignment create commands.

Commands

az ml workspace create

Create a workspace.

az ml workspace delete

Delete a workspace.

az ml workspace list

List all the workspaces in a subscription.

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 show

Show details for a workspace.

az ml workspace sync-keys

Sync workspace keys for dependent resources such as Azure Storage, Azure Container Registry, and Azure Application Insights.

az ml workspace update

Update a workspace.

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
                       [--file,]
                       [--location]
                       [--no-wait]
                       [--set]
                       [--workspace-name]

Examples

Create a workspace from a YAML specification file.

az ml workspace create --file workspace.yml --resource-group my-resource-group

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--file, -f

Local path to the YAML file containing the Azure ML workspace specification.

--location -l

The location to be used for the new workspace.

--no-wait

Do not wait for workspace creation to finish.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

--workspace-name -w

Name of the Azure ML workspace. You can configure the default group using az configure --defaults workspace=<name>.

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.

az ml workspace delete --resource-group
                       --workspace-name
                       [--all-resources]
                       [--no-wait]
                       [--yes]

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--workspace-name -w

Name of the Azure ML workspace. You can configure the default group using az configure --defaults workspace=<name>.

Optional Parameters

--all-resources

Delete all the dependent resources associated with the workspace (Azure Storage account, Azure Container Registry, Azure Application Insights, Azure Key Vault).

--no-wait

Do not wait for the long-running operation to finish.

--yes -y

Do not prompt for confirmation.

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 --resource-group
                     [--max-results]

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

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--max-results -r

Max number of results to return.

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 --resource-group
                          --workspace-name

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--workspace-name -w

Name of the Azure ML workspace. You can configure the default group using az configure --defaults workspace=<name>.

az ml workspace show

Show details for a workspace.

az ml workspace show --resource-group
                     --workspace-name

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--workspace-name -w

Name of the Azure ML workspace. You can configure the default group using az configure --defaults workspace=<name>.

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 --resource-group
                          --workspace-name

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--workspace-name -w

Name of the Azure ML workspace. You can configure the default group using az configure --defaults workspace=<name>.

az ml workspace update

Update a workspace.

The 'description', 'tags', and 'friendly_name' properties can be updated.

az ml workspace update --resource-group
                       [--add]
                       [--force-string]
                       [--remove]
                       [--set]
                       [--workspace-name]

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--add

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>.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

--workspace-name -w

Name of the Azure ML workspace. You can configure the default group using az configure --defaults workspace=<name>.