Path1.Mod2.a - Explore Workspace Developer Tools - Azure ML with CLI Flashcards
R C CICD
Advantages of using Azure CLI in ML
- Repeatability - Automate creation/config of assets and resources
- Consistency - For assets and resources that are replicated across multiple Environments
- CI/CD Workflows - Incorporate ML Asset configuration in DevOps workflows
Azure CLI Installation is based on which Environment you’re installing on (Dev, QA, Prod, etc.) (T/F)
False. It’s based on which platform (Operating System) you choose to install it on (Windows, MacOS, OpenSUSE, Ubuntu/Debian, Azure Linux, etc).
You don’t need to install Azure CLI if you use Azure Cloud Shell, but you need to install it when using the Azure CLI Docker Container. The Docker Image is set up to support Azure CLI but you still need to install your target version. (T/F)
False. BOTH Azure Cloud Shell and the Azure CLI Docker Container already have Azure CLI preinstalled.
To manage Azure ML Resoures through CLI, you need only access it their CLI functions via the "ml"
command. Example, to see help topics: az ml -h
(T/F)
False. First you need to install the Azure ML Extension:
`az extension add -n ml -y`
CLI v2 YAML Schemas are used for …
Microsoft has a list of CLI v2 YAML schemas for defining configurations for CLI creation.
Azure CLI v2 YAML Schema File layout
The file must specify schema
to use, then individual properties of the configuration like name
, type
, etc. . Ex: a compute.yml
file
$schema: https://azuremlschemas.azureedge.net/latest/amlCompute.schema.json name: aml-cluster type: amlcompute size: STANDARD_DS3_v2 min_instances: 0 max_instances: 5
Azure CLI v2 YAML command line usage (in CLI syntax) for creating entities
Given a compute.yaml
file that uses CLI v2 schemas, you can use it as such
az ml compute create --file compute.yml --resource-group my-resource-group --workspace-name my-workspace
The general command format is:
az ml <the type to create> create --file <yaml file location> --resource-group or -g <resource group> --workspace-name or -w <workspace>
Azure CLI command for creating a Workspace, no YAML file…note which four resources are auto created when creating a workspace!!!
‘g’ is the Resource Group to add the ML resource to
az ml workspace create --name "mlw-dp100-labs" -g "rg-dp100-labs-02"
- Log Analytics
- Storage
- Key Vault
- Insights
Azure CLI command for creating a Compute Instance, no YAML file and the specific type required
az ml compute create --name "mlc-dp100-labs-02" --size STANDARD_DS11_V2 -type ComputeInstance -w mlw-dp100-labs-02 -g rg-dp100-labs-02
Azure CLI command for creating a Compute Cluster, no YAML file and the specific type required
Note the difference with the--type
parameter; it’s AmlCompute
for Clusters vs ComputeInstance
for single Instances. You must also specify --max-instances
for the Cluster:
<br></br>az ml compute create --name "mlcluster-dp100-labs" --size STANDARD_DS11_V2 --type AmlCompute --max-instances 2 -w mlw-dp100-labs-02 -g rg-dp100-labs-02