Azure Compute Services
AZ-900 AZ-900 · Describe Azure architecture and services
Three ways to run code
Azure offers three broad ways to run a workload: virtual machines, containers, and functions. The exam expects you to compare them and pick the right one for a situation. The comparison turns on two questions: how much control do you need over the environment, and how much management are you willing to do?
Virtual machines (VMs) are IaaS: a complete virtual computer with its own operating system, running on shared physical hardware. You control the OS, you install what you need, and you manage patching and scaling. VMs suit workloads that need a specific OS, legacy applications, and anything you would previously have run on a physical server. They are the most flexible and the most work.
Containers package an application with its libraries and dependencies into a lightweight, portable unit that runs on a shared operating system. Unlike a VM, a container does not carry its own OS — it shares the host's OS kernel — so containers start in seconds, use fewer resources, and run consistently anywhere: on a developer's laptop, in Azure, or in another cloud. Azure offers Azure Container Instances (run a single container quickly, without managing servers) and Azure Kubernetes Service (AKS) (orchestrate many containers at scale). Containers suit microservices, applications that must run the same way in several environments, and workloads that scale by adding identical copies.
Functions are serverless: you write code that runs in response to an event, and Azure manages everything else. Azure Functions bills per execution and scales to zero when idle. Functions suit short, event-driven tasks — processing an uploaded file, responding to a message, running a scheduled job — and they are the wrong tool for long-running or stateful work.
| Virtual machines | Containers | Functions | |
|---|---|---|---|
| Service type | IaaS | PaaS / IaaS depending on service | PaaS (serverless) |
| You manage | OS, runtime, app | App and its dependencies | Code only |
| Startup time | Minutes | Seconds | Milliseconds to seconds |
| Best for | Full control, legacy apps, specific OS needs | Microservices, portability, consistent environments | Event-driven, short tasks, scale-to-zero |
Virtual machine options
Within VMs, the exam names four options. Azure Virtual Machines are the base offering: pick a size (CPU, memory), an OS image (Windows or Linux), and a region, and you have a server. Azure Virtual Machine Scale Sets (VMSS) create and manage a group of identical, load-balanced VMs that scale automatically with demand — the right choice for a web tier that needs to grow and shrink. Availability sets, covered in the architecture guide, spread VMs across fault and update domains inside one datacenter for a 99.95% SLA. Azure Virtual Desktop is desktop virtualisation: Windows desktops and applications delivered from Azure to any device, with multi-session Windows 10/11 so several users can share one VM — the answer whenever a scenario describes remote workers needing a full Windows desktop from anywhere.
What a virtual machine needs
Creating a VM requires more than the VM itself. The exam lists the supporting resources: a resource group to hold everything; a virtual network for the VM to communicate on; a network interface (NIC) connecting the VM to that network; and storage — a managed disk for the operating system, and optionally data disks. Public IP addresses and network security groups are common additions but the four above are the core requirements. If a question asks what is needed to create a VM, think: group, network, interface, disk.
Application hosting options
When the question is "where should this application run?", the exam offers three hosting answers. Web apps (Azure App Service) host web applications and APIs on a managed platform — deploy code, get scaling, patching, and built-in deployment slots, without managing servers. Containers (Container Instances or AKS) host applications packaged as containers, for portability and microservices. Virtual machines host anything, with full control, at the cost of managing the OS. The decision rule from the service-types guide applies: if the team wants to focus on code, web apps or containers; if it needs the OS, VMs.
Two refinements help with scenario questions. First, App Service plans determine the region, size, and features of the web apps running on them — and multiple web apps can share one plan, which is the cost-efficient way to host several small apps. Second, deployment slots in App Service let you stage a new version (a "staging" slot) and swap it into production with no downtime, rolling back just as easily. Slots are a favourite exam detail for questions about zero-downtime deployments.
Worked example: hosting a new online store
A retailer is building a new online store. The storefront is a web application that must scale for holiday traffic; product images need processing when uploaded; and the stock system is a legacy application requiring a specific Windows Server version. The hosting design: App Service for the storefront (managed platform, autoscaling, deployment slots for safe releases), Azure Functions for image processing (event-driven, scale-to-zero), and a virtual machine for the legacy stock system (full OS control). A scale set could replace App Service if the team wanted VM-level control of the storefront — but since the team wants to focus on code, App Service is the better fit. One application, three compute types, each chosen for its workload.
Choosing compute: a decision checklist
When an exam scenario asks you to pick a compute option, run through these questions in order. First, does the workload need a specific operating system or full control of the environment? If yes, the answer is a virtual machine — nothing else gives you the OS. Second, is the work short and triggered by an event? If yes, the answer is Functions — serverless fits bursts and scheduled tasks better than anything that bills while idle. Third, does the application need to run identically in several environments, or is it built from small independent services? If yes, the answer is containers. Fourth, is it a web application or API the team wants to deploy without managing servers? If yes, the answer is App Service. And finally, does the workload need many identical VMs that scale automatically? If yes, the answer is a scale set. Most scenario questions are decided by the first question that gets a "yes" — work the list from the top and you will land on the right service.
One more distinction the exam probes: scaling up versus scaling out in compute terms. Scaling up a VM means resizing it to a larger size (more CPU and memory) — simple, but limited by the largest available size, and it requires a restart. Scaling out means adding more instances — the scale set and App Service approach — which has no practical ceiling and no downtime, but requires the application to run across several instances. Cloud-native designs favour scaling out; legacy applications that cannot split across instances are stuck scaling up. When a question describes adding instances, think scale out; when it describes a bigger machine, think scale up.
Exam traps to watch for
- Recommending virtual machines for everything. VMs are the answer only when the workload needs OS control; code-focused teams should get App Service or Functions.
- Confusing containers with virtual machines. Containers share the host OS and start in seconds; VMs carry their own OS and take minutes to start.
- Forgetting what a VM needs. A VM requires a resource group, a virtual network, a network interface, and storage — the exam lists these as the required resources.
- Mixing up VM Scale Sets with availability sets. Scale sets create identical autoscaling VMs; availability sets spread VMs across fault and update domains for availability.
Practice questions
Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.
Q1.A company runs a web application that must automatically add servers during traffic peaks and remove them afterwards. All servers must be identical and load-balanced. Which Azure service should it use?
Explanation: Virtual Machine Scale Sets create and manage a group of identical, load-balanced VMs that scale automatically with demand. A single VM cannot scale or balance load. Azure Virtual Desktop delivers Windows desktops to users, not web servers. Azure Functions run short event-driven code, not a web application tier.
Exam objective: AZ-900 Describe Azure compute and networking services: describe virtual machine options, including Azure virtual machines, Azure Virtual Machine Scale Sets, availability sets, and Azure Virtual Desktop
Q2.A company wants its remote employees to access a full Windows desktop with Office applications from any device, including personal laptops. Which Azure service provides this?
Explanation: Azure Virtual Desktop is desktop virtualisation: Windows desktops and applications delivered from Azure to any device. App Service hosts web applications, not desktops. Container Instances run containers, not interactive desktops. Functions run short event-driven code.
Exam objective: AZ-900 Describe Azure compute and networking services: describe virtual machine options, including Azure virtual machines, Azure Virtual Machine Scale Sets, availability sets, and Azure Virtual Desktop
Q3.A developer builds an application from small independent services that must run identically on a laptop, in testing, and in Azure, and start within seconds. Which compute approach best fits?
Explanation: Containers package an application with its dependencies so it runs identically in any environment and starts in seconds — the microservices fit. Virtual machines carry a full OS, start in minutes, and are heavier. Functions are for short event-driven tasks, not for services that run continuously. A dedicated physical server is the opposite of portable.
Exam objective: AZ-900 Describe Azure compute and networking services: compare compute types, including containers, virtual machines, and functions
Q4.Which resources are required to create an Azure virtual machine?
Explanation: A VM needs a resource group to live in, a virtual network to communicate on, a network interface connecting it to that network, and storage (a managed disk) for its OS. A load balancer and VPN gateway are optional additions, and availability zones are a placement choice, not a requirement. App Service plans and deployment slots belong to web apps, not VMs. A function app is unrelated to VMs.
Exam objective: AZ-900 Describe Azure compute and networking services: describe the resources required for virtual machines
Q5.A team wants to deploy a new version of its web application with no downtime and be able to roll back instantly if something goes wrong. Which App Service feature should it use?
Explanation: Deployment slots let you stage a new version in a separate slot and swap it into production with no downtime, swapping back just as easily for rollback. Availability sets protect VMs inside a datacenter. Resource locks prevent deletion or modification of resources. Azure Policy enforces organisational rules.
Exam objective: AZ-900 Describe Azure compute and networking services: describe application hosting options, including web apps, containers, and virtual machines
Q6.A company runs a batch job that processes uploaded videos. The job runs only when a video arrives, takes a few minutes, and the team wants to pay nothing while no videos are being processed. Which compute option fits best?
Explanation: Azure Functions are serverless: code runs on an event (the upload), bills per execution, and scales to zero when idle — exactly the requirement. A VM running 24 hours a day bills while idle. Azure Virtual Desktop delivers user desktops. An availability set is about VM redundancy, not event-driven billing.
Exam objective: AZ-900 Describe Azure compute and networking services: compare compute types, including containers, virtual machines, and functions
Q7.What is the main difference between a virtual machine and a container?
Explanation: A virtual machine carries its own complete operating system; a container shares the host's OS kernel and packages only the application and its dependencies — which is why containers start faster and use fewer resources. The first option reverses the two. Containers run on virtualised hosts perfectly well. Virtual machines are a core Azure service.
Exam objective: AZ-900 Describe Azure compute and networking services: compare compute types, including containers, virtual machines, and functions
Q8.A development team wants to host a web application and an API. They want automatic scaling and patching handled by Azure, and they do not want to manage any servers. Which hosting option should they choose?
Explanation: Azure App Service is the managed web-hosting platform: deploy code, get scaling and patching from Azure, manage no servers. Virtual machines put OS management on the team. Container Instances with manual orchestration still leaves orchestration work to the team. Virtual Desktop delivers desktops, not web applications.
Exam objective: AZ-900 Describe Azure compute and networking services: describe application hosting options, including web apps, containers, and virtual machines