0
0
Azurecloud~20 mins

VM commands (create, start, stop) in Azure - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Azure VM Command Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
What happens after running this Azure CLI command?
You run the command to create a VM:
az vm create --resource-group MyGroup --name MyVM --image UbuntuLTS --admin-username azureuser --generate-ssh-keys

What is the state of the VM immediately after this command completes successfully?
Azure
az vm create --resource-group MyGroup --name MyVM --image UbuntuLTS --admin-username azureuser --generate-ssh-keys
AThe VM is created and running, ready to accept SSH connections.
BThe VM is created but remains stopped until manually started.
CThe VM is created and in a provisioning state, not yet usable.
DThe VM creation fails because SSH keys are not provided explicitly.
Attempts:
2 left
💡 Hint
Think about what the 'az vm create' command does by default regarding VM state.
Configuration
intermediate
2:00remaining
Which command correctly stops a running Azure VM?
You want to stop a VM named 'TestVM' in resource group 'TestGroup' using Azure CLI. Which command will stop the VM and deallocate its resources?
Aaz vm deallocate --resource-group TestGroup --name TestVM
Baz vm stop --resource-group TestGroup --name TestVM
Caz vm shutdown --resource-group TestGroup --name TestVM
Daz vm poweroff --resource-group TestGroup --name TestVM
Attempts:
2 left
💡 Hint
Stopping a VM does not always free resources; deallocating does.
Architecture
advanced
2:00remaining
What is the effect of starting a deallocated VM in Azure?
You have a VM that was previously deallocated. You run:
az vm start --resource-group ProdGroup --name ProdVM

What happens to the VM's IP address and resources after this command?
AThe VM starts with the same public IP address and resources as before deallocation.
BThe VM starts with a new dynamic public IP address and allocated compute resources.
CThe VM fails to start because deallocated VMs cannot be restarted.
DThe VM starts but loses all data on the OS disk.
Attempts:
2 left
💡 Hint
Consider what happens to dynamic IP addresses when a VM is deallocated.
security
advanced
2:00remaining
Which command sequence ensures a VM is stopped and cannot be accessed until restarted?
You want to stop a VM named 'SecureVM' in resource group 'SecureGroup' so that it is completely offline and inaccessible. Which sequence of commands achieves this?
Aaz vm stop --resource-group SecureGroup --name SecureVM && az vm deallocate --resource-group SecureGroup --name SecureVM
Baz vm stop --resource-group SecureGroup --name SecureVM
Caz vm deallocate --resource-group SecureGroup --name SecureVM
Daz vm shutdown --resource-group SecureGroup --name SecureVM
Attempts:
2 left
💡 Hint
Stopping a VM does not release resources or IP addresses.
Best Practice
expert
2:00remaining
What is the best practice to minimize cost when a VM is not in use but you want to keep its data intact?
You have a VM that you do not need running 24/7 but want to keep all data and configuration intact. Which Azure CLI command should you use to minimize cost while preserving data?
Aaz vm stop --resource-group CostGroup --name CostVM
Baz vm restart --resource-group CostGroup --name CostVM
Caz vm delete --resource-group CostGroup --name CostVM
Daz vm deallocate --resource-group CostGroup --name CostVM
Attempts:
2 left
💡 Hint
Stopping a VM does not release compute resources, but deallocating does.