az ml component

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

Manage Azure ML components.

Azure ML component defines the configuration of component for pipeline jobs. You can configure the input/output ports, execution environment and command of component. After the component are created, you can reference the components in the pipeline job to execute them in docker containers.

Commands

Name Description Type Status
az ml component archive

Archive a component.

Extension GA
az ml component create

Create a component.

Extension GA
az ml component list

List components in a workspace.

Extension GA
az ml component restore

Restore an archived component.

Extension GA
az ml component show

Show details for a component.

Extension GA
az ml component update

Update a component. Currently only a few fields(description, display_name) support update.

Extension GA

az ml component archive

Archive a component.

Archiving a component will hide it by default from list queries (az ml component list). You can still continue to reference and use an archived component in your pipelines. You can archive either a component container or a specific component version. Archiving a component container will archive all versions of the component under that given name. You can restore an archived component using az ml component restore. If the entire component container is archived, you cannot restore individual versions of the component - you will need to restore the component container.

az ml component archive --name
                        [--label]
                        [--registry-name]
                        [--resource-group]
                        [--version]
                        [--workspace-name]

Examples

Archive a component container (archives all versions of that component)

az ml component archive --name my-component --resource-group my-resource-group --workspace-name my-workspace

Archive a specific component version

az ml component archive --name my-component --version 1 --resource-group my-resource-group --workspace-name my-workspace

Required Parameters

--name -n

Name of the component.

Optional Parameters

--label -l

Label of the component.

--registry-name

If provided, the command will target the registry instead of a workspace. Hence resource group and workspace won't be required.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--version -v

Version of the component.

--workspace-name -w

Name of the Azure ML workspace. You can configure the default workspace using az configure --defaults workspace=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--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.

az ml component create

Create a component.

az ml component create --file
                       [--name]
                       [--registry-name]
                       [--resource-group]
                       [--set]
                       [--skip-validation]
                       [--version]
                       [--workspace-name]

Examples

Create a component from a YAML specification file

az ml component create --file my_component.yml --resource-group my-resource-group --workspace-name my-workspace

Create a component from a YAML specification file with specified version

az ml component create --file my_component.yml --version 1 --resource-group my-resource-group --workspace-name my-workspace

Create a component in registry from a YAML specification file

az ml component create --file my_component.yml --registry-name my-registry-name --resource-group my-resource-group

Create a component in registry from a YAML specification file with specified version

az ml component create --file my_component.yml --version 1 --registry-name my-registry-name --resource-group my-resource-group

Required Parameters

--file -f

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

Optional Parameters

--name -n

Name of the component.

--registry-name

If provided, the command will target the registry instead of a workspace. Hence resource group and workspace won't be required.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--set

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

--skip-validation

Skip validation in creating the resource. Note that dependent resources will not skip their validation in creating.

default value: False
--version -v

Version of the component.

--workspace-name -w

Name of the Azure ML workspace. You can configure the default workspace using az configure --defaults workspace=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--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.

az ml component list

List components in a workspace.

az ml component list [--archived-only]
                     [--include-archived]
                     [--max-results]
                     [--name]
                     [--registry-name]
                     [--resource-group]
                     [--workspace-name]

Examples

List all the components in a workspace

az ml component list --resource-group my-resource-group --workspace-name my-workspace

List all the component versions for the specified name in a workspace

az ml component list --name my-component --resource-group my-resource-group --workspace-name my-workspace

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

az ml component list --query "[].{Name:name}"  --output table --resource-group my-resource-group --workspace-name my-workspace

List all the components in a registry

az ml component list --registry-name my-registry-name --resource-group my-resource-group

List all the component versions for the specified name in a registry

az ml component list --name my-component --registry-name my-registry-name --resource-group my-resource-group

List all the components in a registry using --query argument to execute a JMESPath query on the results of commands.

az ml component list --query "[].{Name:name}"  --output table --registry-name my-registry-name --resource-group my-resource-group

Optional Parameters

--archived-only

List archived components only.

default value: False
--include-archived

List archived components and active components.

default value: False
--max-results -r

Max number of results to return.

--name -n

Name of the component.

--registry-name

If provided, the command will target the registry instead of a workspace. Hence resource group and workspace won't be required.

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--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.

az ml component restore

Restore an archived component.

When an archived component is restored, it will no longer be hidden from list queries (az ml component list). If an entire component container is archived, you can restore that archived container. This will restore all versions of the component under that given name. You cannot restore only a specific component version if the entire component container is archived - you will need to restore the entire container. If only an individual component version was archived, you can restore that specific version.

az ml component restore --name
                        [--label]
                        [--registry-name]
                        [--resource-group]
                        [--version]
                        [--workspace-name]

Examples

Restore an archived component container (restores all versions of that component)

az ml component restore --name my-component --resource-group my-resource-group --workspace-name my-workspace

Restore a specific archived component version

az ml component restore --name my-component --version 1 --resource-group my-resource-group --workspace-name my-workspace

Required Parameters

--name -n

Name of the component.

Optional Parameters

--label -l

Label of the component.

--registry-name

If provided, the command will target the registry instead of a workspace. Hence resource group and workspace won't be required.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--version -v

Version of the component.

--workspace-name -w

Name of the Azure ML workspace. You can configure the default workspace using az configure --defaults workspace=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--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.

az ml component show

Show details for a component.

az ml component show --name
                     [--label]
                     [--registry-name]
                     [--resource-group]
                     [--version]
                     [--workspace-name]

Examples

Show detail for a component with the specified name and version

az ml component show --name my-component --version 1 --resource-group my-resource-group --workspace-name my-workspace

Show detail for a component in registry with the specified name and version

az ml component show --name my-component --version 1 --registry-name my-registry-name --resource-group my-resource-group

Required Parameters

--name -n

Name of the component.

Optional Parameters

--label -l

Label of the component.

--registry-name

If provided, the command will target the registry instead of a workspace. Hence resource group and workspace won't be required.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--version -v

Version of the component.

--workspace-name -w

Name of the Azure ML workspace. You can configure the default workspace using az configure --defaults workspace=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--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.

az ml component update

Update a component. Currently only a few fields(description, display_name) support update.

az ml component update --name
                       --resource-group
                       --workspace-name
                       [--add]
                       [--force-string]
                       [--label]
                       [--registry-name]
                       [--remove]
                       [--set]
                       [--version]

Examples

Update a component's description

az ml component update -n my_component -v 1 --set description="new description" -g my-resource-group -w my-workspace

Required Parameters

--name -n

Name of the component.

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

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

default value: []
--force-string

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

default value: False
--label -l

Label of the component.

--registry-name

If provided, the command will target the registry instead of a workspace. Hence resource group and workspace won't be required.

--remove

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

default value: []
--set

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

default value: []
--version -v

Version of the component.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--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.