Courseiva
Deploy and Manage Azure ComputeeasyMultiple ChoiceObjective-mapped

AZ-104 Deploy and Manage Azure Compute Practice Question

You want to preview what a Bicep deployment will change before you apply it to a resource group. Which command should you use?

⚠ Common exam trap

Candidates often confuse `az deployment group what-if` with `az deployment group validate` (which checks template syntax but does not show resource-level changes), or they might think `az deployment group create --mode Complete` provides a preview, when in fact it executes the deployment immediately.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

az deployment group what-if

The `az deployment group what-if` command allows you to preview the changes a Bicep deployment will make to a resource group before actually applying them. It returns a list of resources that will be created, modified, or deleted, enabling you to validate the deployment's impact without committing any changes. This is the correct tool for a dry-run or validation scenario.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • az deployment group what-if

    Why this is correct

    az deployment group what-if invokes Azure Resource Manager's what-if operation at a resource group or subscription scope. It takes a Bicep file or ARM template and compares the current deployed state against the desired state, then prints a table of predicted operations: Create, Modify, Delete, NoChange, and sometimes Ignore. It does not actually execute any deployment, so it is completely safe for previewing the impact of a Bicep deployment before applying it. You can further refine it with --exclude-change-types or --result-format to focus on specific changes.

  • az vm create

    Why it's wrong here

    az vm create is a high-level command that directly provisions a single virtual machine and its implicitly created resources (like NIC, public IP, VNet, or storage) based on the specified parameters. It does not accept an entire template or simulate the broader set of changes that a Bicep deployment might include, and it lacks a built-in what-if mode. Even if you are only interested in a single VM, az deployment group what-if with a Bicep file would be the correct way to see the planned resource graph before any actual creation occurs.

    When this WOULD be correct

    This option would be correct in a scenario where the question asks: 'You need to deploy a new Linux virtual machine in Azure using the CLI. Which command should you use?'

  • az monitor metrics list

    Why it's wrong here

    az monitor metrics list is a monitoring command that retrieves metric time-series data, such as CPU percentage or disk I/O, from Azure Monitor for a specific resource. It queries the resource's telemetry history rather than the resource manager's deployment engine, so it cannot anticipate changes that a Bicep template would make. While metrics can be used to detect drift or performance after a deployment, they have no role in previewing infrastructure modifications before a deployment.

    When this WOULD be correct

    This command would be correct in a scenario where you need to list metric values for a specified Azure resource, such as checking CPU usage of a VM over a time range.

  • az deployment group create --mode Complete

    Why it's wrong here

    az deployment group create --mode Complete actually runs a deployment against a resource group, and Complete mode ensures resources in the group that are not defined in the template are deleted. This is an imperative action, not a preview; it will immediately provision, update, and potentially destroy resources as it executes. To get a preview with similar parameters, you would need to add the --what-if flag (or use az deployment group what-if as a standalone command), but the create command alone cannot show changes without applying them.

    When this WOULD be correct

    This command is correct when the question asks to deploy a Bicep file to a resource group using Complete mode, which removes existing resources not defined in the template, ensuring the resource group matches the template exactly.

Option-by-option analysis

Why each answer is right or wrong

Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AZ-104 exam frequently reuses these exact scenarios with slightly different constraints.

az deployment group what-ifCorrect answer

Why this is correct

az deployment group what-if invokes Azure Resource Manager's what-if operation at a resource group or subscription scope. It takes a Bicep file or ARM template and compares the current deployed state against the desired state, then prints a table of predicted operations: Create, Modify, Delete, NoChange, and sometimes Ignore. It does not actually execute any deployment, so it is completely safe for previewing the impact of a Bicep deployment before applying it. You can further refine it with --exclude-change-types or --result-format to focus on specific changes.

az vm createWrong answer — click to see why

Why this is wrong here

The 'az vm create' command is used to deploy a new virtual machine, not to preview changes from a Bicep deployment. It does not provide a what-if analysis of deployment impacts.

★ When this WOULD be the correct answer

This option would be correct in a scenario where the question asks: 'You need to deploy a new Linux virtual machine in Azure using the CLI. Which command should you use?'

Why candidates choose this

Candidates may confuse the deployment of a Bicep template with the creation of a VM, thinking that a VM creation command can somehow preview changes, or they may mistakenly believe that Bicep deployments are only for VMs.

az monitor metrics listWrong answer — click to see why

Why this is wrong here

The command 'az monitor metrics list' retrieves metric data for Azure resources, not deployment previews. It is unrelated to Bicep or ARM template deployment validation.

★ When this WOULD be the correct answer

This command would be correct in a scenario where you need to list metric values for a specified Azure resource, such as checking CPU usage of a VM over a time range.

Why candidates choose this

Candidates might confuse monitoring commands with deployment validation, or think that previewing changes involves checking metrics, especially if they are unfamiliar with the 'what-if' functionality.

az deployment group create --mode CompleteWrong answer — click to see why

Why this is wrong here

The `az deployment group create --mode Complete` command applies the deployment immediately without previewing changes, and Complete mode can delete resources not in the template, which is irreversible.

★ When this WOULD be the correct answer

This command is correct when the question asks to deploy a Bicep file to a resource group using Complete mode, which removes existing resources not defined in the template, ensuring the resource group matches the template exactly.

Why candidates choose this

Candidates may confuse 'what-if' with 'Complete mode' or think that Complete mode includes a preview, or they might mistakenly believe that `--mode Complete` is necessary for any deployment.

Analysis generated from the official AZ-104blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”

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 →

How Courseiva writes practice questions · Editorial policy

JA

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.