Courseiva
Deploy and Manage Azure ComputehardMultiple SelectObjective-mapped

AZ-104 Deploy and Manage Azure Compute Practice Question

A Windows VM must run a bootstrap script during provisioning to install a monitoring agent and write configuration files. The administrator does not want to log in interactively, and the script must be runnable again after the VM is rebuilt. Which two Azure compute components should be used? Select two.

⚠ Common exam trap

Many exam-takers confuse Boot diagnostics (which only shows logs) with a tool that can run scripts, or they mistakenly think Ephemeral OS disks or Availability zones are involved in script execution, when in fact only the VM Agent and Custom Script Extension provide the required automation.

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

Azure VM Agent

The Azure VM Agent (A) is required because it enables the VM to run extensions, including the Custom Script Extension. The Custom Script Extension (B) is the correct mechanism to execute the bootstrap script during provisioning without interactive login, and it can be reapplied to a rebuilt VM by redeploying the same ARM template or CLI command.

Answer analysis

Option-by-option breakdown

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

  • Azure VM Agent

    Why this is correct

    The Azure VM Agent (WindowsAzure Guest Agent) is the core runtime that runs inside the VM and is responsible for managing extension execution, reporting VM health, and handling provisioning actions for Azure. Without this agent, Azure cannot deliver or run any extensions, including the Custom Script Extension, so it is an essential prerequisite for running a bootstrap script during provisioning. It enables secure communication between the VM and the Azure fabric controller, allowing the platform to execute scripts and configurations on the instance.

  • Custom Script Extension

    Why this is correct

    The Custom Script Extension is the actual component that downloads and executes the bootstrap script on the VM. It runs within the VM Agent environment and can copy files from Azure Storage or a public URL, then invoke the script during deployment or on an existing VM. This extension is the direct mechanism that performs the initialization tasks, making it a correct answer alongside the VM Agent.

  • Boot diagnostics

    Why it's wrong here

    Boot diagnostics is a telemetry and troubleshooting feature that captures serial console output and screenshots to help diagnose why a VM failed to boot. It does not have any capacity to execute scripts or modify the virtual machine's configuration. While it uses the VM Agent to collect data, it is purely observational and cannot run a provisioning script.

  • Availability zone

    Why it's wrong here

    An availability zone is a physically separate location within an Azure region that provides resiliency by isolating a VM from datacenter outages. Choosing a zone affects the VM's placement and availability, but it has no bearing on running initialization scripts or any post-deployment configuration logic. It is an infrastructure resilience setting, not a provisioning or scripting mechanism.

    When this WOULD be correct

    When a question asks for a solution to ensure VM resilience against zonal failures in a region that supports availability zones, such as deploying VMs across multiple zones for 99.99% SLA.

  • Ephemeral OS disk

    Why it's wrong here

    An ephemeral OS disk places the virtual hard disk on the local node storage instead of Azure Storage, causing the disk to be deleted when the VM is deallocated. This affects persistence and IO performance but does not include any functionality to run scripts or automate setup. It is a storage deployment choice, unrelated to executing a bootstrap script during provisioning.

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.

Azure VM AgentCorrect answer

Why this is correct

The Azure VM Agent (WindowsAzure Guest Agent) is the core runtime that runs inside the VM and is responsible for managing extension execution, reporting VM health, and handling provisioning actions for Azure. Without this agent, Azure cannot deliver or run any extensions, including the Custom Script Extension, so it is an essential prerequisite for running a bootstrap script during provisioning. It enables secure communication between the VM and the Azure fabric controller, allowing the platform to execute scripts and configurations on the instance.

Availability zoneWrong answer — click to see why

Why this is wrong here

Availability zones are a high-availability feature that protects VMs from datacenter failures, not a compute component for running scripts during provisioning.

★ When this WOULD be the correct answer

When a question asks for a solution to ensure VM resilience against zonal failures in a region that supports availability zones, such as deploying VMs across multiple zones for 99.99% SLA.

Why candidates choose this

Candidates may confuse availability zones with a compute component or think they provide a way to run scripts, because zones are often mentioned alongside VM deployment options.

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

1 more way 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. 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?

medium
  • A.A VM extension such as Custom Script Extension
  • B.An availability set
  • C.A managed disk snapshot
  • D.A public IP address

Why A: 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.

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.