Share via


az ml deployment-template

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

This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Manage Azure ML deployment templates.

Deployment templates are reusable templates that define deployment configurations for Azure ML. They support registry-based operations only (not workspace-based) and provide a way to standardize and share deployment configurations across teams and projects.

Commands

Name Description Type Status
az ml deployment-template archive

Archive a deployment template.

Extension Preview
az ml deployment-template create

Create a new deployment template from a YAML file.

Extension Preview
az ml deployment-template list

List deployment templates in a registry.

Extension Preview
az ml deployment-template restore

Restore an archived deployment template.

Extension Preview
az ml deployment-template show

Get a specific deployment template by name and version.

Extension Preview
az ml deployment-template update

Update specific fields of an existing deployment template.

Extension Preview

az ml deployment-template archive

Preview

Command group 'ml deployment-template' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Archive a deployment template.

Archive a deployment template to mark it as inactive. Archived templates are not returned in list operations by default. You can archive a specific version or all versions of a template.

az ml deployment-template archive --name
                                  --registry-name
                                  --version
                                  [--no-wait]

Examples

Archive a specific version

az ml deployment-template archive --name my-template --version 1 --registry-name myregistry

Archive without waiting for completion

az ml deployment-template archive --name my-template --version 1 --registry-name myregistry --no-wait

Required Parameters

--name -n

Name of the deployment template.

--registry-name -r

Name of the registry. This is required since deployment templates only support registry-name and not workspace.

--version -v

Version of the deployment template.

Optional Parameters

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

--no-wait

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

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 deployment-template create

Preview

Command group 'ml deployment-template' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create a new deployment template from a YAML file.

Create a new deployment template using a YAML configuration file. The YAML file should contain the complete deployment template definition including endpoints, parameters, and metadata. You can override specific values using command-line parameters.

az ml deployment-template create --registry-name
                                 [--file]
                                 [--name]
                                 [--no-wait]
                                 [--set]
                                 [--version]

Examples

Create a deployment template from a YAML file

az ml deployment-template create --file template.yml --registry-name myregistry

Create with name and version overrides

az ml deployment-template create --file template.yml --name custom-template --version 2 --registry-name myregistry

Create without waiting for completion

az ml deployment-template create --file template.yml --registry-name myregistry --no-wait

Required Parameters

--registry-name -r

Name of the registry. This is required since deployment templates only support registry-name and not workspace.

Optional Parameters

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

--file -f

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

--name -n

Name of the deployment template.

--no-wait

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

Property Value
Default value: False
--set

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

--version -v

Version of the deployment template.

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 deployment-template list

Preview

Command group 'ml deployment-template' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List deployment templates in a registry.

List all deployment templates available in the specified registry. This command returns all templates along with their metadata including name, version, description, and tags.

az ml deployment-template list --registry-name

Examples

List all deployment templates in a registry

az ml deployment-template list --registry-name myregistry

List deployment templates with specific output format

az ml deployment-template list --registry-name myregistry --output table

Required Parameters

--registry-name -r

Name of the registry. This is required since deployment templates only support registry-name and not workspace.

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 deployment-template restore

Preview

Command group 'ml deployment-template' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Restore an archived deployment template.

Restore a previously archived deployment template to make it active again. Restored templates will appear in list operations. You can restore a specific version or all versions of a template.

az ml deployment-template restore --name
                                  --registry-name
                                  --version
                                  [--no-wait]

Examples

Restore a specific version

az ml deployment-template restore --name my-template --version 1 --registry-name myregistry

Restore without waiting for completion

az ml deployment-template restore --name my-template --version 1 --registry-name myregistry --no-wait

Required Parameters

--name -n

Name of the deployment template.

--registry-name -r

Name of the registry. This is required since deployment templates only support registry-name and not workspace.

--version -v

Version of the deployment template.

Optional Parameters

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

--no-wait

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

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 deployment-template show

Preview

Command group 'ml deployment-template' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Get a specific deployment template by name and version.

Retrieve detailed information about a specific deployment template. If version is not specified, the latest version will be returned.

az ml deployment-template show --name
                               --registry-name
                               --version

Examples

Get a specific version of a deployment template

az ml deployment-template show --name my-template --version 1 --registry-name myregistry

Required Parameters

--name -n

Name of the deployment template.

--registry-name -r

Name of the registry. This is required since deployment templates only support registry-name and not workspace.

--version -v

Version of the deployment template.

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 deployment-template update

Preview

Command group 'ml deployment-template' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Update specific fields of an existing deployment template.

Update metadata fields (description and tags) of an existing deployment template without requiring a YAML file. This command follows Azure CLI conventions and only accepts specific field updates. Tags are merged with existing tags rather than replaced.

For structural changes to the deployment template (endpoints, deployment configuration, etc.), use the 'create' command with a YAML file.

az ml deployment-template update --name
                                 --registry-name
                                 --version
                                 [--add]
                                 [--force-string]
                                 [--remove]
                                 [--set]

Examples

Update deployment template description

az ml deployment-template update --name my-template --version 1 --registry-name myregistry --set "description=Updated description"

Update deployment template tags

az ml deployment-template update --name my-template --version 1 --registry-name myregistry --set "tags=environment=production owner=ml-team"

Update both description and tags

az ml deployment-template update --name my-template --version 1 --registry-name myregistry --set "description=Production template" --set "tags=status=active"

Required Parameters

--name -n

Name of the deployment template.

--registry-name -r

Name of the registry. This is required since deployment templates only support registry-name and not workspace.

--version -v

Version of the deployment template.

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: []
--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
--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: []
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