Compare AKS (Azure Kubernetes Service) vs Azure Container Apps. When would you choose each?
Quick Answer
AKS: full Kubernetes control, custom CNI/CSI, complex workloads, existing K8s expertise. Container Apps: serverless containers, event-driven scaling, simpler ops, Dapr integration, no K8s knowledge needed.
Detailed Answer
AKS (Azure Kubernetes Service)
- Full Kubernetes API access — anything K8s supports, AKS supports - Custom networking (Azure CNI, kubenet, BYO CNI) - Node pool management (system + user pools, GPU nodes, spot instances) - Helm, operators, CRDs, service mesh - Virtual nodes (ACI burst) for serverless scaling - Best for: Complex microservices, teams with K8s expertise, custom platform requirements, stateful workloads, need full control
Azure Container Apps
- Built on Kubernetes (KEDA + Envoy) but abstracts it entirely - Scale to zero (serverless billing) - Event-driven scaling (HTTP, queue depth, cron, custom) - Built-in Dapr for service-to-service communication - Managed Envoy for traffic splitting and ingress - No node management, no kubectl - Best for: Event-driven workloads, APIs, background processors, teams without K8s expertise, rapid prototyping, cost-sensitive workloads with variable traffic
Decision Framework
- Need CRDs/operators → AKS - Need GPU workloads → AKS - Scale to zero required → Container Apps - Team knows Kubernetes → AKS - Team wants simplicity → Container Apps - Predictable high-volume traffic → AKS (reserved instances) - Bursty/variable traffic → Container Apps (pay-per-use)
Code Example
# AKS cluster (Bicep)
resource aksCluster 'Microsoft.ContainerService/managedClusters@2023-08-01' = {
name: 'prod-aks'
location: location
identity: { type: 'SystemAssigned' }
properties: {
dnsPrefix: 'prod-aks'
agentPoolProfiles: [{
name: 'system'
count: 3
vmSize: 'Standard_D4s_v3'
mode: 'System'
availabilityZones: ['1', '2', '3']
}]
networkProfile: {
networkPlugin: 'azure'
networkPolicy: 'calico'
}
}
}
# Container Apps (Bicep)
resource containerApp 'Microsoft.App/containerApps@2023-05-01' = {
name: 'api-service'
location: location
properties: {
environmentId: containerAppEnv.id
configuration: {
ingress: {
external: true
targetPort: 8080
traffic: [
{ latestRevision: true, weight: 100 }
]
}
}
template: {
containers: [{
name: 'api'
image: 'myacr.azurecr.io/api:latest'
resources: {
cpu: json('0.5')
memory: '1Gi'
}
}]
scale: {
minReplicas: 0 // Scale to zero!
maxReplicas: 10
rules: [{
name: 'http-scaling'
http: { metadata: { concurrentRequests: '50' }}
}]
}
}
}
}Interview Tip
Frame it as a spectrum: Container Apps (serverless simplicity) ↔ AKS (full control). The decision isn't which is better, but which trade-off fits the team and workload. Scale-to-zero is Container Apps' killer feature.