Deploying a .NET API to Azure Container Apps
Deploy an image in one command
az containerapp up CLI does all the bootstrap work on the first deployment:
--target-port 8080 must match the port Kestrel listens on inside the container ( ASPNETCORE_URLS=http://+:8080 ). The external ingress exposes a public HTTPS FQDN with a managed certificate; internal keeps the app on intra-environment traffic only — ideal for a service called solely by other apps.
Scale-to-zero and KEDA rules
--min-replicas 0 , an idle app costs nothing . On the first request the platform spins up a replica (a cold start of a few hundred milliseconds). Scaling rests on KEDA : you declare rules against metrics, not just CPU.
azure-servicebus or azure-queue scaler: the app sleeps while the queue is empty, then scales out based on queue depth. The KEDA scaler catalogue covers Kafka, Redis, Prometheus and many more.
Revisions and traffic split
multiple mode, several revisions run in parallel and you split traffic across them — the foundation of a canary or blue-green rollout.
100 ; otherwise you drop it back to 0 instantly — no redeploy required. That is a rollback measured in seconds.
Handle configuration cleanly
secretref: syntax. Better still: enable a managed identity on the app and point a secret straight at Azure Key Vault, so the value is never materialised. The Container Apps documentation details ingress, Dapr and the health probes ( liveness / readiness ) you should wire up for a production service.
Container Apps is serverless without giving up containers: you keep your OCI image and your Dockerfile, but you forget the cluster . Scale-to-zero and traffic split come free.