Question 1,048 of 1,049
AZ-104 Deploy and Manage Azure Compute Practice Question
You need to run a script on VM-App02 immediately after deployment to install a custom monitoring agent. The solution should not require opening additional inbound management ports. What should you use?
⚠ Common exam trap
Many exam-takers confuse the Custom Script Extension with other VM management features like boot diagnostics or inbound port rules, mistakenly thinking they need to open a port (like WinRM or SSH) to run a script, when the extension uses the VM's outbound-only communication channel.
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
✓
Custom Script Extension
The Custom Script Extension (CSE) is the correct choice because it allows you to run a script on a VM immediately after deployment without opening any inbound management ports. CSE downloads and executes scripts on the VM via the Azure fabric, using the VM's outbound connectivity to Azure storage or GitHub, and does not require any inbound port (like RDP or WinRM) to be open. This meets the requirement of not opening additional inbound management ports while enabling post-deployment configuration.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Boot diagnostics
Why it's wrong here
Boot diagnostics is a debugging feature that captures the VM's serial console output and screenshots during startup, storing them in an Azure managed storage account for troubleshooting boot failures, kernel panics, or OS crashes. It provides visibility into the boot process only; it has no execution engine and cannot invoke scripts or install software. It is a diagnostic telemetry channel, not a management or configuration capability.
When this WOULD be correct
When you need to troubleshoot a VM that fails to boot or crashes, and you require access to console logs or screenshots to diagnose the issue without RDP/SSH.
- ✓
Custom Script Extension
Why this is correct
Custom Script Extension is an Azure VM extension that executes arbitrary scripts at deployment completion through the VM agent. It runs as SYSTEM/root via the extension handler, can source script content from Azure Storage, GitHub, or inline, and returns provisioning status after successful execution. This makes it the native post-deployment automation mechanism for installing software, unlike telemetry or network controls.
- ✗
An inbound NSG rule for WinRM
Why it's wrong here
An inbound NSG rule permitting WinRM (TCP/5985 or 5986) would expose the management endpoint to the network, allowing remote PowerShell sessions to connect to the VM. Merely opening the port does not initiate a deployment-time install; it requires a separate automation client to connect and execute commands, and broad inbound access violates security best practices. The requirement is to run a script immediately after deployment, which requires an agent-driven extension, not a network permit.
When this WOULD be correct
If the question required remote management of a VM after deployment (e.g., to run a script or configure settings) and allowed opening management ports, then an inbound NSG rule for WinRM would be correct. For example: 'You need to remotely execute PowerShell commands on a VM after deployment. What should you configure?'
- ✗
A proximity placement group
Why it's wrong here
A proximity placement group is a logical grouping used to force virtual machines into the same Azure datacenter or network backbone to reduce inter-VM network latency for tightly coupled workloads such as HPC or low-latency tiers. It influences physical placement and availability topology, and does not interact with the OS, run scripts, or perform software installation. Its purpose is scheduling/locality, not configuration management.
When this WOULD be correct
You need to ensure that multiple VMs in an availability set are as close as possible to minimize network latency for a latency-sensitive application. A proximity placement group would be the correct choice to co-locate the VMs.
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.
✓Custom Script ExtensionCorrect answer▾
Why this is correct
Custom Script Extension is an Azure VM extension that executes arbitrary scripts at deployment completion through the VM agent. It runs as SYSTEM/root via the extension handler, can source script content from Azure Storage, GitHub, or inline, and returns provisioning status after successful execution. This makes it the native post-deployment automation mechanism for installing software, unlike telemetry or network controls.
✗Boot diagnosticsWrong answer — click to see why▾
Why this is wrong here
Boot diagnostics captures serial console output and screenshots for troubleshooting boot failures, not for running scripts or installing software after deployment.
★ When this WOULD be the correct answer
When you need to troubleshoot a VM that fails to boot or crashes, and you require access to console logs or screenshots to diagnose the issue without RDP/SSH.
Why candidates choose this
Candidates may confuse boot diagnostics with a method to execute commands at startup, or think it can run scripts during the boot process.
✗An inbound NSG rule for WinRMWrong answer — click to see why▾
Why this is wrong here
An inbound NSG rule for WinRM would open a management port (5985/5986), violating the requirement to not open additional inbound management ports. The question explicitly prohibits this.
★ When this WOULD be the correct answer
If the question required remote management of a VM after deployment (e.g., to run a script or configure settings) and allowed opening management ports, then an inbound NSG rule for WinRM would be correct. For example: 'You need to remotely execute PowerShell commands on a VM after deployment. What should you configure?'
Why candidates choose this
Candidates may think WinRM is needed to run scripts remotely, but they overlook the explicit constraint against opening inbound management ports. The Custom Script Extension runs during deployment without requiring open ports.
✗A proximity placement groupWrong answer — click to see why▾
Why this is wrong here
A proximity placement group is used to reduce network latency between VMs by ensuring they are physically close in the datacenter. It does not run scripts or install software, so it cannot deploy a custom monitoring agent.
★ When this WOULD be the correct answer
You need to ensure that multiple VMs in an availability set are as close as possible to minimize network latency for a latency-sensitive application. A proximity placement group would be the correct choice to co-locate the VMs.
Why candidates choose this
Candidates may confuse 'proximity' with 'immediate' or think it relates to running tasks close to deployment, but it is purely a placement feature for latency optimization.
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
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 11, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.