Drag a concept onto its matching description — or click a concept then click the description.
az vm deallocate
az vm redeploy
az vm resize
az snapshot create
az vm disk attach
Match each Azure VM administration requirement on the left with the most appropriate Azure CLI command on the right. Use each answer once.
Drag a concept onto its matching description — or click a concept then click the description.
az vm deallocate
az vm redeploy
az vm resize
az snapshot create
az vm disk attach
Answer choices
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
Deploy a new virtual machine: az vm create
Azure CLI commands for VM administration: 'az vm create' deploys, 'az vm resize' changes size, 'az vm start/stop/restart' controls state, and 'az vm delete' removes the VM.
Answer analysis
For each option: why learners choose it and why it is or isn't the right answer here.
Deploy a new virtual machine: az vm create
Why this is correct
The `az vm create` command is the correct Azure CLI command for deploying a new virtual machine. It creates the VM resource in a specified resource group and configures parameters such as `--name`, `--image`, `--size`, and `--admin-username`. Unlike commands that modify an existing VM, `create` provisions brand-new compute, storage, and networking resources as defined by the arguments.
Change the size of a virtual machine: az vm resize
Why this is correct
`az vm resize` changes the virtual machine size of an existing VM by updating its hardware profile (e.g., from Standard_D2s_v3 to Standard_D4s_v3). The command may require the VM to be deallocated first if the target size is unsupported on the current host, and it does not create a new VM. This operation is distinct from `create`, which provisions resources, and from `start`/`stop`, which only control power state.
Start a virtual machine: az vm start
Why this is correct
`az vm start` is the correct command to start a previously stopped (deallocated) virtual machine, transitioning it to a running state within its availability set. The command allocates a new host for the VM and attaches its managed disks, which is why it can take several minutes. It is not used to reboot a running VM; that is the purpose of `az vm restart`.
Stop a virtual machine: az vm delete
Why it's wrong here
Using `az vm delete` to stop a virtual machine is incorrect because `delete` permanently removes the VM resource, its associated disks, and other attached resources, resulting in data loss. Stopping a VM only powers it off and deallocates it, preserving the disks and configuration so it can be restarted later; the appropriate command is `az vm stop`. The destructive nature of `delete` makes it dangerous to use when the intent is merely to halt compute.
Delete a virtual machine: az vm restart
Why it's wrong here
`az vm restart` does not delete a VM; it simply reboots the existing VM, optionally waiting for it to restart before continuing (with `--wait`). Deleting a virtual machine requires `az vm delete`, which tears down the VM resource and, by default, its disks and NICs unless `--keep-disks` and `--keep-nics` are specified. Confusing these two commands can lead to unintended downtime or, conversely, to accidental resource removal.
Restart a virtual machine: az vm stop
Why it's wrong here
`az vm stop` shuts down the virtual machine and deallocates it, releasing the compute resources and potentially changing its private IP address unless it is a static IP. Restarting a VM is an in-place reboot that retains the VM's lease and public IP, and the correct command for that is `az vm restart`. Using `stop` when a restart is intended incurs additional startup time, may cause IP address changes, and unnecessarily interrupts availability.
Go deeper
About these practice questions
One of 1,049 original AZ-104 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-104 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-104 exam.