App Service & Functions

PaaS web hosting and serverless code.

Intermediate30 min · lesson 5 of 15

Not everything needs a VM. Azure App Service and Azure Functions are managed platform (PaaS) and serverless options that let you run web apps and code without administering servers — often the better choice for developer-facing workloads.

App Service: managed web hosting

Azure App Service is a fully-managed platform for hosting web apps, REST APIs, and backends: you deploy code (or a container) and Azure runs, patches, and scales the underlying platform. Apps run on an App Service Plan, which defines the compute tier, size, and instance count — the tier sets available features (custom domains, TLS, scaling, deployment slots). App Service supports autoscale rules to add and remove instances by metric, deployment slots for zero-downtime releases and easy rollback, and built-in integration with Entra ID authentication and Key Vault references for secrets. It removes the operational burden of managing VMs for standard web workloads.

App Service on a plan, with autoscale
# Apps run on a plan; the plan’s tier sets features and how it scales.
az appservice plan create -g app-rg -n app-plan --sku P1v3 --is-linux
az webapp create -g app-rg -p app-plan -n contoso-web --runtime "NODE:20-lts"
# Autoscale by CPU (scale out under load, in when idle):
az monitor autoscale create -g app-rg --resource app-plan \
--resource-type Microsoft.Web/serverfarms --min-count 2 --max-count 10 --count 2
# Deployment slots enable zero-downtime swap + instant rollback.

Functions and choosing a compute model

Azure Functions is the serverless option: event-driven code that runs on demand — triggered by an HTTP request, a queue message, a timer, or a blob event — and scales automatically, with you paying only for execution. It is ideal for glue, automation, and bursty event processing, and wrong for always-on, long-running work. The administrator’s skill is matching the model to the workload across the spectrum: Functions and App Service (PaaS/serverless) for the least operational overhead, containers on Azure Container Instances or AKS when you need portability or orchestration, and VMs (IaaS) when you need full OS control or are lifting-and-shifting. Prefer the least-operational option that meets the requirements — every layer Azure manages is one you do not.

PaaS and serverless compute
App Service (PaaS)
managed web hosting
deploy code, Azure runs it
plans + autoscale + slots
scale + zero-downtime deploys
Functions (serverless)
event-driven code
HTTP/queue/timer/blob triggers
auto-scale, pay per run
no servers, bursty workloads
For web apps and event-driven code, PaaS/serverless removes server management. Reach for VMs only when you truly need OS control.
Do not default every workload to a VM
Running standard web apps or event-driven code on self-managed VMs means owning patching, scaling, and availability you could hand to Azure. Use App Service for web apps and Functions for event-driven code, and reserve VMs for workloads that genuinely need full OS control — it cuts both operational burden and cost.