Component CLI cheat sheet

This cheat sheet features the most important and commonly used component CLI commands for easy reference.

Please follow instructions in getting started to install the CLI.

Validate
Validate component spec file
az ml component validate --file configs/components/sample-component/entry/sample_component.yaml
Build
Build component snapshot
az ml component build --file "./configs/components/sample-component/entry/sample_component.yaml"
Create
Create component from local
az ml component create --file "./configs/components/sample-component/entry/sample_component.yaml"
Create component from public github
az ml component create --file "https://github.com/zzn2/sample_modules/blob/master/4_mpi_module/mpi_module.yaml" --label default
Create component from Azure DevOps
az ml component create --package "https://dev.azure.com/weda/recommenders/_apis/build/builds/46/artifacts?artifactName=snapshot&api-version=5.1&%24format=zip" --manifest stratified_splitter.yaml
Create component and override properties by --set
az ml component create --file "./configs/components/sample-component/entry/sample_component.yaml" --set description=test_description tags.python.version=3.7
Override version with CLI
az ml component create --file configs/components/sample-component/entry/sample_component.yaml --version 0.0.2
Create registry component from local
az ml component create --file "./configs/components/sample-component/entry/sample_component.yaml" --registry testFeed
Skip create new component if underlying code/contents have not changed compare with default/latest version
az ml component create --file "./configs/components/sample-component/entry/sample_component.yaml" --skip-if-no-change
Update
Update component default version
az ml component update --label default --name "sample_component" --version 0.0.1
Update default component version's properites by --set
az ml component update --name "sample_component" --set description=update_description tags.python.version=3.8
Update specific component version's properites by --set
az ml component update --name "sample_component" --version 0.0.1 --set description=update_description tags.python.version=3.8
Update specific component version's properites in registry
az ml component update --name "sample_component" --version 0.0.1 --set description=update_description tags.python.version=3.8 --registry testFeed
Show
Show information of default version
az ml component show --name "sample_component"
Show information of specific version
az ml component show --name "sample_component" --version 0.0.2
Show information of a registry component's default version
az ml component show --name "sample_component" --registry testFeed
List
List components
az ml component list --output table
List component including archived ones
az ml component list --include-archived --output table
List all versions of a component
az ml component list --name "mpi_component" -o table
List registry components
az ml component list --output table --registry testFeed
Archive
Archive a component so it won't be listed
az ml component archive --name "sample_component"
Archive a component from registry so it won't be listed
az ml component archive --name "sample_component" --registry testFeed
Restore
Restore an archived component
az ml component restore --name "sample_component"
Restore an archived component from regisry
az ml component restore --name "sample_component" --registry testFeed
Download
Download default version component
mkdir ~/components
az ml component download --name "sample_component" --target ~/components
Download specific version component
mkdir ~/components
az ml component download --name "sample_component" --target ~/components --version 0.1.1