Azure CLI Extension Reference
The Azure CLI extension for Azure Machine Learning provides powerful command-line tools to manage your machine learning assets, experiments, and deployments.
Installation
To use the Azure CLI extension, you first need to install it. If you don't have the Azure CLI installed, follow the installation guide.
Install the Azure ML extension for Azure CLI.
az extension add --name ml
Core Commands
The Azure ML CLI extension is organized into several core command groups.
workspace
Manage Azure Machine Learning workspaces.
az ml workspace <command>
Examples:
az ml workspace create --name myworkspace --resource-group myresourcegroup --location eastus
az ml workspace show --name myworkspace --resource-group myresourcegroup
az ml workspace delete --name myworkspace --resource-group myresourcegroup --yes
Subcommands:
create: Create a new workspace.show: Get details of a workspace.list: List workspaces.update: Update workspace properties.delete: Delete a workspace.
environment
Manage Azure Machine Learning environments.
az ml environment <command>
Examples:
az ml environment create --file environment.yml
az ml environment list --workspace-name myworkspace --resource-group myresourcegroup
Subcommands:
create: Create a new environment from a YAML file.show: Get details of an environment.list: List environments in a workspace.delete: Delete an environment.
job
Manage Azure Machine Learning jobs (e.g., training, data processing).
az ml job <command>
Examples:
az ml job create --file job.yml
az ml job show --name my-training-job --workspace-name myworkspace
az ml job list --workspace-name myworkspace
Subcommands:
create: Submit a new job.show: Get details of a job.list: List jobs.stream: Tail logs for a job.cancel: Cancel a running job.
data
Manage Azure Machine Learning data assets.
az ml data <command>
Examples:
az ml data create --file data.yml
az ml data show --name my-dataset:1 --workspace-name myworkspace
az ml data list --workspace-name myworkspace
Subcommands:
create: Create a new data asset.show: Get details of a data asset.list: List data assets.download: Download data asset contents.
model
Manage registered Azure Machine Learning models.
az ml model <command>
Examples:
az ml model create --name my-model --version 1 --path ./model_files/
az ml model show --name my-model --version 1
az ml model list --workspace-name myworkspace
Subcommands:
create: Register a new model.show: Get details of a registered model.list: List registered models.delete: Delete a registered model.
endpoint
Manage Azure Machine Learning endpoints (online and batch).
az ml endpoint <command>
Examples:
az ml endpoint create --file endpoint.yml
az ml endpoint list --workspace-name myworkspace
az ml endpoint delete --name my-online-endpoint --workspace-name myworkspace --type online
Subcommands:
create: Create a new endpoint.show: Get details of an endpoint.list: List endpoints.delete: Delete an endpoint.update: Update an endpoint.
deployment
Manage deployments for online endpoints.
az ml deployment <command>
Examples:
az ml deployment create --endpoint my-online-endpoint --file deployment.yml
az ml deployment list --endpoint my-online-endpoint
az ml deployment delete --endpoint my-online-endpoint --name my-deployment
Subcommands:
create: Create a new deployment for an endpoint.show: Get details of a deployment.list: List deployments for an endpoint.delete: Delete a deployment.update: Update a deployment.
Common Parameters
Most Azure ML CLI commands share common parameters:
| Parameter | Description | Required |
|---|---|---|
--workspace-name or -w |
The name of the Azure Machine Learning workspace. | Often, if not set globally or in config. |
--resource-group or -g |
The name of the resource group containing the workspace. | Often, if not set globally or in config. |
--location or -l |
The Azure region where the resource resides or will be created. | When creating resources. |
--name or -n |
The name of the resource (e.g., workspace, job, model). | Varies per command. |
--file or -f |
Path to a YAML configuration file. | Many creation and update commands. |
--yes or -y |
Automatically confirm non-interactive operations. | Optional. |