az ml online-endpoint

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

Manage Azure ML online endpoints.

Azure ML endpoints provide a simple interface for creating and managing model deployments. Each endpoint can have one or more deployments, enabling the traffic from a single scoring endpoint to be served to multiple deployments if needed. This is useful for scenarios such as controlled rollout.

Azure ML supports two types of endpoints: online and batch. Online endpoints support real-time inference, while batch endpoints are used for offline batch scoring.

Commands

az ml online-endpoint create

Create an endpoint.

az ml online-endpoint delete

Delete an endpoint.

az ml online-endpoint get-credentials

List the token/keys for an online endpoint.

az ml online-endpoint invoke

Invoke an endpoint.

az ml online-endpoint list

List endpoints in a workspace.

az ml online-endpoint regenerate-keys

Regenerate the keys for an online endpoint.

az ml online-endpoint show

Show details for an endpoint.

az ml online-endpoint update

Update an endpoint.

az ml online-endpoint create

Create an endpoint.

To create an endpoint, provide a YAML file with batch endpoint configuration. If the endpoint already exists, it will be over-written with the new settings.

az ml online-endpoint create --resource-group
                             --workspace-name
                             [--auth-mode]
                             [--file]
                             [--local {false, true}]
                             [--name]
                             [--no-wait]
                             [--set]

Examples

Create an endpoint from a YAML specification file

az ml online-endpoint create --file endpoint.yml --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 group using az configure --defaults workspace=<name>.

Optional Parameters

--auth-mode

Authentication method for the endpoint. Allowed values: key, aml_token. Default: key.

--file -f

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

--local

Create endpoint locally. Note: traffic and auth is not supported locally. You can use 'az ml online-deployment create --local' directly. It will create an endpoint if one doesn't exist.

accepted values: false, true
--name -n

Name of the online endpoint.

--no-wait

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

--set

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

az ml online-endpoint delete

Delete an endpoint.

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

Examples

Delete an online endpoint, including all its deployments

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

Required Parameters

--name -n

Name of the online 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 group using az configure --defaults workspace=<name>.

Optional Parameters

--local

Delete local endpoint.

accepted values: false, true
--no-wait

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

--yes -y

Do not prompt for confirmation.

az ml online-endpoint get-credentials

List the token/keys for an online endpoint.

az ml online-endpoint get-credentials --name
                                      --resource-group
                                      --workspace-name

Examples

List the keys for an online endpoint

az ml online-endpoint get-credentials --name my-online-endpoint --resource-group my-resource-group --workspace-name my-workspace

Required Parameters

--name -n

Name of the online 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 group using az configure --defaults workspace=<name>.

az ml online-endpoint invoke

Invoke an endpoint.

You can invoke an online endpoint with some request data. This will be real-time inference, and the scoring results will be returned immediately.

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

Examples

Invoke an online endpoint with some request data

az ml online-endpoint invoke --name my-online-endpoint --request-file sample_request.json --resource-group my-resource-group --workspace-name my-workspace

Invoke an online endpoint, targeting a specific deployment

az ml online-endpoint invoke --name my-online-endpoint --deployment my-deployment --request-file sample_request.json --resource-group my-resource-group --workspace-name my-workspace

Required Parameters

--name -n

Name of the online 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 group using az configure --defaults workspace=<name>.

Optional Parameters

--deployment-name -d

Name of the deployment to target.

--local

Invoke local endpoint. This will only work if a local deployment has been created for this endpoint.

accepted values: false, true
--request-file -r

Local path to the JSON file containing the request data.

az ml online-endpoint list

List endpoints in a workspace.

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

Examples

List all the online endpoints in a workspace

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

List all the batch endpoints in a workspace

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

List all the online endpoints in a workspace using --query argument to execute a JMESPath query on the results of commands.

az ml online-endpoint list --query "[].{Name:name}"  --output table --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 group using az configure --defaults workspace=<name>.

Optional Parameters

--local

List all local endpoints.

accepted values: false, true

az ml online-endpoint regenerate-keys

Regenerate the keys for an online endpoint.

az ml online-endpoint regenerate-keys --name
                                      --resource-group
                                      --workspace-name
                                      [--key-type]
                                      [--no-wait]

Examples

Regenerate the keys for an online endpoint

az ml online-endpoint regenerate-keys --name my-online-endpoint --resource-group my-resource-group --workspace-name my-workspace

Required Parameters

--name -n

Name of the online 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 group using az configure --defaults workspace=<name>.

Optional Parameters

--key-type

The type of key to regenerate. Allowed values: primary, secondary.

default value: primary
--no-wait

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

az ml online-endpoint show

Show details for an endpoint.

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

Examples

Show the details for a batch endpoint

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

Show the provisioning state of an endpoint using --query argument to execute a JMESPath query on the results of commands.

az ml online-endpoint show -n my-endpoint --query "{Name:name,State:provisioning_state}"  --output table --resource-group my-resource-group --workspace-name my-workspace

Required Parameters

--name -n

Name of the online 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 group using az configure --defaults workspace=<name>.

Optional Parameters

--local

Show local endpoint.

accepted values: false, true

az ml online-endpoint update

Update an endpoint.

The 'description', 'tags', and 'traffic' properties of an endpoint can be updated. In addition, new deployments can be added to an endpoint, and existing deployments can be updated.

az ml online-endpoint update --resource-group
                             --workspace-name
                             [--add]
                             [--file]
                             [--force-string]
                             [--local {false, true}]
                             [--mirror-traffic]
                             [--name]
                             [--no-wait]
                             [--remove]
                             [--set]
                             [--traffic]

Examples

Update an endpoint from a YAML specification file

az ml online-endpoint update --file updated_endpoint.yml --resource-group my-resource-group --workspace-name my-workspace

Update the traffic settings for an endpoint

az ml online-endpoint update --name my-online-endpoint  --traffic "my-new-deployment=100" --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 group using az configure --defaults workspace=<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>.

--file -f

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

--force-string

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

--local

Update local endpoint.

accepted values: false, true
--mirror-traffic

Directs a duplicate percentage of live traffic to a train a deployment.

--name -n

Name of the online endpoint.

--no-wait

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

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

--traffic -r

Space-separated key-value pairs, in quotes, for the traffic settings for the endpoint.