Choosing an Azure compute option for .NET 10 (App Service, Functions, Container Apps, AKS) by cost model, control, scaling, networking and operational burden, and when to migrate between them.
I choose by how much platform the team wants to run:
The trade-off is control versus operations: each step towards AKS gives more control and more work. I start with the simplest option that meets the requirements and move only when I hit a concrete limit.
"I start from the team and the workload, not from the technology. For one or two ASP.NET Core APIs that are always on, App Service is the default: I deploy code or a container, I get deployment slots, autoscale rules, managed TLS, VNet integration and health checks, and nobody has to learn Kubernetes. I pay for the plan, so idle time still costs money.
If the work is event-driven (process a Service Bus message, react to a blob, run every night), I use Azure Functions with the isolated worker model. On the Flex Consumption plan it scales per event and to zero, and it now supports VNet integration. The catch is the execution model: triggers and bindings, cold starts and an HTTP response limit of about 230 seconds through the front end. When the team ships containers and several services, I pick Container Apps. It runs on Kubernetes with KEDA, Envoy and optional Dapr, but Microsoft runs the cluster. I get revisions with traffic splitting, scale rules on HTTP, queue length or CPU, and scale to zero. AKS is for when I need the Kubernetes API itself: custom operators, service meshes, GPU node pools, strict network topology, or dozens of services with a platform team to own upgrades, node images and security patching.
The mistake I see is choosing AKS for a three-service product because it 'scales'. Everything here scales; what differs is who carries the pager for the platform. Moving later is cheap if the app is a container with config from the environment, so I keep that path open and choose the least operations that meet today's needs."
| App Service | Functions (Flex Consumption) | Container Apps | AKS | |
|---|---|---|---|---|
| Unit you deploy | Code or container | Functions project (code) | Container | Containers + manifests |
| Scaling | Rules or automatic, instances | Per event, to zero | KEDA rules, to zero | HPA, KEDA, cluster autoscaler |
| Pricing | Per plan instance (always on) | Per execution and memory, optional always-ready | Per vCPU/memory second, or dedicated workload profiles | Node VMs (+ Standard tier control plane) |
| Release safety | Deployment slots | Slots on some plans | Revisions with traffic split | Rolling, or canary with extra tools |
| Ops burden | Very low | Very low | Low | High (upgrades, nodes, add-ons) |
| Best for | Few web apps and APIs | Event-driven, spiky jobs | Microservices without a platform team | Large estates, special needs |
| From → To | Trigger |
|---|---|
| App Service → Container Apps | Many small services, want scale to zero or event scaling |
| Functions → Container Apps | Long-running work, custom containers, Functions limits |
| Container Apps → AKS | Need Kubernetes APIs, operators, mesh, custom node pools |
| AKS → Container Apps | Platform work is eating feature time with no special need |
A team running eight internal APIs on four App Service plans in Australia East moved them to one Container Apps environment. Six services were idle outside business hours and scaled to zero, so compute cost dropped by about 40%, while the two customer-facing APIs kept a minimum of two replicas for latency.
Checks that the candidate matches the compute option to the workload and team, and understands the cost and operations trade-offs.
Green flags
Red flags
App Service: Front end (load balancer) ─▶ worker VMs in your plan ─▶ your app process
Functions: Scale controller watches triggers ─▶ adds instances ─▶ Functions host + isolated worker
Container Apps: Envoy ingress ─▶ managed Kubernetes ─▶ your pods; KEDA scales on events
AKS: Your ingress ─▶ your node pools ─▶ your pods; you own add-ons and upgrades
App Service runs your app on dedicated VMs in a plan; all apps in a plan share them. Functions adds a scale controller that watches trigger sources (queue length, event backlog) and adds instances. Container Apps hides a Kubernetes cluster and exposes apps, revisions and scale rules. AKS gives you the cluster.
A rule of thumb: if a service is busy more than roughly half the day, compare an always-on price; if it idles most of the day, per use usually wins.
Also, the in-process .NET model reached end of support on 10 November 2026, so new and existing .NET function apps should use the isolated worker model on .NET 10.
An environment is a secure boundary (one VNet, shared Log Analytics). Each app has revisions; you can split traffic 90/10 between revisions for canary releases. Scale rules use KEDA scalers (HTTP concurrency, Service Bus queue length, CPU). Workload profiles let you mix consumption with dedicated VM sizes, including serverless GPUs in Australia East. Jobs run batch or scheduled work to completion.
You get the full API: CRDs, operators, network policies, service meshes, node pools with specific VM sizes, GPU nodes and Windows nodes. You also own Kubernetes version upgrades (about three minor versions a year), node image patching, ingress controllers, certificate management and capacity planning. AKS Automatic reduces some of this, but it is still Kubernetes.
minReplicas: 0 and watch replicas with az containerapp replica list as you send traffic.The same .NET 10 container deployed to Container Apps with a queue-based scale rule, using Bicep (managed identity, no connection string):
resource api 'Microsoft.App/containerApps@2024-03-01' = {
name: 'ca-orders-api'
location: 'australiaeast'
identity: { type: 'SystemAssigned' }
properties: {
environmentId: env.id
configuration: {
ingress: { external: true, targetPort: 8080 }
}
template: {
containers: [
{
name: 'api'
image: 'crordersprod.azurecr.io/orders-api:1.4.2'
resources: { cpu: json('0.5'), memory: '1Gi' }
}
]
scale: {
minReplicas: 0 // scale to zero when idle
maxReplicas: 10
rules: [
{
name: 'http'
http: { metadata: { concurrentRequests: '50' } }
}
]
}
}
}
}
The app itself stays platform-neutral, so it can move between App Service, Container Apps and AKS:
var builder = WebApplication.CreateBuilder(args);
// Config comes from environment variables on every platform, so nothing here is host-specific.
builder.Services.AddHealthChecks();
var app = builder.Build();
app.MapHealthChecks("/healthz");
app.MapGet("/orders/{id:int}", (int id) => Results.Ok(new { id, status = "Paid" }));
app.Run();
The decision is mostly about operating cost in people, not compute price. A Kubernetes cluster needs someone who understands upgrades, networking and security; if that person does not exist, AKS is a liability. I also look at the shape of the load: constant traffic favours a plan, spiky or business-hours traffic favours scale to zero, and event backlogs favour KEDA or Functions.
| Option | When it fits | Cost | When not to |
|---|---|---|---|
| App Service | Few always-on web apps | Plan price, minimal ops | Many small idle services |
| Functions Flex | Event-driven, bursty | Per execution | Long-running or chatty APIs |
| Container Apps | Microservices, event scaling | Per use or dedicated | Need operators, mesh, CRDs |
| AKS | Big estate, platform team | Nodes + people | No Kubernetes skills in team |
I measure the choice afterwards: cost per service per month in Cost Management, p95 latency including cold starts, and hours per month spent on platform work.
On SIGTERM, Kubernetes removes the pod from endpoints and signals the container at roughly the same time, but endpoint removal takes a few seconds to reach every node and ingress. So I fail readiness as soon as ApplicationStopping fires and add a preStop sleep of about 5–10 s so routing catches up. I let the host finish in-flight requests within HostOptions.ShutdownTimeout (30 s by default since .NET 8), and keep terminationGracePeriodSeconds longer than the preStop delay plus the shutdown timeout. Background services must honour the stopping token. I verify with a load test during a rolling deploy: zero 5xx.
Start by proving what the process actually sees, not what the portal says. Use a masked GetDebugView(), which lists every key with the provider that won, or log the provider list at start-up, and run printenv in the container.
The usual causes are:
: in a Linux App Service or Kubernetes variable instead of __; App Service connection strings arriving as SQLAZURECONNSTR_*.ASPNETCORE_ENVIRONMENT unset, so appsettings.Production.json loads.IOptions<T> never reloads; mounted ConfigMaps update by symlink swap, which file watchers miss.The trade-off: configuration layering is flexible, but you must be able to see the final merged result in each environment.
Last updated 23 Nov 2026.