Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a new Azure VM using the Azure CLI.
Azure
az vm create --resource-group MyResourceGroup --name MyVM --image UbuntuLTS --admin-username azureuser [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using --start or --stop during VM creation is incorrect.
Forgetting to generate SSH keys can block access.
✗ Incorrect
The --generate-ssh-keys option creates SSH keys automatically for secure login when creating a VM.
2fill in blank
mediumComplete the code to start an existing Azure VM.
Azure
az vm [1] --resource-group MyResourceGroup --name MyVM Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' tries to make a new VM instead of starting.
Using 'stop' will power off the VM.
✗ Incorrect
The start command powers on a stopped VM.
3fill in blank
hardFix the error in the command to stop an Azure VM.
Azure
az vm [1] --resource-group MyResourceGroup --name MyVM Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'shutdown' or 'poweroff' are not valid Azure CLI commands.
Using 'terminate' is not recognized.
✗ Incorrect
The correct command to stop a VM is stop. Other options are invalid in Azure CLI.
4fill in blank
hardFill both blanks to create and start a VM with SSH keys.
Azure
az vm [1] --resource-group MyResourceGroup --name MyVM --image UbuntuLTS --admin-username azureuser [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' instead of 'create' when making a VM.
Forgetting to generate SSH keys.
✗ Incorrect
Use create to make the VM and --generate-ssh-keys to create SSH keys automatically.
5fill in blank
hardFill all three blanks to stop a VM and delete it without waiting.
Azure
az vm [1] --resource-group MyResourceGroup --name MyVM && az vm [2] --resource-group MyResourceGroup --name MyVM [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to delete without stopping first.
Not using --no-wait causes waiting for deletion.
✗ Incorrect
First, stop the VM, then delete it with --no-wait to avoid waiting for completion.