Share via


az ml online-deployment

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 online-deployment command. Learn more about extensions.

Manage Azure ML online deployments.

Azure ML deployments provide a simple interface for creating and managing model deployments.

Commands

Name Description Type Status
az ml online-deployment create

Create a deployment. If the deployment already exists, it will fail. If you want to update existing deployment, use az ml online-deployment update.

Extension GA
az ml online-deployment delete

Delete a deployment.

Extension GA
az ml online-deployment get-logs

Get the container logs for an online deployment.

Extension GA
az ml online-deployment list

List deployments.

Extension GA
az ml online-deployment show

Show a deployment.

Extension GA
az ml online-deployment update

Update a deployment.

Extension GA

az ml online-deployment create

Create a deployment. If the deployment already exists, it will fail. If you want to update existing deployment, use az ml online-deployment update.

Minimum recommended compute SKU is Standard_DS3_v2 for general purpose endpoints. Learn more about SKUs here: https://learn.microsoft.com/en-us/azure/machine-learning/reference-managed-online-endpoints-vm-sku-list.

az ml online-deployment create --file
                               --resource-group
                               --workspace-name
                               [--all-traffic]
                               [--endpoint-name]
                               [--local {false, true}]
                               [--local-enable-gpu {false, true}]
                               [--name]
                               [--no-wait]
                               [--package-model]
                               [--set]
                               [--skip-script-validation]
                               [--vscode-debug {false, true}]
                               [--web]

Examples

Create a deployment from a YAML specification file

az ml online-deployment create --file deployment.yaml --resource-group my-resource-group --workspace-name my-workspace

Required Parameters

--file -f

Local path to the YAML file containing the Azure ML online-deployment specification. The YAML reference docs for online-deployment can be found at: https://aka.ms/ml-cli-v2-deployment-managed-online-yaml-reference, https://aka.ms/ml-cli-v2-deployment-kubernetes-online-yaml-reference.

--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 workspace using az configure --defaults workspace=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--all-traffic

Sets endpoint traffic 100% to this deployment after successful creation, does not work with --no-wait.

Property Value
Default value: False
--endpoint-name -e

Name of the online endpoint.

--local

Create deployment locally using Docker. Only one deployment per endpoint is allowed. Note: If specified endpoint doesn't exist, it will be created.

Property Value
Default value: False
Accepted values: false, true
--local-enable-gpu

Enable GPU for local deployment.

Property Value
Default value: False
Accepted values: false, true
--name -n

Name of the deployment.

--no-wait

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

Property Value
Default value: False
--package-model

[THIS IS IN PREVIEW] Create packaged environment from the deployment yaml and use the packaged environment for the deployment.

Property Value
Default value: False
--set

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

--skip-script-validation

Allows user to bypass deployment scoring script validation.

Property Value
Default value: False
--vscode-debug

Create local endpoint and attach VSCode debugger. Only works with --local flag.

Property Value
Default value: False
Accepted values: false, true
--web

Show the deployment's details in Azure ML studio in a web browser.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az ml online-deployment delete

Delete a deployment.

az ml online-deployment delete --endpoint-name
                               --name
                               --resource-group
                               --workspace-name
                               [--local {false, true}]
                               [--no-wait]
                               [--yes]

Examples

Delete a deployment with confirmation

az ml online-deployment delete --name my-deployment --endpoint-name my-endpoint --yes --resource-group my-resource-group --workspace-name my-workspace

Required Parameters

--endpoint-name -e

Name of the online endpoint.

--name -n

Name of the deployment.

--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 workspace using az configure --defaults workspace=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--local

Delete local deployment from Docker environment.

Property Value
Default value: False
Accepted values: false, true
--no-wait

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

Property Value
Default value: False
--yes -y

Do not prompt for confirmation.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az ml online-deployment get-logs

Get the container logs for an online deployment.

az ml online-deployment get-logs --endpoint-name
                                 --name
                                 --resource-group
                                 --workspace-name
                                 [--container]
                                 [--lines]
                                 [--local {false, true}]

Examples

Get the container logs for an online deployment

az ml online-deployment get-logs --name my-deployment --endpoint-name my-endpoint --lines 100 --resource-group my-resource-group --workspace-name my-workspace

Required Parameters

--endpoint-name -e

Name of the online endpoint.

--name -n

Name of the deployment.

--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 workspace using az configure --defaults workspace=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--container -c

The type of container from which to retrieve logs. Allowed values: inference-server, storage-initializer.

--lines -l

The maximum number of lines to tail.

Property Value
Default value: 5000
--local

Get logs from local deployment in Docker environment.

Property Value
Default value: False
Accepted values: false, true
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az ml online-deployment list

List deployments.

az ml online-deployment list --endpoint-name
                             --resource-group
                             --workspace-name
                             [--local {false, true}]

Examples

List deployment in an endpoint

az ml online-deployment list --endpoint-name my-endpoint --resource-group my-resource-group --workspace-name my-workspace

Required Parameters

--endpoint-name -e

Name of the endpoint.

--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 workspace using az configure --defaults workspace=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--local

List local deployment under this local endpoint.

Property Value
Default value: False
Accepted values: false, true
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az ml online-deployment show

Show a deployment.

az ml online-deployment show --endpoint-name
                             --name
                             --resource-group
                             --workspace-name
                             [--local {false, true}]
                             [--web]

Examples

Show a deployment

az ml online-deployment show --name my-deployment --endpoint-name my-endpoint --resource-group my-resource-group --workspace-name my-workspace

Required Parameters

--endpoint-name -e

Name of the online endpoint.

--name -n

Name of the deployment.

--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 workspace using az configure --defaults workspace=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--local

Show local deployment from Docker environment.

Property Value
Default value: False
Accepted values: false, true
--web

Show the deployment's details in Azure ML studio in a web browser.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az ml online-deployment update

Update a deployment.

az ml online-deployment update --resource-group
                               --workspace-name
                               [--add]
                               [--endpoint-name]
                               [--file]
                               [--force-string]
                               [--local {false, true}]
                               [--local-enable-gpu {false, true}]
                               [--name]
                               [--no-wait]
                               [--remove]
                               [--set]
                               [--skip-script-validation]
                               [--vscode-debug {false, true}]
                               [--web]

Examples

Update a deployment from a YAML specification file

az ml online-deployment update --file deployment.yaml --resource-group my-resource-group --workspace-name my-workspace

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 workspace using az configure --defaults workspace=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

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

Property Value
Parameter group: Generic Update Arguments
Default value: []
--endpoint-name -e

Name of the online endpoint.

--file -f

Local path to the YAML file containing the Azure ML online-deployment specification. The YAML reference docs for online-deployment can be found at: https://aka.ms/ml-cli-v2-deployment-managed-online-yaml-reference, https://aka.ms/ml-cli-v2-deployment-kubernetes-online-yaml-reference.

--force-string

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

Property Value
Parameter group: Generic Update Arguments
Default value: False
--local

Update local deployment in Docker environment.

Property Value
Default value: False
Accepted values: false, true
--local-enable-gpu

Enable GPU for local deployment.

Property Value
Default value: False
Accepted values: false, true
--name -n

Name of the deployment.

--no-wait

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

Property Value
Default value: False
--remove

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

Property Value
Parameter group: Generic Update Arguments
Default value: []
--set

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

Property Value
Parameter group: Generic Update Arguments
Default value: []
--skip-script-validation

Allows user to bypass deployment scoring script validation.

Property Value
Default value: False
--vscode-debug

Update local endpoint and re-attach VSCode debugger. Only works with --local flag.

Property Value
Default value: False
Accepted values: false, true
--web

Show the deployment's details in Azure ML studio in a web browser.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False