Designing Container and Serverless Solutions: Container Apps, AKS, Functions Plans and Event-Driven Compute
Container Design Basics
- Build images in a pipeline and store them in Azure Container Registry (ACR). Use geo-replication for multi-region and private endpoints for security
- Sign and scan images. Use Defender for Containers
- Pull with managed identity, never admin credentials
Container Apps or AKS?
| Need | Container Apps | AKS |
| Operational effort | Low, managed | Higher, you manage cluster upgrades and add-ons |
| Scale to zero | Yes | Possible with extra tools |
| Kubernetes API access | No | Yes |
| Custom operators, service mesh variety | Limited | Full |
| Best for | Microservices and APIs with simple platform needs | Large platforms, multi-team, portability, special networking |
AKS Design Decisions
| Area | Choices |
| Networking | Azure CNI Overlay (many pods, simpler IP use), Azure CNI with VNet IPs (pods are VNet addresses), kubenet is older. Plan address space |
| Node pools | System pool (3 nodes across zones) separate from user pools. Spot pools for batch, GPU pools for AI |
| Cluster access | Entra ID integration, Kubernetes RBAC, private cluster for no public API endpoint |
| Workload identity | Pods get Entra tokens through federation, no secrets |
| Ingress | Application Gateway for Containers or managed NGINX app routing, with WAF |
| Scaling | HPA for pods, cluster autoscaler or node auto provisioning for nodes, KEDA for event scaling |
| Upgrades | Auto-upgrade channels, maintenance windows, surge settings |
| Storage | Azure Disks (single node), Azure Files (shared), Blob CSI |
| Observability | Container insights, managed Prometheus and Grafana |
| Governance | Azure Policy for Kubernetes, Defender for Containers |
Azure Functions Hosting Plans
| Plan | Notes |
| Consumption / Flex Consumption | Pay per use, scales to zero, cold starts, limited networking (Flex adds VNet support) |
| Premium | Pre-warmed instances, VNet integration, no cold start, longer runtime |
| Dedicated (App Service plan) | Reuse existing plan, predictable cost |
| Container Apps hosting | Run functions as containers next to other apps |
Check current plans Function hosting options change. Confirm limits such as timeout, memory and networking in the current docs.
Event-Driven Patterns
- Trigger and bindings connect Functions to Blob, Service Bus, Event Hubs, Cosmos DB and timers
- Durable Functions run long workflows: chaining, fan-out/fan-in, human approval and monitoring loops
- Make handlers idempotent, set retry policies and use dead-letter queues
- Scale-out can overwhelm a database, so set concurrency limits
Design Scenario
An online store has a React front end, 12 microservices and spiky traffic. A small team wants low operations effort: use Static Web Apps for the UI, Container Apps for services with KEDA scaling on Service Bus, Functions for background jobs, Cosmos DB and Azure SQL for data, Front Door for entry. Move to AKS only if Kubernetes control becomes necessary.
Practice
- Choose Container Apps or AKS for three situations and explain
- List five AKS design decisions for a bank
- Pick a Functions plan for a job needing VNet access and no cold start
Conclusion
Use Container Apps or Functions when you want low operations, and AKS when you need Kubernetes depth. Design networking, identity, scaling and upgrades before creating a cluster.
Quick Summary: registry; Container Apps vs AKS; AKS decisions; Functions plans; patterns; scenario.