Running containers in production usually forces a difficult choice: either you wrestle with raw virtual machines and hand-rolled orchestration, or you commit to Kubernetes and accept the operational overhead of clusters, node pools, and networking plugins. Azure Container Apps offers a third path. It is Microsoft’s serverless container platform, built on top of Kubernetes, KEDA, and Envoy, that lets you deploy containerized applications without managing any cluster infrastructure. You get automatic scaling down to zero, managed HTTPS ingress, revision-based deployments, and built-in service discovery, all through a handful of Azure CLI commands. In this guide, you will deploy your first app to Azure Container Apps with az containerapp up, create a managed environment, configure ingress, and add KEDA-powered scaling rules.

Prerequisites
Before you begin, make sure you have the following ready:
- An Azure account with an active subscription (a free trial subscription works fine).
- Azure CLI 2.53 or newer installed on your Linux machine. If you do not have it yet, follow our guide to installing the Azure CLI on Linux and learning the essential commands.
- A container image to deploy. This guide uses the public sample image
mcr.microsoft.com/azuredocs/containerapps-helloworld:latestso you can follow along without building anything. - Bash shell access with a terminal that supports standard ANSI output.
How Azure Container Apps Works: Environments, Revisions, and Ingress
Understanding three core concepts makes everything else about Azure Container Apps click into place. A Container Apps environment is the secure boundary your apps run inside. It provisions its own virtual network, handles internal service discovery, and can optionally integrate with your own VNET for private connectivity. You deploy one or more container apps into an environment, and each app is made of one or more containers that always scale and deploy together.
Every deployment to a container app creates an immutable revision. Revisions let you run multiple versions side by side and split traffic between them, which makes blue-green deployments and canary releases straightforward. Each app also gets managed ingress: an HTTPS endpoint with automatic TLS termination and a public or internal fully qualified domain name. Scaling is event-driven through KEDA (Kubernetes Event-Driven Autoscaling), so your app can scale on HTTP concurrency, TCP connections, message queue depth, CPU, or memory, and scale all the way to zero when idle.
Step 1: Log In and Prepare the Azure CLI
Start by signing in to Azure and making sure the CLI is ready to manage Container Apps resources. The containerapp commands are part of the CLI core in recent versions, but installing the extension explicitly guarantees you have the latest parameters.
az login
az --version
az extension add --name containerapp --upgrade
Container Apps depends on two Azure resource providers that may not be registered in a fresh subscription. Register them now to avoid errors later:
az provider register --namespace Microsoft.App
az provider register --namespace Microsoft.OperationalInsights
You can confirm both providers are registered with az provider show --namespace Microsoft.App --query registrationState. If it returns anything other than Registered, wait a minute and check again.
Step 2: Create a Resource Group and a Container Apps Environment
Every Azure resource lives in a resource group. Create one in the region closest to your users, then create the Container Apps environment that will host your apps. Environment creation takes a few minutes because Azure provisions the underlying networking and a Log Analytics workspace for monitoring.
az group create --name aca-demo-rg --location eastus
az containerapp env create \
--name aca-demo-env \
--resource-group aca-demo-rg \
--location eastus
If you already have an environment from a previous project, you can skip the second command and reuse it. Sharing one environment across several related apps keeps costs down and lets them communicate over fast internal endpoints.
Step 3: Deploy Your First App to Azure Container Apps with az containerapp up
The fastest way onto the platform is az containerapp up. This single command creates the resource group, environment, and Log Analytics workspace if they do not exist, then builds and deploys your container app with public ingress:
az containerapp up \
--name my-first-app \
--resource-group aca-demo-rg \
--location eastus \
--environment aca-demo-env \
--image mcr.microsoft.com/azuredocs/containerapps-helloworld:latest \
--target-port 80 \
--ingress external \
--query properties.configuration.ingress.fqdn
Two flags deserve attention. --ingress external exposes the app to the public internet through Azure’s managed load balancer; use internal instead for backend services that only other apps in the environment should reach. --target-port must match the port your container actually listens on. The command returns the app’s public FQDN, something like https://my-first-app.example.eastus.azurecontainerapps.io. Open it in a browser and you should see the sample application’s welcome page. Keep the image name in lowercase; the command rejects uppercase characters in image references.
Step 4: Deploy with Full Control Using az containerapp create
When you need explicit control over CPU, memory, and replica counts, az containerapp create is the more deliberate tool. The following command deploys the same sample image with half a vCPU, one gigabyte of memory, and one to five replicas:
az containerapp create \
--name my-api \
--resource-group aca-demo-rg \
--environment aca-demo-env \
--image mcr.microsoft.com/azuredocs/containerapps-helloworld:latest \
--ingress external \
--target-port 80 \
--cpu 0.5 \
--memory 1.0Gi \
--min-replicas 1 \
--max-replicas 5
Use up for quick prototypes and one-off experiments; use create for workloads where you want to pin resource sizes and scaling boundaries from the start. You can always adjust these values later with az containerapp update.
Step 5: Configure Ingress in Azure Container Apps
Ingress controls how traffic reaches your container app. The two modes are external, which assigns a public FQDN and terminates TLS automatically, and internal, which exposes the app only inside the environment over its internal load balancer. You can switch modes or change the target port at any time without redeploying the container:
az containerapp ingress update \
--name my-api \
--resource-group aca-demo-rg \
--type external \
--target-port 8080
A common production pattern is an internal API paired with an external frontend in the same environment. The frontend reaches the API at a short internal hostname such as http://my-api, with no traffic ever leaving Azure’s network. If your app stops responding after an ingress change, the target port is the first thing to verify: it must match the port the process inside the container binds to, not the port you wish were exposed.
Step 6: Add KEDA Scaling Rules to Azure Container Apps
Out of the box, Container Apps scales on HTTP request concurrency, but you can define exactly how it behaves. The following command sets the app to scale between zero and ten replicas, adding a replica for every ten concurrent HTTP requests:
az containerapp update \
--name my-api \
--resource-group aca-demo-rg \
--min-replicas 0 \
--max-replicas 10 \
--scale-rule-name http-scaling \
--scale-rule-type http \
--scale-rule-http-concurrency 10
Setting --min-replicas 0 is the key to scale-to-zero: when no requests arrive, Azure stops all replicas and you pay nothing for compute. For TCP workloads such as game servers or custom protocols, use a TCP rule instead:
az containerapp update \
--name my-api \
--resource-group aca-demo-rg \
--min-replicas 1 \
--max-replicas 10 \
--scale-rule-name tcp-scaling \
--scale-rule-type tcp \
--scale-rule-tcp-concurrency 100
KEDA supports dozens of scalers beyond HTTP and TCP, including Azure Queue Storage, Kafka, RabbitMQ, and CPU or memory metrics. Verify your active scaling configuration at any time with:
az containerapp show \
--name my-api \
--resource-group aca-demo-rg \
--query "properties.template.scale"
Remember that every configuration update, including scaling changes, creates a new revision of your app.
Step 7: Manage Revisions and Split Traffic
Because each update produces a new revision, you can test a new version with a fraction of live traffic before committing fully. List your revisions first:
az containerapp revision list \
--name my-api \
--resource-group aca-demo-rg \
--output table
Then split traffic between the current and previous revision for a canary release:
az containerapp ingress traffic set \
--name my-api \
--resource-group aca-demo-rg \
--revision-weight my-api--0000001=80 my-api--0000002=20
Replace the revision names with the actual names from the list output. When the canary looks healthy in your logs and metrics, shift the weight to 100 percent on the new revision or simply deactivate the old one.
Step 8: Monitor Your App with Live Logs
Each environment includes a Log Analytics workspace, and the CLI can stream console output directly from your replicas:
az containerapp logs show \
--name my-api \
--resource-group aca-demo-rg \
--follow
Use --tail 100 for a quick snapshot instead of a live stream. For structured queries across restarts and revisions, open the Log Analytics workspace in the Azure portal and query the ContainerAppConsoleLogs_CL table.
Troubleshooting Azure Container Apps Deployments
Resource provider not registered. If deployment fails with an error about Microsoft.App, rerun the az provider register commands from Step 1 and wait until the registration state shows Registered.
Ingress returns errors or timeouts. Check that --target-port matches the port your application binds to inside the container. A container listening on 8080 behind a target port of 80 will never receive traffic.
Image pull failures. Public images must be lowercase and reachable without authentication. For private registries such as Azure Container Registry, configure registry credentials with az containerapp registry set before deploying.
A revision is stuck in a failed state. Inspect the revision’s replica logs with az containerapp logs show and check for application crashes. You can deactivate a bad revision with az containerapp revision deactivate to force traffic back to the last healthy one.
Cold starts after scaling to zero. The first request to a scaled-to-zero app waits for a replica to start, which can take several seconds. If that latency is unacceptable, keep --min-replicas at 1 for latency-sensitive workloads.
Conclusion
Azure Container Apps gives you the deployment simplicity of a platform-as-a-service with the portability of standard containers. You deployed an app with a single command, configured external and internal ingress, defined KEDA scaling rules that drop to zero when idle, and practiced safe canary releases with revisions. When a workload eventually outgrows what Container Apps offers, the natural next step is a full cluster, which our Azure Kubernetes Service basics guide covers from your first deployment onward. For the complete parameter reference, see the official Azure Container Apps documentation.