1. Virtual machines #
IaaS.
VMs and VMSS #
- Sizes by family (B burstable, D general purpose, E memory, F compute, N GPU).
- Availability: availability zones (99.99% for two VMs in two zones) or availability sets.
- VMSS: identical groups scaled automatically.
az vm create -g rg-app -n vm-web --image Ubuntu2404 --size Standard_B2s --zone 1 \
--vnet-name vnet-app --subnet web --public-ip-address "" --assign-identity --generate-ssh-keys
az vmss create -g rg-app -n vmss-web --image Ubuntu2404 --instance-count 2 --zones 1 2 3
az monitor autoscale create -g rg-app --resource vmss-web --resource-type Microsoft.Compute/virtualMachineScaleSets \
--name autoscale-web --min-count 2 --max-count 10 --count 2
az monitor autoscale rule create -g rg-app --autoscale-name autoscale-web --condition "Percentage CPU > 70 avg 5m" --scale out 12. PaaS and serverless #
App Service and Functions.
App Service #
App Service hosts web applications and APIs (.NET, Java, Node.js, Python, PHP, containers) with scaling, deployment slots for blue/green, and built-in TLS and authentication.
az appservice plan create -g rg-app -n plan-web --sku P1v3 --is-linux
az webapp create -g rg-app -p plan-web -n web-demo-123 --runtime "PYTHON:3.12"
az webapp deployment slot create -g rg-app -n web-demo-123 --slot staging
az webapp deployment slot swap -g rg-app -n web-demo-123 --slot staging --target-slot productionAzure Functions #
Functions triggered by HTTP, a queue, a blob, a timer or Event Grid. Consumption or Flex Consumption plans (pay per execution), Premium (pre-warmed instances) or App Service.
3. Containers #
AKS, Container Apps, Container Instances.
Choosing #
| Service | Usage |
|---|---|
| Azure Container Registry | Private image registry |
| Container Instances | A one-off container, without an orchestrator |
| Container Apps | Serverless microservices and APIs (scale to zero, KEDA, Dapr) |
| AKS | Managed Kubernetes for full platforms |
Advice #
Good practice: Start with Container Apps for microservices; move to AKS when you need the full Kubernetes API and its ecosystem.
