Courseiva
Deploy and Manage Azure ComputehardMultiple SelectObjective-mapped

How to Deploy Identical VMs from a Generalized Image with Version History and Rollback

A platform team maintains a hardened Windows VM with IIS, an agent, and local configuration files. They need to deploy 40 identical VMs in two regions, preserve version history, and roll back quickly if a new image causes problems. Which two actions should they take? Select two.

Quick Answer

The answer is to create an image definition and image version in Azure Compute Gallery. This is correct because the Azure Compute Gallery (formerly Shared Image Gallery) allows you to store multiple versions of a generalized image, enabling you to deploy identical VMs from image with version history and rollback by simply pointing new deployments to a previous image version if the latest one causes issues. On the AZ-104 exam, this scenario tests your understanding of image management versus using managed disks or snapshots, which lack versioning and regional replication. A common trap is choosing "create a snapshot" instead, but snapshots are tied to a single disk and region, not designed for multi-VM deployment with rollback. Memory tip: think "Gallery = Version Control for Images" — just like Git for code, the gallery gives you a history of your VM images to revert to.

⚠ Common exam trap

Watch out — candidates often confuse 'generalizing the source VM' with 'creating a snapshot' or 'using managed identities,' failing to recognize that Sysprep is mandatory for Windows images and that Azure Compute Gallery is the only service that provides versioning and cross-region replication for managed images.

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

Generalize the source VM before capture by removing machine-specific state.

Generalizing the source VM with Sysprep (for Windows) removes machine-specific state like security identifiers (SIDs) and hostnames, making the VM suitable for creating a reusable, generalized image. This is a prerequisite for capturing an image that can be deployed to multiple VMs without conflicts. Without generalization, each VM would retain the original machine's identity, causing domain join and licensing issues.

Answer analysis

Option-by-option breakdown

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

  • Generalize the source VM before capture by removing machine-specific state.

    Why this is correct

    Correct. Generalizing removes unique computer-specific settings so the image can be safely cloned many times.

  • Create an image definition and image version in Azure Compute Gallery.

    Why this is correct

    Correct. Compute Gallery provides versioned, reusable images that can be replicated and rolled back by version.

  • Place the target virtual machines in an availability set.

    Why it's wrong here

    Incorrect. Availability sets improve VM resilience, but they do not create reusable, versioned images for deployment.

    When this WOULD be correct

    When the question asks for a method to ensure high availability for a set of VMs within a single region, such as 'You need to deploy three VMs running the same application and ensure that they are not all affected by a single hardware failure or update event.'

  • Attach a user-assigned managed identity to the source VM.

    Why it's wrong here

    Incorrect. Managed identities help authentication, but they do not prepare a generalized image or manage versions.

    When this WOULD be correct

    A question where a VM needs to authenticate to Azure resources (e.g., Azure Key Vault, storage) without storing credentials, and the solution requires granting specific permissions via a managed identity.

  • Enable boot diagnostics on the target virtual machines.

    Why it's wrong here

    Incorrect. Boot diagnostics helps troubleshooting startup problems, but it does not support image capture or rollbacks.

    When this WOULD be correct

    When a question asks how to troubleshoot a VM that fails to boot or needs serial console access to diagnose startup issues, enabling boot diagnostics is the correct action.

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.

Generalize the source VM before capture by removing machine-specific state.Correct answer

Why this is correct

Correct. Generalizing removes unique computer-specific settings so the image can be safely cloned many times.

Place the target virtual machines in an availability set.Wrong answer — click to see why

Why this is wrong here

Availability sets provide high availability for VMs within a single region by distributing them across fault and update domains, but they do not address the need to deploy identical VMs across two regions, preserve version history, or enable quick rollback of images.

★ When this WOULD be the correct answer

When the question asks for a method to ensure high availability for a set of VMs within a single region, such as 'You need to deploy three VMs running the same application and ensure that they are not all affected by a single hardware failure or update event.'

Why candidates choose this

Candidates may confuse availability sets with image management or think that availability sets help with version control or rollback, not realizing they are purely for high availability within a region.

Attach a user-assigned managed identity to the source VM.Wrong answer — click to see why

Why this is wrong here

Attaching a user-assigned managed identity to the source VM is not required for creating and deploying images via Azure Compute Gallery; it does not address version history or rollback needs.

★ When this WOULD be the correct answer

A question where a VM needs to authenticate to Azure resources (e.g., Azure Key Vault, storage) without storing credentials, and the solution requires granting specific permissions via a managed identity.

Why candidates choose this

Candidates may confuse managed identities with image management or think they are needed for the capture process, but they are unrelated to image versioning and rollback.

Enable boot diagnostics on the target virtual machines.Wrong answer — click to see why

Why this is wrong here

Boot diagnostics help troubleshoot VM boot failures but do not support versioning, rollback, or multi-region deployment of identical VMs from a captured image.

★ When this WOULD be the correct answer

When a question asks how to troubleshoot a VM that fails to boot or needs serial console access to diagnose startup issues, enabling boot diagnostics is the correct action.

Why candidates choose this

Candidates may confuse boot diagnostics with a feature that aids in image management or rollback, or they might think it's necessary for verifying that the new image works correctly.

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

Same concept, more angles

2 more ways this is tested on AZ-104

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A team has an approved Windows VM that already includes their application, patches, and monitoring agent. They want future VMs to start with the same configuration. What should they use?

easy
  • A.A managed image created from the approved VM
  • B.An availability set
  • C.A snapshot of the OS disk
  • D.A larger virtual machine size

Why A: A managed image captures the entire VM configuration, including the OS, application, patches, and monitoring agent, allowing you to create multiple identical VMs from a single source. Unlike a snapshot, which is tied to a specific disk and requires manual steps to replicate the full VM setup, a managed image provides a reusable template for consistent deployments. This approach ensures future VMs start with the exact same configuration as the approved VM.

Variation 2. A team has an approved Windows VM that already includes patches, a monitoring agent, and line-of-business software. They want future VMs to start from that same build. What should they use?

easy
  • A.A custom image
  • B.A snapshot of the OS disk
  • C.An availability set
  • D.A larger VM size

Why A: A custom image captures the exact state of a VM, including installed patches, monitoring agents, and line-of-business software, allowing you to create multiple identical VMs from that golden image. Unlike a snapshot, which is tied to a specific disk and requires manual steps to create a VM, a custom image is stored as a managed image resource that can be used directly during VM provisioning via the Azure portal, CLI, or ARM templates.

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.