Compute Services and Application Hosting Models
Compute spectrum
Azure compute spans infrastructure and platform models. Virtual Machines provide full OS control and are ideal for lift-and-shift. Virtual Machine Scale Sets add autoscaling and zone spreading. App Service hosts web apps and APIs on managed plans. Azure Container Apps runs containerized microservices with scale-to-zero and KEDA-style event scaling. Azure Kubernetes Service (AKS) gives managed Kubernetes with a provider-managed control plane. Azure Functions provides serverless event-driven code. Azure Batch handles large parallel compute jobs.
Choosing a hosting model
Match the model to operational control, scaling pattern, and traffic profile. App Service plans define compute capacity and features; higher tiers add slots, autoscale, and VNet integration. Functions Consumption scales to zero but has cold starts and execution limits; Premium keeps warm instances and supports VNet integration. AKS offers maximum container control but requires cluster operations. Container Apps sits between App Service and AKS for microservices.
Traps
Questions frequently confuse scale up (larger SKU) with scale out (more instances), assume AKS manages worker nodes automatically, or treat Functions Consumption as suitable for long-running jobs. Another trap is assuming App Service is always serverless or that availability sets provide zone-level resilience. Availability sets protect against host failure within a datacenter; zones protect against datacenter failure.
Worked example
A public API has unpredictable bursts and long idle periods. An always-on App Service Premium plan is predictable but costly. Functions Consumption is cheap at idle but has cold starts and time limits. If the API tolerates cold starts and fits the timeout, choose Functions; if it needs always-warm instances, VNet integration, and steady throughput, choose App Service or Container Apps.
Rule of thumb
Start with the most managed service that meets your control and compliance needs, and move down the stack only when a specific requirement forces you to.