Azure Compute: Containers, Functions, and App Service
VMs aren't the only compute option. Azure offers containers for portable apps, Functions for serverless code, and App Service for managed web hosting. Here's when to use each.
Beyond VMs — more ways to run code
Think of three ways to ship a product.
Virtual machines = renting a whole warehouse. You control everything inside, but you pay for the entire space even if you only fill half of it.
Containers = shipping containers. Your product is packaged with everything it needs. You can move the container to any ship (any server) and it works the same everywhere.
Functions (serverless) = a courier service. You hand over the package, they deliver it. You don’t own a warehouse or a shipping container — you just pay per delivery.
Each approach gives you less control but less to manage.
Compute options compared
| Feature | VMs | Containers | Functions | App Service |
|---|---|---|---|---|
| Service type | IaaS | IaaS/PaaS | Serverless (PaaS) | PaaS |
| You manage | OS, apps, data | App and dependencies | Just code | App code and config |
| Startup time | Minutes | Seconds | Milliseconds | Seconds |
| Scaling | Manual or Scale Sets | Kubernetes or manual | Automatic (0 to thousands) | Built-in auto-scale |
| Cost model | Per-second running | Per-second running | Per-execution | Per-hour (plan-based) |
| Best for | Legacy apps, full OS control | Microservices, portable apps | Event-driven, intermittent tasks | Web apps, APIs, mobile backends |
Containers — portable and lightweight
A container packages an application with everything it needs to run — code, libraries, runtime, and settings. Unlike a VM, a container doesn’t include a full operating system — it shares the host OS kernel.
| Feature | VM | Container |
|---|---|---|
| Includes OS? | Yes — full OS per VM | No — shares host OS kernel |
| Size | Gigabytes | Megabytes |
| Startup | Minutes | Seconds |
| Isolation | Hardware-level | Process-level |
| Density | 10-20 per physical host | 100s per physical host |
Azure container services
| Service | What It Does | Best For |
|---|---|---|
| Azure Container Instances (ACI) | Run a single container quickly — no orchestration | Simple tasks, dev/test, batch jobs |
| Azure Kubernetes Service (AKS) | Orchestrate hundreds of containers at scale | Microservices, complex applications |
Kai’s startup side-project uses ACI to run a web scraper container. It starts in seconds, runs for 2 minutes, and costs fractions of a cent. No VM needed.
Azure Functions — serverless compute
Azure Functions run small pieces of code in response to events — an HTTP request, a timer, a message in a queue, a file upload.
Key characteristics:
- Event-driven — code runs when triggered, not continuously
- Auto-scaling — from zero to thousands of instances
- Pay-per-execution — first 1 million executions/month are free
- Stateless by default — each execution is independent
Common triggers:
| Trigger | Example |
|---|---|
| HTTP request | API endpoint that processes form submissions |
| Timer | Run a cleanup script every night at midnight |
| Queue message | Process an order when a message arrives |
| Blob storage | Generate a thumbnail when an image is uploaded |
Durable Functions
Standard Azure Functions are stateless — they don’t remember previous executions. Durable Functions extend this with stateful workflows:
- Chain multiple functions together
- Wait for external events
- Run parallel operations and aggregate results
The AZ-900 exam rarely goes this deep, but know that “stateless” has an exception with Durable Functions.
Azure App Service — managed web hosting
App Service is the PaaS web hosting platform in Azure. You deploy your code; Azure handles the server, OS, scaling, and patching.
Supports: .NET, Java, Node.js, Python, PHP, Ruby, and custom containers
Features:
- Built-in auto-scaling and load balancing
- CI/CD integration (GitHub, Azure DevOps)
- Custom domains and SSL certificates
- Deployment slots (test in staging before swapping to production)
Choosing the right compute for each character
| Character | Need | Best Compute Option |
|---|---|---|
| Summit Construction | Legacy project management app on Windows Server | VMs — needs full OS control |
| Kai | Web API for university project, intermittent traffic | Azure Functions — serverless, near-zero cost |
| Peak Roasters | Online ordering website, needs to be always-on | App Service — managed web hosting, easy deployment |
| Harbour Health | Microservices architecture for patient portal | AKS (containers) — orchestrated container platform |
Exam tip: Matching scenarios to compute
The exam loves “which compute option should you use?” questions. Key patterns:
- “Legacy app” or “specific OS” → VM
- “Without managing servers” or “deploy code only” → App Service or Functions
- “Event-driven” or “runs occasionally” → Functions
- “Microservices” or “portable across environments” → Containers (ACI or AKS)
- “Web app” or “REST API” → App Service
- “Batch processing at scale” → Containers or Functions
🎬 Video walkthrough
🎬 Video coming soon
Azure Compute Options — AZ-900
Azure Compute Options — AZ-900
~10 minFlashcards
Knowledge Check
Kai wants to build a small API that runs occasionally — processing 50-100 requests per day. They want the cheapest option with no server management. Which Azure compute service is BEST?
Harbour Health is building a new patient portal using a microservices architecture with 12 independent services. Which compute option is BEST suited?
Next up: Azure Networking — virtual networks, subnets, and VNet peering.