az ml batch-endpoint

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

Manage Azure ML batch endpoints.

Azure ML endpoints provide a simple interface for creating and managing model deployments. Each endpoint can have one or more deployments. Batch endpoints are used for offline batch scoring.

Commands

az ml batch-endpoint create

Create an endpoint.

az ml batch-endpoint delete

Delete an endpoint.

az ml batch-endpoint invoke

Invoke an endpoint.

az ml batch-endpoint list

List endpoints in a workspace.

az ml batch-endpoint list-jobs

List the batch scoring jobs for a batch endpoint.

az ml batch-endpoint show

Show details for an endpoint.

az ml batch-endpoint update

Update an endpoint.

az ml batch-endpoint create

Create an endpoint.

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

az ml batch-endpoint create --resource-group
                            --workspace-name
                            [--file]
                            [--name]
                            [--no-wait]
                            [--set]

Examples

Create an endpoint from a YAML specification file

az ml batch-endpoint create --file endpoint.yml --resource-group my-resource-group --workspace-name my-workspace

Create an endpoint with name

az ml batch-endpoint create --file endpoint.yml --name endpointname --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

--file -f

Local path to the YAML file containing the Azure ml batch-endpoint specification.

--name -n

Name of the batch 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 batch-endpoint delete

Delete an endpoint.

az ml batch-endpoint delete --name
                            --resource-group
                            --workspace-name
                            [--no-wait]
                            [--yes]

Examples

Delete an batch endpoint, including all its deployments

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

Required Parameters

--name -n

Name of the batch 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

--no-wait

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

--yes -y

Do not prompt for confirmation.

az ml batch-endpoint invoke

Invoke an endpoint.

You can start batch inference run by invoking the endpoint with some data. For batch endpoints, invocation will trigger an asynchronous batch scoring job.

az ml batch-endpoint invoke --name
                            --resource-group
                            --workspace-name
                            [--deployment-name]
                            [--input-dataset]
                            [--input-local-path]
                            [--input-path]
                            [--instance-count]
                            [--job-name]
                            [--mini-batch-size]
                            [--output-path]
                            [--set]

Examples

Invoke a batch endpoint with input data from a registered Azure ML data asset (and override default deployment setting for mini_batch_size)

az ml batch-endpoint invoke --name my-batch-endpoint  --input-dataset azureml:my-dataset:1 --mini-batch-size 64 --resource-group my-resource-group --workspace-name my-workspace

Invoke a batch endpoint with input data from a storage URL

az ml batch-endpoint invoke --name my-batch-endpoint  --input-path folder:https://pipelinedata.blob.core.windows.net/sampledata/mnist --resource-group my-resource-group --workspace-name my-workspace

Invoke a batch endpoint with input data from local files

az ml batch-endpoint invoke --name my-batch-endpoint  --input-local-path ./mnist --resource-group my-resource-group --workspace-name my-workspace

Invoke a batch endpoint with a local directory as the input and output path and overwrite some batch deployment settings during endpoint invoke

az ml batch-endpoint invoke --name my-batch-endpoint  --input-local-path ./mnist --instance-count 2 --mini-batch-size 5 --output-path folder:azureml://datastores/workspaceblobstore/paths/tests/output --resource-group my-resource-group --workspace-name my-workspace

Required Parameters

--name -n

Name of the batch 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.

--input-dataset

Input data asset. Format should be azureml::.

--input-local-path

Local path to the input data. The file(s) will be uploaded and registered as an Azure ML data asset.

--input-path

URL or path on the datastore where the input data is located.

--instance-count -c

Number of instances the prediction will run on.

--job-name

Name of the job for batch invoke.

--mini-batch-size -m

Size of each mini batch that the input data will be split into for prediction.

--output-path

Path on the datastore where output files will be uploaded to.

--set

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

az ml batch-endpoint list

List endpoints in a workspace.

az ml batch-endpoint list --resource-group
                          --workspace-name

Examples

List all the batch endpoints in a workspace

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

List all the batch endpoints in a workspace

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

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

az ml batch-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>.

az ml batch-endpoint list-jobs

List the batch scoring jobs for a batch endpoint.

az ml batch-endpoint list-jobs --name
                               --resource-group
                               --workspace-name

Examples

List all the batch scoring jobs for an endpoint

az ml batch-endpoint list-jobs --name my-batch-endpoint --resource-group my-resource-group --workspace-name my-workspace

Required Parameters

--name -n

Name of the batch 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 batch-endpoint show

Show details for an endpoint.

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

Examples

Show the details for a batch endpoint

az ml batch-endpoint show --name my-batch-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 batch-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 batch 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 batch-endpoint update

Update an endpoint.

The 'description', 'tags', and 'defaults' 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 batch-endpoint update --resource-group
                            --workspace-name
                            [--add]
                            [--defaults]
                            [--file]
                            [--force-string]
                            [--name]
                            [--no-wait]
                            [--remove]
                            [--set]

Examples

Update an endpoint from a YAML specification file

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

Add a new deployment to an existing endpoint

az ml batch-endpoint update --name my-batch-endpoint  --set defaults.deployment_name=depname  --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>.

--defaults

Update deployment_name inside defaults settings for endpoint invoke.

--file -f

Local path to the YAML file containing the Azure ml batch-endpoint specification.

--force-string

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

--name -n

Name of the batch 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=.