Microsoft Certified: Azure Administrator Associate (AZ-104) · Microsoft
Deploy and Manage Azure Compute Resources
11 practice questions covering 20% of the official Microsoft Certified: Azure Administrator Associate (AZ-104) blueprint. Every item includes a worked explanation of the correct answer.
View all 5 domains in Microsoft Certified: Azure Administrator Associate (AZ-104)
Syllabus Coverage & Domain Overview
This topic covers the compute services an Azure administrator is expected to deploy and run day to day. The official outline gives it a weight of 20 to 25 percent, which makes it one of the largest areas of the exam. It has four parts: automating deployments with Azure Resource Manager templates or Bicep files, creating and configuring virtual machines, provisioning and managing containers, and creating and configuring Azure App Service.
For automation, you are expected to read a template or Bicep file and work out what it will create. You should also be able to modify one, deploy it, export an existing deployment as a template, and convert a template to Bicep. For virtual machines, the outline covers creation, sizes, disks, Azure Disk Encryption, moving a VM between resource groups, subscriptions or regions, placement in availability zones or availability sets, and Virtual Machine Scale Sets. The container objectives cover Azure Container Registry, Azure Container Instances and Azure Container Apps, along with sizing and scaling for the last two. App Service covers plans, scaling, certificates and TLS, custom DNS mapping, backup, networking settings and deployment slots.
Several distinctions come up repeatedly. An availability set protects against hardware and maintenance events inside one datacenter, while availability zones separate instances into physically distinct locations. A scale set adds and removes identical instances automatically, which is different from simply placing several VMs in a set. Deployment mode matters for templates: incremental leaves unlisted resources alone, while complete removes them from the target resource group. Container Instances suit simple, short-lived or single-group workloads, whereas Container Apps add managed scaling and an environment for several apps. For App Service, scaling up changes the plan's size or tier, scaling out changes the instance count, and the tier decides which features, such as slots or autoscale, are available at all.
Questions are usually short scenarios with a requirement, a constraint and a list of plausible options. The constraint is often the deciding detail, for example a ban on public IP addresses, a need to keep a database setting from moving with a swap, or a need to avoid deleting existing resources. Common traps include choosing a feature the current plan tier does not support, mixing up scale up with scale out, assuming a template deployment removes resources when it is run in incremental mode, and forgetting that moving a VM to another region is a different operation from moving it to another resource group. Read every option for the word that breaks it, such as a region, a tier or a scope.
The most effective preparation is hands-on. Deploy a small Bicep file, then change it and redeploy it in both modes to see the difference. Build a VM, attach and resize a disk, and create a scale set with an autoscale rule. Run a container in both container services, and create an App Service with a staging slot and swap it. Then practise reading templates and command output without running them, since the exam often asks you to interpret rather than build.
In the official Microsoft Certified: Azure Administrator Associate (AZ-104) examination blueprint, Deploy and Manage Azure Compute Resources carries a weightage of 20%. Out of the total examination duration of 2 hr, candidates should budget approximately 24 min for questions from this domain to maintain pace across the paper.
How to Master Deploy and Manage Azure Compute Resources for Microsoft Certified: Azure Administrator Associate (AZ-104)
Our 11 published questions in Deploy and Manage Azure Compute Resources are written for PrepIQ Hub and checked as set out in our editorial policy. Each item is written to the medium difficulty level of the Microsoft exam:
- Targeted Topic Drills: Launch Topic Practice mode to work exclusively through Deploy and Manage Azure Compute Resources items and review the step-by-step derivation after each submission.
- Negative Marking Discipline: The Microsoft Certified: Azure Administrator Associate (AZ-104) applies no negative marking penalty, so practice eliminating the three distractors systematically on every Deploy and Manage Azure Compute Resources item.
- Benchmark Target: Aim for at least 70% accuracy in Deploy and Manage Azure Compute Resources drills before moving to full-paper simulations.
Deploy and Manage Azure Compute Resources worked examples
Deploy and Manage Azure Compute Resources questions from the Microsoft Certified: Azure Administrator Associate (AZ-104) syllabus, answered in full. Try each one before opening the explanation.
Example 1 · Deploy and Manage Azure Compute Resources · medium
You deploy 12 identical Azure Virtual Machines into a single Availability Set configured with 3 Fault Domains (FDs) and 5 Update Domains (UDs). If Microsoft performs a planned host OS maintenance update across the datacenter that reboots one Update Domain at a time, what is the minimum number of VMs guaranteed to remain running during any single update domain reboot?
Show answer and explanation
Correct answer: B. 9 virtual machines (at most 3 VMs in a single Update Domain reboot)
Why
With 12 VMs distributed round-robin across 5 Update Domains (UD0 through UD4), the distribution across the 5 UDs is 3, 3, 2, 2, 2 VMs (12 = 2*5 + 2). During planned maintenance, at most one Update Domain (3 VMs in the largest UD) is rebooted at a time, guaranteeing at least 12 - 3 = 9 VMs remain online.
- A. 8 virtual machines (assuming 1 Fault Domain of 4 VMs goes offline) — Planned maintenance reboots one Update Domain (max 3 VMs), whereas an unplanned rack power failure affects one Fault Domain (4 VMs).
- C. 10 virtual machines (assuming 2 VMs per Update Domain across 6 UDs) — With 5 Update Domains and 12 VMs, two of the Update Domains contain 3 VMs (ceil(12/5) = 3).
- D. 6 virtual machines (assuming half the fleet reboots simultaneously) — Azure Update Domains reboot sequentially one UD at a time, never 50% of a 5-UD Availability Set.
Example 2 · Deploy and Manage Azure Compute Resources · medium
A security policy prohibits assigning Public IP addresses to any Azure Virtual Machine and forbids opening inbound ports TCP 3389 (RDP) or TCP 22 (SSH) from the internet. Administrators still need browser-based RDP and SSH access to the private VMs directly from the Azure portal over TLS (port 443). Which managed PaaS service deployed into a dedicated /26 subnet named AzureBastionSubnet provides this?
Show answer and explanation
Correct answer: C. Azure Bastion deployed in AzureBastionSubnet (/26)
Why
Azure Bastion is a fully managed PaaS service that you deploy into a dedicated subnet named AzureBastionSubnet, which must be /26 or larger. It lets administrators open RDP and SSH sessions to virtual machines straight from the Azure portal in an HTML5 browser session over TLS on port 443. The target VMs need no public IP address, and their network security groups do not need inbound 3389 or 22 open from the internet. Bastion reaches the VMs over their private IP addresses inside the virtual network, or across peered virtual networks when the SKU supports it. This matches every requirement in the policy. The most common trap is picking a service that sounds network-related, such as NAT Gateway, because the question mentions a subnet. Another trap is choosing a jump box VM with a public IP, which would violate the policy. Remember the exact subnet name and the /26 minimum size, since both are tested.
- A. Azure Front Door global CDN and WAF edge proxy — Azure Front Door is a global layer 7 entry point for HTTP and HTTPS web applications, offering acceleration, load balancing and WAF protection. It does not provide RDP or SSH administrative sessions to private virtual machines.
- B. Azure NAT Gateway attached to AzureBastionSubnet — Azure NAT Gateway provides outbound-only internet connectivity with managed SNAT for resources in a subnet. It does not accept inbound connections or deliver browser-based RDP and SSH, and it is not what runs in AzureBastionSubnet.
- D. Azure Traffic Manager priority routing profile — Azure Traffic Manager is a DNS-based traffic routing service that directs clients to endpoints using methods such as priority or performance. It does not proxy traffic, so it cannot broker RDP or SSH sessions into private virtual machines.
Example 3 · Deploy and Manage Azure Compute Resources · hard
A web team uses Azure App Service (Standard S1 plan) with a production slot and a staging deployment slot. The staging slot uses a test database connection string (DB_CONN = Server=staging-sql...), while production uses the live database (DB_CONN = Server=prod-sql...). When the team performs a slot swap from staging to production, they must ensure production keeps its live DB_CONN value rather than receiving the staging-sql string. What should they configure?
Show answer and explanation
Correct answer: C. Mark the DB_CONN connection string as a Deployment slot setting
Why
When you swap deployment slots in Azure App Service, the content and most configuration move together, so by default the staging slot's app settings and connection strings travel to production with the code. To stop a value from moving, you mark it as a Deployment slot setting, often called a sticky or slot-specific setting. A sticky setting stays attached to the slot where it was defined, so production keeps its live DB_CONN pointing at prod-sql, and staging keeps the test server string, no matter how many swaps occur. You configure it in the web app's Environment variables or Configuration blade by selecting the deployment slot setting checkbox for that entry in each slot. The common trap is assuming the swap only moves code, or that you must manually edit values around each release. Slot settings are the built-in, zero-downtime, repeatable mechanism, and they require a plan tier that supports slots, such as Standard S1.
- A. Scale the App Service Plan down to the Free (F1) tier before swapping — Free (F1) is a plan tier that does not support deployment slots at all, since slots need Standard, Premium, or Isolated. Scaling down would remove the slots rather than control which settings swap.
- B. Delete the DB_CONN setting before each swap and re-enter it manually — Deleting and re-entering the setting by hand is a fragile, error-prone manual process that risks leaving production without a valid connection string and causing downtime or outages. It is not the built-in mechanism for keeping a value slot-specific.
- D. Stop both the production and staging web apps prior to swapping — Stopping the apps only causes an outage and defeats the warm-up and zero-downtime purpose of a swap. Running state has no effect on whether a setting is sticky, so the connection string would still swap.
Example 4 · Deploy and Manage Azure Compute Resources · hard
A resource group named RG-App currently contains three resources: VM1, VNet1, and Storage1. An administrator runs az deployment group create against RG-App using a Bicep template that defines only Storage1 and a new VM2, and specifies --mode Complete. Assuming no resource locks exist, what happens to VM1 and VNet1?
Show answer and explanation
Correct answer: D. Both VM1 and VNet1 are deleted because they are omitted
Why
In Complete deployment mode, Azure Resource Manager deletes any existing resources in the target resource group that are not explicitly declared in the template being deployed. Because VM1 and VNet1 are omitted from the Bicep template, ARM deletes them (whereas Incremental mode leaves undeclared resources untouched).
- A. Both VM1 and VNet1 remain untouched while VM2 is added to RG-App — Leaving existing undeclared resources untouched is the behavior of Incremental mode, not Complete mode.
- B. The deployment fails immediately with a resource group conflict error — Complete mode is designed to reconcile the resource group state to match the template by deleting omitted resources.
- C. VM1 and VNet1 are automatically moved to the default resource group — ARM never moves undeclared resources to another resource group during Complete mode.
Example 5 · Deploy and Manage Azure Compute Resources · medium
A platform engineering team has perfected a golden ARM / Bicep template for deploying compliant virtual networks and wants to store it as a versioned, first-class Azure resource inside a central resource group (RG-Templates) so other teams can deploy it via Azure RBAC read permissions without needing SAS tokens to a storage account or access to a private Git repo. Which Azure service should they use?
Show answer and explanation
Correct answer: B. Azure Template Specs (Microsoft.Resources/templateSpecs)
Why
Template Specs are the Azure feature built for this scenario. A template spec is an Azure resource of type Microsoft.Resources/templateSpecs that holds an ARM template, or a Bicep file that is compiled to JSON when published, and each update is saved as a numbered version. Because it is a real resource inside a resource group such as RG-Templates, access is controlled by Azure RBAC. Users who have read access to the spec can deploy it, and they do not need access to the underlying storage account or repository. This removes the need for SAS tokens on a blob URL and for credentials to a private Git repo, which are the usual alternatives for sharing templates. Deployments can reference the spec by resource ID and version, and it can also be used as a module in Bicep. The common trap is choosing Azure Compute Gallery because it is also a versioned, shareable resource. It versions VM images and applications, not infrastructure-as-code templates.
- A. Azure Compute Gallery (formerly Shared Image Gallery) definitions — Azure Compute Gallery (formerly Shared Image Gallery) stores and shares versioned VM images and VM application packages, and it is shared through RBAC too. It has no ability to hold ARM or Bicep deployment templates, so it does not fit even though it is versioned.
- C. Azure Bastion Developer SKU browser session connection templates — Azure Bastion Developer SKU gives browser-based RDP and SSH access to virtual machines without exposing public IP addresses. It is a connectivity service and has no concept of storing or versioning deployment templates.
- D. Azure Recovery Services vault virtual machine backup policies — A Recovery Services vault holds backup data, recovery points and backup policies that define schedule and retention for protected VMs. It protects workloads and does not store or share infrastructure deployment templates.
Example 6 · Deploy and Manage Azure Compute Resources · medium
An administrator wants to deploy 4 Azure Storage accounts (stlogs0, stlogs1, stlogs2, stlogs3) across a resource group using a single Bicep resource block without duplicating the resource declaration four times. Which Bicep syntax construct iterates over a range to provision multiple instances of a resource?
Show answer and explanation
Correct answer: A. A [for i in range(0, 4): { ... }] loop expression on the resource
Why
Bicep lets you deploy many copies of one resource by adding a for expression to the resource declaration. The syntax is a bracketed loop such as [for i in range(0, 4): { ... }], where range(0, 4) produces the integers 0, 1, 2 and 3, and the loop body defines the properties of each instance. Using the loop index in the name, for example 'stlogs${i}', yields stlogs0 through stlogs3 from a single declaration. The same loop construct works on modules, variables, properties and outputs, and you can also loop over an array of values or objects. A common trap is forgetting that range takes a start index and a count, not an end value, so range(0, 4) gives four items. Another trap is confusing resource iteration with deployment behavior settings, which control what happens to existing resources and do not create new instances.
- B. Four nested CanNotDelete lock resources inside the metadata block — A CanNotDelete lock is a management lock that protects a resource from deletion, and it is a separate resource type that applies to a scope. It does not iterate and does not create storage accounts, and a metadata block only holds descriptive information about the file.
- C. Setting the resource group deployment mode parameter to Complete — Complete deployment mode makes Azure Resource Manager delete resources in the resource group that are not in the template, whereas Incremental leaves them alone. It governs cleanup of undeclared resources and has no effect on how many instances a single declaration creates.
- D. Adding a dependsOn array pointing the storage account to itself — The dependsOn property orders deployment by making one resource wait for another. A resource that depends on itself creates a circular dependency, which fails validation, and in any case dependsOn never creates multiple instances.
Every worked example on this page passed our independent verification before publication — how that works is set out in our editorial policy. Spotted an error? Tell us through the contact page and we will correct it.
All 6 Deploy and Manage Azure Compute Resources questions with answers
- You deploy 12 identical Azure Virtual Machines into a single Availability Set configured with 3 Fault Domains (FDs)…
- A security policy prohibits assigning Public IP addresses to any Azure Virtual Machine and forbids opening inbound…
- A web team uses Azure App Service (Standard S1 plan) with a production slot and a staging deployment slot. The staging…
- A resource group named RG-App currently contains three resources: VM1, VNet1, and Storage1. An administrator runs az…
- A platform engineering team has perfected a golden ARM / Bicep template for deploying compliant virtual networks and…
- An administrator wants to deploy 4 Azure Storage accounts (stlogs0, stlogs1, stlogs2, stlogs3) across a resource group…
All Syllabus Domains in Microsoft Certified: Azure Administrator Associate (AZ-104)
Manage Azure Identities and Governance
11 questions · 20%Implement and Manage Storage
11 questions · 15%Deploy and Manage Azure Compute Resources (Current domain)
11 questions · 20%Implement and Manage Virtual Networking
12 questions · 25%Monitor and Maintain Azure Resources
15 questions · 20%
Microsoft and Azure are trademarks of Microsoft Corporation. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Microsoft Corporation.