AZ-104 Deploy and Manage Azure Compute Practice Question
You deploy a Windows VM with an ARM template. During the first boot, it must install IIS, copy application files from storage, and run a bootstrap script. Which Azure feature should you add to the deployment?
⚠ Common exam trap
Candidates often confuse a VM extension (which runs scripts post-deployment) with a VM image (which bakes configuration into the OS disk), leading them to think a snapshot or availability set can achieve the same result, but neither can execute commands during first boot.
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
✓
A VM extension such as Custom Script Extension
The Custom Script Extension (CSE) is the correct Azure feature to use because it allows you to execute PowerShell or Bash scripts on a Windows or Linux VM during first boot. By adding the CSE to your ARM template, you can automate the installation of IIS, copy application files from Azure Storage (using the `fileUris` property), and run a bootstrap script after the OS is provisioned, ensuring the VM is fully configured without manual intervention.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
A VM extension such as Custom Script Extension
Why this is correct
A VM extension such as Custom Script Extension is designed specifically to run scripted configuration tasks on an Azure VM during deployment. Defined in the ARM template under Microsoft.Compute/virtualMachines/extensions, it downloads and executes a PowerShell script on Windows—or a shell script on Linux—after the VM is provisioned. This script runs with administrative privileges and can install IIS, copy files, modify registry settings, or perform any other bootstrapping action. Because the extension is part of the deployment resource, it executes when the VM first boots, making it the correct choice.
- ✗
An availability set
Why it's wrong here
An availability set is a logical grouping of VMs that distributes them across different fault domains and update domains to maintain availability during hardware failures or platform maintenance. It is purely a placement and resiliency configuration; it has no code execution capability and cannot run scripts or copy files onto a VM. When you include an availability set in an ARM template, you are only controlling the physical separation of VMs, not their software configuration. Thus, it cannot install IIS or perform any first-boot automation tasks.
When this WOULD be correct
When deploying multiple VMs for a highly available application and you need to guarantee that at least one VM remains available during planned or unplanned maintenance, you would add an availability set to the deployment.
- ✗
A managed disk snapshot
Why it's wrong here
A managed disk snapshot captures a point-in-time, read-only copy of the OS or data disk, used for backups, disaster recovery, or creating new disks from that state. A snapshot itself is a static artifact—it does not execute any code or run any scripts, and it cannot be triggered to perform installation steps during a deployment. Even if you create a VM from a snapshot, you are simply attaching a pre-existing disk image, not running a configuration process on first boot. It therefore cannot serve as a bootstrapping mechanism when deploying a fresh Windows VM through an ARM template.
When this WOULD be correct
A managed disk snapshot would be correct if the question asked for a way to create a consistent backup of a VM's disk before applying updates, or to quickly deploy multiple VMs from a pre-configured disk state without needing to run scripts.
- ✗
A public IP address
Why it's wrong here
A public IP address is a networking resource that assigns a publicly routable IPv4 or IPv6 address to a VM's network interface, enabling inbound and outbound internet connectivity. While it might allow you to connect remotely to the VM to manually install software, the public IP itself does not take any action—it simply passes traffic. In an ARM template, it is defined as a Microsoft.Network/publicIPAddresses resource with no execution or configuration logic. It therefore cannot automate the installation of IIS or file-copying tasks during deployment.
When this WOULD be correct
A public IP address would be correct in a question asking: 'You deploy a VM that must be accessible from the internet. Which resource must you associate with the VM's NIC?' In that scenario, a public IP is essential for external connectivity.
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.
✓A VM extension such as Custom Script ExtensionCorrect answer▾
Why this is correct
A VM extension such as Custom Script Extension is designed specifically to run scripted configuration tasks on an Azure VM during deployment. Defined in the ARM template under Microsoft.Compute/virtualMachines/extensions, it downloads and executes a PowerShell script on Windows—or a shell script on Linux—after the VM is provisioned. This script runs with administrative privileges and can install IIS, copy files, modify registry settings, or perform any other bootstrapping action. Because the extension is part of the deployment resource, it executes when the VM first boots, making it the correct choice.
✗An availability setWrong answer — click to see why▾
Why this is wrong here
An availability set is used to ensure high availability by distributing VMs across fault and update domains, not for installing software or running scripts during deployment.
★ When this WOULD be the correct answer
When deploying multiple VMs for a highly available application and you need to guarantee that at least one VM remains available during planned or unplanned maintenance, you would add an availability set to the deployment.
Why candidates choose this
Candidates may confuse 'availability' with 'deployment automation' or think that an availability set can trigger post-deployment tasks, not understanding its sole purpose is for VM redundancy.
✗A managed disk snapshotWrong answer — click to see why▾
Why this is wrong here
A managed disk snapshot captures the state of a disk at a point in time, but it cannot execute scripts or install software during VM deployment. The question requires running a bootstrap script and installing IIS, which is beyond the capability of a snapshot.
★ When this WOULD be the correct answer
A managed disk snapshot would be correct if the question asked for a way to create a consistent backup of a VM's disk before applying updates, or to quickly deploy multiple VMs from a pre-configured disk state without needing to run scripts.
Why candidates choose this
Candidates might think a snapshot can be used to capture a VM after manual configuration and then deploy it, confusing snapshots with custom images or automation features.
✗A public IP addressWrong answer — click to see why▾
Why this is wrong here
A public IP address enables inbound internet connectivity but does not install IIS, copy files, or run scripts during first boot. The question requires a feature that performs post-deployment configuration, which is not provided by a public IP.
★ When this WOULD be the correct answer
A public IP address would be correct in a question asking: 'You deploy a VM that must be accessible from the internet. Which resource must you associate with the VM's NIC?' In that scenario, a public IP is essential for external connectivity.
Why candidates choose this
Candidates may think a public IP is needed to download files from storage or access the VM for configuration, but the question specifies automated tasks during first boot, which do not require internet access.
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?”
Go deeper
Related to this question
Learn chapter
Managed Identities for Azure Resources
Key term
Custom script extension
A virtual machine extension for Azure that downloads and runs scripts on a VM after it is deployed, used for configuration, software installation, and post-deployment tasks.
Key term
Azure Storage
Azure Storage is Microsoft's cloud-based service for storing data like files, messages, and backups with high durability and scalability.
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 →
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.