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

az ml component archive

Archive a component.

az ml component create

Create a component.

az ml component list

List components in a workspace.

az ml component restore

Restore an archived component.

az ml component show

Show details for a component.

az ml component update

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

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
                        --resource-group
                        --workspace-name
                        [--label]
                        [--version]

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.

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

--label -l

Label of the component.

--version -v

Version of the component.

az ml component create

Create a component.

az ml component create --file
                       --resource-group
                       [--name]
                       [--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

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.

--resource-group -g

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

Optional Parameters

--name -n

Name of the component.

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

--version -v

Version of the component.

--workspace-name -w

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

az ml component list

List components in a workspace.

az ml component list --resource-group
                     [--archived-only]
                     [--include-archived]
                     [--max-results]
                     [--name]
                     [--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

Required Parameters

--resource-group -g

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

Optional Parameters

--archived-only

List archived components only.

--include-archived

List archived components and active components.

--max-results -r

Max number of results to return.

--name -n

Name of the component.

--workspace-name -w

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

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
                        --resource-group
                        --workspace-name
                        [--label]
                        [--version]

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.

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

--label -l

Label of the component.

--version -v

Version of the component.

az ml component show

Show details for a component.

az ml component show --name
                     --resource-group
                     [--label]
                     [--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

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

Optional Parameters

--label -l

Label of the component.

--version -v

Version of the component.

--workspace-name -w

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

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

--force-string

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

--label -l

Label of the component.

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

--version -v

Version of the component.