Complete the code to create a new Azure VM using the Azure CLI.
az vm create --resource-group MyResourceGroup --name MyVM --image UbuntuLTS --admin-username azureuser [1]The --generate-ssh-keys option creates SSH keys automatically for secure login when creating a VM.
Complete the code to start an existing Azure VM.
az vm [1] --resource-group MyResourceGroup --name MyVMThe start command powers on a stopped VM.
Fix the error in the command to stop an Azure VM.
az vm [1] --resource-group MyResourceGroup --name MyVMThe correct command to stop a VM is stop. Other options are invalid in Azure CLI.
Fill both blanks to create and start a VM with SSH keys.
az vm [1] --resource-group MyResourceGroup --name MyVM --image UbuntuLTS --admin-username azureuser [2]
Use create to make the VM and --generate-ssh-keys to create SSH keys automatically.
Fill all three blanks to stop a VM and delete it without waiting.
az vm [1] --resource-group MyResourceGroup --name MyVM && az vm [2] --resource-group MyResourceGroup --name MyVM [3]
First, stop the VM, then delete it with --no-wait to avoid waiting for completion.
