Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to set the Azure CLI output format to JSON.
Azure
az configure --defaults output=[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'table' or 'tsv' instead of 'json' will change the output format.
✗ Incorrect
Setting the output to json makes Azure CLI return results in JSON format.
2fill in blank
mediumComplete the command to list Azure VMs with output in table format.
Azure
az vm list --output [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'json' or 'tsv' will not display a table.
✗ Incorrect
The table output format shows results in a readable table layout.
3fill in blank
hardFix the error in this command to output VM names only in TSV format.
Azure
az vm list --query "[].[1]" --output tsv
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'id' or 'location' will return unwanted data.
✗ Incorrect
The name property returns the VM names, which is what we want in this query.
4fill in blank
hardFill both blanks to output VM names and their locations in JSON format.
Azure
az vm list --query "[].{VMName: [1], Location: [2]" --output json
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping 'name' and 'location' or using 'id' causes wrong output.
✗ Incorrect
Use name for VM names and location for their regions.
5fill in blank
hardFill all three blanks to output VM names, resource groups, and OS types in table format.
Azure
az vm list --query "[].{Name: [1], ResourceGroup: [2], OS: storageProfile.[3].osType}" --output table
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'location' instead of 'resourceGroup' or wrong OS path causes errors.
✗ Incorrect
The name is VM name, resourceGroup is the group, and osDisk holds the OS type info.