Focus keyphrase: AZ-104 practice questions
Use these AZ-104 practice questions to review the Deploy and manage Azure compute resources objective domain for the Microsoft Azure Administrator exam. This set focuses on virtual machines, availability options, VM resizing, ARM template behavior, VM extensions, scale sets, App Service, and Azure Container Instances.
These are original certification-style questions based on public Microsoft exam objectives and official Azure documentation. They are realistic and exam-like, but they are not copied, paraphrased, or reconstructed from real exam-dump content.
AZ-104 Questions 21-30: Azure compute practice
For each item, choose the best answer, then review the explanation and distractor analysis. AZ-104 compute questions usually test whether you can match a requirement to the right Azure administrator action: zone placement, deallocation before resize, incremental template deployments, deployment slots, or serverless container hosting.
Question 21: Surviving a datacenter-level failure
Scenario: A company runs a stateless web tier on Azure virtual machines. The application must remain available if a single physical datacenter in the Azure region becomes unavailable. The selected Azure region supports availability zones.
Choose one answer.
- Deploy two VMs to the same availability set in one zone
- Deploy replicated VMs across multiple availability zones and place them behind a load balancer
- Deploy one larger VM size with premium SSD disks
- Enable boot diagnostics on the existing VM
Correct answer: B — Deploy replicated VMs across multiple availability zones and place them behind a load balancer
Explanation: Availability zones are physically separate locations within a supported Azure region. Placing VM instances across zones protects the application from the loss of a single zone, and a load balancer can distribute traffic to healthy instances.
Why the other options are wrong
- A. An availability set spreads VMs across fault and update domains inside a datacenter-scale boundary; it does not provide zone-level isolation.
- C. A larger VM improves capacity, not resiliency across datacenters.
- D. Boot diagnostics helps troubleshoot startup issues; it does not make the application highly available.
Official reference: Availability options for Azure Virtual Machines
Question 22: Resizing a virtual machine when the target size is unavailable
Scenario: An administrator needs to resize a production VM to a size that is supported in the region, but the size is not currently listed as available for the running VM. The administrator can tolerate a planned outage during a maintenance window.
Choose one answer.
- Deallocate the VM, resize it, and then start the VM
- Enable accelerated networking and retry the resize
- Convert the OS disk from standard SSD to premium SSD
- Create a management lock on the VM and retry the resize
Correct answer: A — Deallocate the VM, resize it, and then start the VM
Explanation: If the desired VM size is unavailable on the cluster currently hosting the VM, deallocating the VM allows Azure to move it to hardware that supports the requested size. The VM is stopped during this process, so a maintenance window is appropriate.
Why the other options are wrong
- B. Accelerated networking changes network performance characteristics; it does not make an unavailable VM size appear.
- C. Disk type affects storage performance and cost, not the compute cluster’s available VM sizes.
- D. A lock prevents accidental changes; it will not help perform a resize.
Official reference: Resize a virtual machine
Question 23: Updating resources without deleting unrelated resources
Scenario: A resource group contains several production resources. You need to deploy an ARM template that updates one virtual machine and adds a network interface. Resources not described in the template must remain in the resource group.
Choose one answer.
- Deploy the template in complete mode
- Deploy the template in incremental mode
- Delete the resource group and redeploy all resources
- Convert the resource group to a management group
Correct answer: B — Deploy the template in incremental mode
Explanation: Incremental deployment mode adds or updates the resources declared in the template without deleting resources that are not included. That is the safer fit when the resource group contains existing production resources outside the template scope.
Why the other options are wrong
- A. Complete mode can delete resources that exist in the target scope but are not present in the template, which conflicts with the requirement.
- C. Deleting the resource group is destructive and unnecessary.
- D. Management groups organize subscriptions for governance; they do not control ARM deployment behavior.
Official reference: Azure Resource Manager deployment modes
Question 24: Running a post-deployment script on a VM
Scenario: After deploying a Windows Server VM, an administrator must install a monitoring agent and apply a small configuration script. The solution should run through Azure VM management without requiring the administrator to open an interactive remote desktop session.
Choose one answer.
- Use the Custom Script Extension
- Create a read-only resource lock
- Enable Azure Storage lifecycle management
- Move the VM to another resource group
Correct answer: A — Use the Custom Script Extension
Explanation: VM extensions are used for post-deployment configuration and automation tasks. The Custom Script Extension can download and run scripts on Azure VMs, which fits one-time installation or configuration steps.
Why the other options are wrong
- B. A read-only lock prevents changes to the resource; it does not run software installation tasks.
- C. Storage lifecycle management manages blob tiering and retention, not VM configuration.
- D. Moving a VM between resource groups changes organization, not guest OS configuration.
Official reference: Azure virtual machine extensions and features
Question 25: Scaling a web tier based on demand
Scenario: A web application runs on identical VM instances. During business hours CPU utilization often exceeds 80 percent, and at night it drops below 20 percent. The company wants Azure to add and remove instances automatically while keeping all instances configured consistently.
Choose one answer.
- Deploy a virtual machine scale set and configure autoscale rules
- Resize a single VM to the largest available size
- Configure a resource group budget alert
- Enable blob versioning on the application storage account
Correct answer: A — Deploy a virtual machine scale set and configure autoscale rules
Explanation: Virtual machine scale sets are designed to manage a group of load-balanced VM instances. Autoscale rules can increase or decrease the instance count based on metrics such as CPU utilization.
Why the other options are wrong
- B. Scaling up a single VM may increase capacity, but it does not add or remove instances automatically and creates a larger single point of failure.
- C. Budget alerts help monitor spending; they do not scale compute resources.
- D. Blob versioning protects blob data and has no effect on VM instance count.
Official reference: What are virtual machine scale sets?
Question 26: Reducing risk during a web app release
Scenario: A company hosts a production web app on Azure App Service. Developers need to deploy a new version to a separate environment, validate it with production-like settings, and then promote it with minimal downtime. They also want a quick rollback path.
Choose one answer.
- Use an App Service deployment slot and perform a slot swap
- Stop the production App Service plan and upload files by FTP
- Create a new storage account with RA-GRS
- Enable VM boot diagnostics
Correct answer: A — Use an App Service deployment slot and perform a slot swap
Explanation: Deployment slots let you host separate versions of an App Service app. You can validate the new version in a staging slot and then swap it into production, with the previous production version available for rollback.
Why the other options are wrong
- B. Stopping production and uploading files manually increases downtime and release risk.
- C. Storage redundancy does not manage App Service application releases.
- D. Boot diagnostics applies to virtual machines, not App Service deployment workflows.
Official reference: Set up staging environments in Azure App Service
Question 27: Choosing scale up versus scale out
Scenario: An App Service web app is running on an App Service plan that has enough instances, but each instance is CPU constrained because the app requires more processor and memory resources per instance. The administrator must increase the compute resources available to each instance.
Choose one answer.
- Scale up the App Service plan to a higher pricing tier
- Add a stored access policy to the app’s storage container
- Create an Azure Container Instance
- Add a read-only lock to the resource group
Correct answer: A — Scale up the App Service plan to a higher pricing tier
Explanation: Scaling up changes the App Service plan tier or size, providing more CPU, memory, and features per instance. Scaling out would add instances, but the scenario specifically needs more resources for each instance.
Why the other options are wrong
- B. Stored access policies manage SAS constraints for storage access, not web app compute capacity.
- C. Azure Container Instances runs containers; it does not change the resources available to an existing App Service plan.
- D. A read-only lock restricts changes and would make scaling harder, not easier.
Official reference: Overview of Azure App Service
Question 28: Running a container without managing servers
Scenario: A team needs to run a short-lived containerized data processing job once per day. They do not need Kubernetes orchestration, and they want the simplest Azure service that runs an isolated container without managing virtual machines.
Choose one answer.
- Azure Container Instances
- Azure Virtual Desktop
- Azure Files
- Azure Policy guest configuration
Correct answer: A — Azure Container Instances
Explanation: Azure Container Instances provides a fast way to run isolated containers in Azure without managing VMs or adopting a full orchestrator such as Kubernetes. It is a good fit for simple, task-based container workloads.
Why the other options are wrong
- B. Azure Virtual Desktop provides virtualized desktops and apps, not simple container execution.
- C. Azure Files provides managed file shares; it does not run containers.
- D. Guest configuration audits or configures machines; it is not a container hosting service.
Official reference: Serverless containers in Azure Container Instances
Question 29: Protecting VMs from planned maintenance events
Scenario: An application uses two VMs in a region where the team is not using availability zones. The administrator wants Azure to distribute the VMs across separate fault domains and update domains so that planned maintenance and localized hardware failures are less likely to affect both VMs at the same time.
Choose one answer.
- Place the VMs in the same availability set
- Place both VMs on the same OS disk
- Enable public IP addresses on both VMs
- Store the VM disks in the archive access tier
Correct answer: A — Place the VMs in the same availability set
Explanation: Availability sets distribute VMs across fault domains and update domains. This helps reduce the chance that a hardware failure or planned platform maintenance event affects every instance of the application simultaneously.
Why the other options are wrong
- B. VMs cannot share a single OS disk in that way, and it would not improve availability.
- C. Public IP addresses affect connectivity, not fault or update domain placement.
- D. Archive tier is a Blob Storage access tier and is not used for managed VM OS disks.
Official reference: Availability sets overview
Question 30: Standardizing VM deployments across regions
Scenario: A company builds a hardened Linux VM image that includes required security agents and baseline configuration. Administrators need to version the image and replicate it to multiple Azure regions so teams can create consistent VMs from the approved image.
Choose one answer.
- Use Azure Compute Gallery with image definitions and image versions
- Use a storage account lifecycle rule
- Use a public IP prefix
- Use a management group policy exemption only
Correct answer: A — Use Azure Compute Gallery with image definitions and image versions
Explanation: Azure Compute Gallery helps manage and share VM images. Image definitions and versions support standardized image management, and image versions can be replicated to target regions for consistent VM deployment.
Why the other options are wrong
- B. Lifecycle rules automate blob tiering or deletion; they do not manage VM image versions.
- C. Public IP prefixes reserve groups of public IP addresses, not VM images.
- D. A policy exemption changes governance enforcement for selected resources; it does not distribute an approved image.
Official reference: Store and share images in an Azure Compute Gallery
Answer key: AZ-104 Questions 21-30
| Question | Correct answer | Objective/domain |
|---|---|---|
| 21 | B | Deploy and manage Azure compute resources — VM availability zones |
| 22 | A | Deploy and manage Azure compute resources — VM resize |
| 23 | B | Deploy and manage Azure compute resources — ARM deployment mode |
| 24 | A | Deploy and manage Azure compute resources — VM extensions |
| 25 | A | Deploy and manage Azure compute resources — scale sets and autoscale |
| 26 | A | Deploy and manage Azure compute resources — App Service deployment slots |
| 27 | A | Deploy and manage Azure compute resources — App Service scale up |
| 28 | A | Deploy and manage Azure compute resources — Azure Container Instances |
| 29 | A | Deploy and manage Azure compute resources — availability sets |
| 30 | A | Deploy and manage Azure compute resources — Azure Compute Gallery |
Sources
- Microsoft Learn: Study guide for Exam AZ-104: Microsoft Azure Administrator
- Microsoft Learn: Availability options for Azure Virtual Machines
- Microsoft Learn: Resize a virtual machine
- Microsoft Learn: Azure Resource Manager deployment modes
- Microsoft Learn: Azure virtual machine extensions and features
- Microsoft Learn: What are virtual machine scale sets?
- Microsoft Learn: Set up staging environments in Azure App Service
- Microsoft Learn: Overview of Azure App Service
- Microsoft Learn: Serverless containers in Azure Container Instances
- Microsoft Learn: Store and share images in an Azure Compute Gallery
