AZ-104 Deploy and Manage Azure Compute Practice Question
Exhibit
Deployment requirement: 1. Create a new Windows VM from a standard image. 2. Install IIS after the VM is provisioned. 3. Run C:\Setup\install.ps1 automatically. 4. No interactive logon is allowed during deployment.
Based on the exhibit, a Windows VM must install IIS and run a configuration script automatically right after deployment. The administrator does not want to sign in to the VM manually. Which Azure feature should be used?
⚠ Common exam trap
Test-takers frequently confuse Azure Policy (which can only audit or remediate resource configurations at the ARM level) with the ability to run guest OS scripts, mistakenly thinking a 'modify effect' can install software, when in fact it cannot execute code inside the VM.
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
✓
Virtual machine extension, such as the Custom Script Extension.
The Custom Script Extension (CSE) is the correct Azure feature because it allows you to run PowerShell or Bash scripts on a VM after deployment without manual sign-in. By specifying the script in the VM's deployment template or via Azure CLI/Portal, IIS can be installed and the configuration script executed automatically during provisioning. This aligns with the requirement for zero-touch post-deployment automation.
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 Policy with a modify effect.
Why it's wrong here
Azure Policy with a modify effect can append, replace, or remove properties on a resource's ARM metadata (such as tags, SKUs, or location) during create/update operations. Critically, modify actions operate against the ARM resource definition, not against the VM's guest OS — the policy engine has no access to the virtual machine's local file system or services. While Azure Policy has guest configuration capabilities that can audit or configure settings inside a VM, the modify effect itself does not execute scripts, install features, or run arbitrary post-deployment logic, so it cannot install IIS.
When this WOULD be correct
A question requiring automatic remediation of non-compliant resources, such as 'Ensure all VMs have a specific tag applied automatically when missing' or 'Enforce that all VMs use a particular disk encryption setting.'
- ✓
Virtual machine extension, such as the Custom Script Extension.
Why this is correct
A VM extension is designed to run guest-level tasks after the VM is created. The Custom Script Extension can download and execute a script to install IIS or perform configuration without requiring manual sign-in. This is the standard Azure feature for simple post-deployment automation on a VM.
- ✗
An availability set.
Why it's wrong here
An availability set is a logical grouping of VMs that spreads them across multiple fault domains and update domains to protect against hardware failures and planned maintenance. It is a placement and resilience feature that only influences where the VM's virtual hard disks and instances are physically located in the datacenter. It contains no guest-level automation or agent that could run a configuration script, so it cannot install IIS or perform any software provisioning. Its sole purpose is to increase the availability SLA, not to manage the operating system.
When this WOULD be correct
A question asks: 'You need to ensure that at least two VMs running a web application are available during planned maintenance. Which feature should you use?'
- ✗
A private endpoint.
Why it's wrong here
A private endpoint is a network construct that assigns a private IP address from your virtual network to an Azure PaaS service (e.g., Storage, SQL) and establishes a secure, private connection through the Microsoft backbone. It exists entirely within the network control plane; it does not reach into the VM's guest OS, cannot download files or execute processes, and has no mechanism for running post-deployment scripts. Therefore, it is irrelevant to installing IIS on a Windows VM — it merely alters the network path to a separate service.
When this WOULD be correct
In a scenario where you need to securely access an Azure service (e.g., Azure Storage or SQL Database) from a virtual network without exposing it to the public internet, a private endpoint would be the correct answer.
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.
✓Virtual machine extension, such as the Custom Script Extension.Correct answer▾
Why this is correct
A VM extension is designed to run guest-level tasks after the VM is created. The Custom Script Extension can download and execute a script to install IIS or perform configuration without requiring manual sign-in. This is the standard Azure feature for simple post-deployment automation on a VM.
✗Azure Policy with a modify effect.Wrong answer — click to see why▾
Why this is wrong here
Azure Policy with a modify effect enforces compliance rules on existing resources (e.g., tagging) but cannot install software or run scripts during VM deployment. It does not execute post-deployment configuration tasks like IIS installation.
★ When this WOULD be the correct answer
A question requiring automatic remediation of non-compliant resources, such as 'Ensure all VMs have a specific tag applied automatically when missing' or 'Enforce that all VMs use a particular disk encryption setting.'
Why candidates choose this
Candidates may confuse Azure Policy's 'modify' effect with deployment automation, thinking it can alter VM configuration after creation, similar to how it can add tags or change settings.
✗An availability set.Wrong answer — click to see why▾
Why this is wrong here
An availability set is used to ensure high availability by grouping VMs across fault and update domains, not for post-deployment software installation or configuration.
★ When this WOULD be the correct answer
A question asks: 'You need to ensure that at least two VMs running a web application are available during planned maintenance. Which feature should you use?'
Why candidates choose this
Candidates might confuse availability sets with automation features, thinking they can trigger scripts or configurations, but they are solely for redundancy and uptime.
✗A private endpoint.Wrong answer — click to see why▾
Why this is wrong here
A private endpoint is used to securely connect to Azure services over a private IP address within a virtual network, not to install software or run scripts on a VM after deployment.
★ When this WOULD be the correct answer
In a scenario where you need to securely access an Azure service (e.g., Azure Storage or SQL Database) from a virtual network without exposing it to the public internet, a private endpoint would be the correct answer.
Why candidates choose this
Candidates may confuse private endpoints with other networking features or think that 'private' implies automated configuration, but private endpoints do not perform post-deployment VM tasks.
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
Azure CLI
Azure CLI is a command-line tool that lets you manage Azure resources by typing commands instead of clicking through a web portal.
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.
About these practice questions
This AZ-104 question is part of Courseiva's 1,049-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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.