Azure Container Apps: Run Containers Without Running the Cluster

Azure Container Apps: Run Containers Without Running the Cluster

A beginner-friendly guide to Azure Container Apps, the serverless platform that runs your containers, scales them automatically, even down to zero, and hides the complexity of Kubernetes, explained step by step with everyday analogies.

Imagine you run a small catering business. You have perfected a few dishes, and each dish is packed in a standard lunch box so that it tastes the same wherever it is served. Now you must decide how to deliver them. You could buy a fleet of trucks, hire drivers, plan routes, service the vehicles and keep spare trucks for busy days. Or you could hand your lunch boxes to a delivery service that collects them, sends the right number of riders at lunchtime and sends none at midnight. You pay only for the deliveries. Azure Container Apps is that delivery service for software containers.

In this guide we start with the simple question “what is a container?”, and slowly build up to apps, revisions, scaling, jobs, networking, security and cost. No earlier knowledge of containers or Kubernetes is assumed. Every new word is explained when it first appears, usually with a comparison from daily life. Product features and prices evolve quickly, so treat this guide as a map of ideas and confirm specifics in the current Azure documentation.

1What Is Azure Container Apps?

It is a managed service for running containerised applications, with automatic scaling and very little infrastructure to manage.

A container is a package that holds an application together with everything it needs to run: its code, its libraries and its settings. Because the package carries its own needs, it behaves the same on a developer’s laptop, on a test server and in the cloud. This solves the old complaint “it works on my machine but not on yours”.

Running one container is easy. Running many containers reliably is harder. Someone must start them, restart them when they crash, spread them across machines, connect them to each other, update them without downtime and add more of them when traffic grows. The popular tool for this job is Kubernetes, which is very powerful but also complex to set up and operate.

Azure Container Apps gives you the benefits of containers and the scaling of Kubernetes, without asking you to manage a cluster. You give it a container image and a few settings. The service runs your containers, gives them a web address if you want one, scales the number of copies up and down based on rules, and can even scale to zero copies when nobody is using the application. You pay only for the resources used while your containers are running, with an allowance of free usage each month.

Behind the scenes, the service runs on Kubernetes and uses well-known open-source parts, but it does not give you direct access to the cluster. This is a deliberate trade: you give up some control in return for simplicity.

Simple Analogy

Using Kubernetes directly is like owning a restaurant kitchen with all its equipment and staff. Azure Container Apps is like a cloud kitchen service: you send your recipes and orders, and the service cooks, scales up when it is busy and shuts the stove when it is quiet.

Words you will meet again and again

Term 1

Container Image

A read-only template that contains an application and everything it needs. Containers are started from images.

Term 2

Container Registry

A storage place for images, such as Azure Container Registry, from which the platform pulls them.

Term 3

Environment

A secure boundary around a group of container apps that share a network and a log destination.

Term 4

Revision

An unchangeable snapshot of a version of your container app. New versions create new revisions.

Term 5

Replica

One running copy of a revision. The platform adds and removes replicas as demand changes.

Term 6

KEDA

An open-source tool for event-driven autoscaling that lets apps scale on queues, streams and many other signals.

Serverless
no cluster to build, patch or upgrade
Scale to zero
pay nothing for idle apps on consumption
Event-driven
scale on requests, queues and custom signals

2Why Does It Exist?

Because many teams want containers and microservices, but do not want to become Kubernetes experts.

Containers became very popular because they make applications portable and consistent. Teams started to break big applications into small services, each in its own container, which can be developed, deployed and scaled separately. This style is called microservices.

Running such systems at scale needs an orchestrator, which is a system that manages containers across many machines. Kubernetes is the best-known orchestrator, but it brings many concepts to learn, such as pods, deployments, services, ingress controllers, node pools, upgrades and security policies. A small team may spend more time operating the cluster than building the product.

Other Azure options sit at the two ends of a range. Simple web hosting services are easy but less flexible for multi-service systems. Full Kubernetes is flexible but demanding. Azure Container Apps fills the middle: easy enough for a small team, yet rich enough for microservices, background workers and event-driven systems.

Simplicity

You describe your app and its scale rules. The platform handles clusters, nodes, upgrades and networking underneath.

Cost efficiency

With scale to zero, you do not pay for apps that have no traffic or work. Busy apps scale out automatically.

Microservices support

Built-in service discovery, traffic splitting, revisions and optional Dapr building blocks help small services work together.

Event-driven design

Apps can scale based on queue length, stream lag, schedules or custom signals, which suits background processing.

Portability

Because the unit of deployment is a standard container, you keep the freedom to move to other container platforms later.

i
Good to Know

Container Apps is not the answer to everything. If you need direct control of the Kubernetes cluster, such as custom operators, special networking or privileged containers, a full Kubernetes service is a better fit. We compare the choices later in this guide.

3Core Concepts: Environment, App, Revision and Replica

Four simple objects explain almost everything you will do in Container Apps.

1

Environment

The outer boundary. Apps in the same environment share a virtual network, can find each other by name and send their logs to the same place. You create an environment first, then place apps inside it.

2

Container app

The application itself. It holds one or more containers, scale rules, ingress settings, secrets and environment variables.

3

Revision

An immutable snapshot of the app’s version and settings. When you change certain settings, such as the image or the container configuration, a new revision is created. Old revisions can stay for rollback.

4

Replica

A running copy of a revision. A revision may have zero, one or many replicas, depending on the scale rules.

flowchart TD
  ENV["Environment: shared network and logs"] --> APP1["Container App: orders"]
  ENV --> APP2["Container App: payments"]
  APP1 --> R1["Revision 1"]
  APP1 --> R2["Revision 2"]
  R2 --> P1["Replica A"]
  R2 --> P2["Replica B"]
  APP2 --> R3["Revision 1"]
  R3 --> P3["Replica A"]
        
FIG 1 — How environments, apps, revisions and replicas fit together
Simple Analogy

Think of a food court. The environment is the food court building with shared electricity and a common seating area. Each container app is a stall. A revision is one version of the stall’s menu, kept on record. Replicas are the cooks currently working at the stall, more at lunch and fewer in the afternoon.

Scope-changing and non-scope-changing updates

Some changes create a new revision, such as changing the container image, the container resources or the scale rules. Other changes apply to the whole app without a new revision, such as ingress settings and secrets in many cases. Knowing the difference helps you plan updates and understand why revisions appear in your list.

!
Common Mistake

Creating many separate environments for every small app. Each environment has its own network and logging setup. Group related apps that need to talk to each other in one environment, and separate environments only where you need real isolation, such as production and test.

4Inside the Machine: How Container Apps Works

Looking under the bonnet explains scaling, routing and cold starts.

Azure Container Apps runs on top of managed Kubernetes clusters that Microsoft operates for you. You never see these clusters, nodes or pods directly. The platform combines several open-source building blocks with Azure’s own control system.

Part 1

Managed Kubernetes

The foundation that schedules and runs your containers on pools of machines. Microsoft handles upgrades, security patches and capacity.

Part 2

Envoy Proxy

The front door. It receives incoming web traffic, applies routing and traffic-splitting rules, terminates secure connections and forwards requests to replicas.

Part 3

KEDA

The scaling brain. It watches metrics such as request counts and queue lengths, and tells the platform how many replicas are needed.

Part 4

Dapr

An optional set of building blocks for microservices, such as service calls, messaging and state storage, running as helpers next to your containers.

Part 5

Control Plane

Azure’s own management layer that turns your app definition into running resources and keeps them in the desired state.

1

You deploy an app definition

You provide the image, resources, scale rules and ingress settings through the portal, command line or automation.

2

A revision is created

The control plane records an immutable revision and prepares to run it.

3

Replicas start

The platform pulls the image from the registry, starts the minimum number of replicas and checks their health.

4

Traffic is routed

The ingress proxy sends requests to healthy replicas according to traffic rules.

5

Scaling reacts

The scaling component observes the chosen signals and adds or removes replicas, within your minimum and maximum limits.

sequenceDiagram
  participant U as User
  participant E as Ingress Proxy
  participant S as Scaler
  participant C as Platform Controller
  participant R as Replica
  U->>E: First request after idle period
  E->>S: Traffic detected, no replica running
  S->>C: Scale from zero to one
  C->>R: Pull image and start container
  R-->>C: Ready
  C-->>E: Replica available
  E->>R: Forward the waiting request
  R-->>U: Response
        
FIG 2 — What happens when a request arrives at an app scaled to zero
Simple Analogy

A tea stall that opens only when a customer arrives has to light the stove first, so the first customer waits a little. After that, service is quick. The wait for the first request is the cold start, and keeping at least one replica running removes it, at a cost.

i
Cold Start and Minimum Replicas

If your application needs fast responses at all times, set the minimum number of replicas to one or more. If delays of a few seconds for the first request are acceptable, scale to zero saves money. Decide according to the business need.

5Containers: Images, Registries, Sidecars and Init Containers

A container app can hold more than one container, and each has a role.

The main container runs your application. You tell the platform where to find its image, how much processor and memory it needs, which port it listens on and which environment variables to set. The image normally comes from a registry. Azure Container Registry is the natural choice inside Azure, and the platform can use a managed identity to pull from it without storing a password. Public registries are also supported.

Role

Main Container

Runs the primary application code and listens for traffic or work.

Role

Sidecar Container

Runs alongside the main one to add abilities such as log shipping, proxying or monitoring, sharing the same replica.

Role

Init Container

Runs once before the main containers start, to prepare the ground, such as downloading configuration or waiting for a dependency.

Resources per container

You choose the processor and memory for each container. The platform offers fixed combinations, and total resources per replica have limits that depend on the workload profile.

Health probes

Liveness probes tell the platform when to restart a stuck container. Readiness probes tell it when a container is ready to receive traffic. Startup probes give slow applications time to start. Good probes make rollouts safer.

Linux containers

Container Apps runs Linux containers. Check the current documentation for supported processor architectures and whether your images fit.

Image hygiene

Use small base images, pin versions, scan images for known flaws and rebuild regularly so that patches reach production.

Simple Analogy

A food stall has a main cook, a helper who washes and arranges plates beside the cook, and a person who prepares the counter before opening. The main container, the sidecar and the init container play those roles inside one replica.

!
Common Mistake

Using the “latest” tag for images in production. It makes it impossible to know exactly which version is running, and a new push can change the app unexpectedly. Use specific version tags or digests, so that every revision is reproducible.

6Ingress: Letting Traffic In

Ingress is the front door of your container app.

When ingress is enabled, the platform gives your app a web address and routes incoming requests to its replicas. You can choose how open that front door is.

Mode 1

External Ingress

The app is reachable from the public internet. Good for websites and public APIs.

Mode 2

Internal Ingress

The app is reachable only from inside the environment’s network. Good for back-end services that only other apps should call.

Mode 3

No Ingress

The app accepts no incoming web traffic. Used for background workers that pull work from queues.

HTTPS by default

External apps receive secure web addresses with certificates managed by the platform. You can add custom domains and your own certificates.

HTTP and TCP

Ingress supports web traffic and, for certain scenarios, raw TCP connections on chosen ports.

Calling other apps

Apps in the same environment can call each other by their app names, with built-in service discovery, so you do not manage addresses.

Access restrictions

You can limit which client addresses may reach an app, and apply authentication at the platform level using built-in sign-in support with identity providers.

Cross-origin and session options

Settings are available for cross-origin requests and for sticky sessions where an application needs them, though stateless design is preferred.

Simple Analogy

A restaurant can have a front entrance open to the street, a staff entrance only for employees and a kitchen with no door to the public at all. External, internal and no ingress correspond to these three doors.

i
Design Tip

Expose only the services that must be public, such as a web front end or an API gateway. Keep every other service internal, so that attackers cannot reach it directly.

!
Common Mistake

Leaving internal back-end services with external ingress “for easy testing”. They become reachable from the internet, with whatever weaknesses they have. Use internal ingress and test from inside the network.

7Revisions and Traffic Splitting

Revisions let you release new versions safely and roll back quickly.

Every revision is a frozen snapshot. In single-revision mode, which is the default, a new revision replaces the old one after it becomes healthy, and the old one is deactivated. In multiple-revision mode, several revisions can run at once, and you decide what percentage of traffic goes to each. This opens the door to safer release strategies.

StrategyHow it worksBest forRisk
Rolling replacementNew revision replaces the old one automatically after health checks passSimple apps and small changesBad releases reach everyone once healthy
Blue-greenRun old and new together, test the new one on its own address, then switch all traffic at onceChanges that need testing before exposureDoubles capacity briefly
CanarySend a small share of traffic to the new revision, watch results, then increase graduallyHigh-traffic apps and risky changesNeeds good monitoring to judge
A/B testingSend different users to different revisions to compare behaviourProduct experimentsNeeds consistent user routing and analysis
flowchart LR
  U["Incoming Traffic"] --> E["Ingress with Traffic Rules"]
  E -->|"90 percent"| R1["Revision 1: stable"]
  E -->|"10 percent"| R2["Revision 2: canary"]
  R2 --> M["Watch errors and latency"]
  M -->|"healthy"| P["Increase to 100 percent"]
  M -->|"problems"| RB["Send all traffic back to Revision 1"]
        
FIG 3 — A canary release using traffic splitting between revisions
1

Switch to multiple-revision mode

Allow several revisions to be active, so that old and new can run side by side.

2

Deploy the new revision with no traffic

Give it a label, which is a friendly name that creates a separate test address, and verify it directly.

3

Shift a small share of traffic

Start with a few percent, and watch error rates, response times and business metrics.

4

Increase or roll back

If all is well, raise the share to one hundred percent. If not, point traffic back to the previous revision instantly.

5

Retire old revisions

Deactivate revisions you no longer need to avoid paying for unused replicas and to keep things tidy.

Simple Analogy

A restaurant testing a new recipe serves it to a few tables first and watches reactions. If diners love it, it goes on the main menu. If they do not, the old recipe stays. Traffic splitting gives software the same safe way of trying a change.

!
Common Mistake

Running old and new revisions together when they are not compatible, for example when a database change breaks the old version. Plan backward-compatible changes to data and messages so that both revisions can work at the same time during a rollout.

8Scaling with KEDA: Rules, Limits and Scale to Zero

Scaling is the heart of Container Apps, and it is controlled by simple rules.

Each revision has a minimum and a maximum number of replicas. Between those limits, scale rules decide how many replicas should run. When a rule says that more capacity is needed, the platform starts new replicas. When demand drops, it removes them. If the minimum is zero and there is no work, the app scales to zero and costs nothing in consumption mode.

Rule typeWhat it watchesTypical use
HTTPNumber of concurrent requests per replicaWeb apps and APIs
TCPNumber of concurrent connections per replicaServices that use raw network connections
Queue or stream basedLength of a queue or lag in a stream, such as messages waiting in a service bus or event hubBackground workers and message processors
Custom KEDA scalerAny of many supported sources, such as databases, schedules and external systemsSpecial event-driven scenarios
CPU and memoryResource use of replicasCompute-heavy workers, with the caveat that these rules do not allow scaling to zero
flowchart TD
  Q["Messages waiting in a queue"] --> K["Scaler checks the length regularly"]
  K --> D{"More messages per replica than target?"}
  D -->|"Yes"| UP["Add replicas up to maximum"]
  D -->|"No"| DOWN["Remove replicas down to minimum"]
  DOWN --> Z["Zero messages and minimum zero: scale to zero"]
        
FIG 4 — A queue-based scale rule in action

Choosing good scale settings

Minimum replicas

Use zero for background workers and rarely used apps to save money. Use one or more for user-facing apps where cold start delays are not acceptable, or two or more for resilience.

Maximum replicas

Set a ceiling that protects your budget and your downstream systems, such as databases, from being overwhelmed by too many replicas at once.

Target values

For HTTP rules, choose a number of concurrent requests that one replica can handle comfortably. Test with load to find a sensible value.

Multiple rules

You can combine rules. The platform scales to the highest number of replicas that any rule demands.

Simple Analogy

A bank branch opens more counters when the queue grows and closes some when it shrinks, but never fewer than one counter during working hours and never more than the space allows. The minimum and maximum replicas are those limits, and the queue length is the rule.

!
Common Mistake

Letting a worker scale out without limit while it talks to a database that can handle only a few connections. The scaled-out app then overwhelms the database. Set maximum replicas with the capacity of every downstream system in mind.

9Workload Profiles and Pricing

Container Apps lets you choose between pay-per-use capacity and dedicated capacity, and you can mix them.

An environment can offer different workload profiles. A workload profile is a type of hardware capacity on which apps run. The platform has a consumption profile, where you pay for what your replicas use, and dedicated profiles, where you reserve machines of a chosen size for your apps and pay for them while they exist.

OptionHow you payStrengthsWatch out for
ConsumptionPer second of processor and memory used by running replicas, plus requests, with a free monthly allowanceScale to zero, no idle cost, simplePer-replica size limits, no special hardware, possible cold starts
DedicatedFor the machines in the profile, per hour, plus a management charge for the environmentLarger sizes, memory-optimised options, predictable performance and GPU choicesPay while nodes exist, even if lightly used
Mixed in one environmentEach app uses the profile you assignUse consumption for spiky apps and dedicated for heavy or steady onesMore choices to manage
Billing

Active and Idle Rates

On consumption, replicas that are running but not processing requests may be billed at a lower idle rate, and replicas scaled to zero are not billed for compute.

Billing

Requests

Consumption includes a charge for the number of requests, after a free allowance.

Billing

Supporting Services

Logs, container registry, networking and other services used by the apps are billed separately.

Billing

Savings Options

Commitment-based discounts may be available for steady usage. Check current offers.

Simple Analogy

Consumption is paying a taxi fare only when you ride. Dedicated is renting a car for the month: more space and predictability, but you pay even on days you do not drive. Many people use a taxi for occasional trips and rent a car for daily needs.

i
Practical Tip

Start every new workload on consumption. Move to a dedicated profile only when you hit a limit, such as the maximum replica size, a need for special hardware, or steady heavy usage that is cheaper on reserved capacity. Compare the monthly cost with the pricing calculator.

!
Common Mistake

Running a dedicated profile with many mostly idle nodes. You pay for the machines whether apps use them or not. Right-size the profile, use autoscaling of nodes where available and keep spiky apps on consumption.

10Jobs: Containers That Run and Finish

Not every workload is a service that waits for requests. Some tasks start, do their work and stop.

A container app job runs a container to completion. Unlike a normal app, which keeps running, a job starts when triggered, finishes its task and exits. You pay only for the time it runs. Jobs are ideal for batch processing, scheduled tasks and one-off operations.

Trigger 1

Manual Jobs

Started on demand by a person, a script or a pipeline. Good for one-off tasks such as data migrations.

Trigger 2

Scheduled Jobs

Started on a timetable, such as every night at midnight. Good for reports, clean-up and data syncing.

Trigger 3

Event-Driven Jobs

Started when events occur, such as a message arriving in a queue, with one execution per unit of work.

Parallelism and retries

A job can run several replicas in parallel and retry failed executions a set number of times, which helps with large batches.

Timeouts

Set a maximum execution time, so that a stuck job does not run forever and cost money.

Job history

The platform keeps a history of executions with their status, which helps with monitoring and debugging.

Simple Analogy

A restaurant stall is open all day and serves customers as they come. A job is the cleaning crew that arrives at closing time, finishes in an hour and leaves. You pay for one hour of cleaning, not for a crew that waits all day.

i
Jobs or Workers?

For queue processing, you can use either an always-available worker app that scales on queue length or an event-driven job with one run per message. Jobs suit longer, discrete tasks. Workers suit continuous streams of short messages.

!
Common Mistake

Writing jobs that cannot safely run twice. Retries and overlapping schedules may run the same task again. Make jobs idempotent, so that repeating them does not cause duplicates or damage.

11Microservices Help: Dapr and Service Discovery

Small services must find and talk to each other, and Container Apps offers help.

When an application is split into many services, a new set of problems appears. How does one service find another? How do you handle temporary failures? How do services send messages or share state? Dapr, the Distributed Application Runtime, is an open-source project that offers common building blocks for these problems. Container Apps can run a Dapr helper process beside your container, so your code calls simple local endpoints instead of learning each Azure service’s own interface.

Block 1

Service Invocation

Call other services by name, with built-in discovery, retries and secure connections.

Block 2

Publish and Subscribe

Send and receive messages through a broker, with a common interface that hides which broker is used.

Block 3

State Management

Save and read application state in a chosen store, without writing store-specific code.

Block 4

Bindings

Trigger your app from external events and send data to external systems through simple connectors.

Block 5

Secrets

Read secrets from a secure store through a standard interface.

flowchart LR
  O["Orders Service + Dapr helper"] -->|"service call by name"| I["Inventory Service + Dapr helper"]
  O -->|"publish event"| B["Message Broker"]
  B -->|"subscribe"| N["Notifications Service + Dapr helper"]
  I --> S["State Store"]
        
FIG 5 — Services using Dapr helpers to call, message and store state

Even without Dapr

Built-in service discovery

Apps in the same environment can call each other using the app name as a host name. This is often enough for small systems.

Resiliency policies

The platform can apply timeouts, retries and circuit breakers to calls between apps, so that a failing service does not drag down its callers. Check current availability and options in the documentation.

Simple Analogy

In a large office, staff could memorise every colleague’s extension and learn each department’s forms. A receptionist who connects calls by name and files forms correctly makes everyone’s work easier. Dapr is the receptionist for your services.

!
Common Mistake

Adding Dapr to every app by default “because it is available”. It adds a helper process and concepts to learn. Use it when its building blocks solve a real problem, and keep simple systems simple.

12Configuration and Secrets

Apps need settings and secrets, and they must reach the container safely.

An environment variable is a named setting passed to a container, such as the address of a database. Container Apps supports plain environment variables and secret-backed variables. A secret is a value, such as a password or an access token, that is stored securely by the platform and passed to the container only when needed.

Method 1

App-Level Secrets

Secrets stored with the container app and referenced by name in environment variables or scale rules. Simple, but values live in the app’s configuration.

Method 2

Key Vault References

The app refers to secrets stored in Azure Key Vault, using a managed identity. The secret value stays in the vault, with central rotation and audit.

Method 3

Managed Identity Access

The app authenticates to Azure services, such as databases and storage, using its identity, so that no secrets are needed at all.

1

Prefer identity over secrets

Where an Azure service supports identity-based access, use the app’s managed identity and avoid storing passwords.

2

Keep remaining secrets in Key Vault

Reference them from the app, so that rotation happens in one place.

3

Separate configuration from images

Build one image and supply different settings for development, test and production through environment variables.

4

Restrict who can read configuration

Use role-based access control so that only the right people can view or change secrets.

Simple Analogy

A hotel does not write guests’ room-safe codes on the door. It issues key cards that work only for the right room, and it keeps master records in a locked office. Managed identities and Key Vault are the key cards and the locked office.

!
Common Mistake

Baking secrets into container images or committing them to source control. Anyone with access to the image or repository can read them, and they stay in history. Keep secrets out of images and code.

13Networking and Connectivity

The environment decides how your apps connect to the world and to your private networks.

Option 1

Default Public Environment

The platform manages the network. Apps with external ingress receive public addresses. Simple to start with, with fewer network controls.

Option 2

Virtual Network Integration

The environment is placed in a subnet of your own virtual network, allowing private connections to databases, other services and on-premises systems.

Option 3

Internal-Only Environment

The environment has no public address. Apps are reachable only from inside your connected networks, often behind an application gateway or other front door.

Private endpoints

Private connectivity options let other resources in your network reach your apps over private addresses, or let your apps reach platform services privately.

Controlling outbound traffic

With virtual network integration, you can send outbound traffic through a firewall or NAT gateway for filtering and fixed addresses, using user-defined routes where supported.

Network security groups

Rules on the environment’s subnet can limit traffic, but you must keep the rules that the platform needs for its own operation. Check the documentation for required ports.

Subnet sizing

Environments use addresses from the subnet for their infrastructure and replicas. Plan the subnet size generously, since changing it later can be hard.

Front doors in front of apps

Many designs place an application gateway or a global front door in front of external apps, adding web application firewall protection, custom routing and caching.

Simple Analogy

A food court can have its own street entrance, or it can be inside a gated campus where only people with passes can enter. Virtual network integration moves your environment inside the campus, so that it can use the campus roads and be protected by its gates.

!
Common Mistake

Choosing the default public environment for a system that must reach private databases, and discovering later that the networking mode cannot simply be switched. Decide on network integration at creation time, based on your private connectivity needs.

Containers are temporary, so think carefully about where data lives.

Containers are designed to be replaced at any time. When a replica stops, anything written inside its own file system disappears. Good container designs keep data outside the container.

Type 1

Container File System

Temporary, tied to the life of the replica, and limited in size. Use for scratch files only.

Type 2

Ephemeral Volumes

Temporary storage shared between containers in the same replica, such as between a main container and a sidecar. Lost when the replica stops.

Type 3

Azure Files Volumes

A shared network file share mounted into containers. Data persists beyond replicas and can be shared among them.

Type 4

Secret Volumes

Secrets presented to the container as files, for software that expects configuration in file form.

Prefer managed data services

For structured data, use managed databases. For files and objects, use blob storage. For sessions and caches, use a managed cache. Keep the container stateless.

Stateless design pays off

Stateless apps scale out freely, restart safely and roll out new revisions without data worries.

File shares need care

Shared file volumes have performance and locking characteristics that suit some workloads and not others. They are not a replacement for a database.

Simple Analogy

A cook at a food stall should not keep the only copy of the family recipe in a pocket of the apron. The recipe belongs in a safe book at home, so that any new cook can work with it, and the stall can change staff at any time.

!
Common Mistake

Saving uploaded files or session data on the container’s local disk. The next replica will not see it, and a restart will erase it. Use shared storage or a database from the start.

15Security: Layers Around Your Containers

Because the platform is managed, security is a shared job with clear boundaries.

1

Platform security

Microsoft secures the clusters, nodes, patching and isolation between customers. You do not manage node operating systems.

2

Image security

Build from trusted, minimal base images, scan for vulnerabilities, sign images where possible and pull from a private registry using managed identity.

3

Identity and access

Use managed identities for the app, role-based access control for people and automation, and built-in authentication for user sign-in.

4

Network security

Use internal ingress for back-end apps, virtual network integration for private data access, firewalls or gateways in front of public apps and access restrictions where suitable.

5

Secrets and data

Keep secrets in Key Vault, use identity-based access to data stores and encrypt data in transit and at rest.

6

Runtime protection and monitoring

Run as non-root where possible, set resource limits, and use Microsoft Defender for Cloud and logging to detect suspicious behaviour.

Shared Duty

Microsoft’s Part

Cluster and node security, platform updates, tenant isolation and the control plane.

Shared Duty

Your Part

Application code, container images, secrets, network exposure, access control and data protection.

Simple Analogy

A cloud kitchen provider keeps the building safe, the equipment clean and the fire alarms working. You are still responsible for the ingredients you bring, the recipes you cook and who you let into your section of the kitchen.

!
Common Mistake

Believing that a managed platform makes the application secure. The platform protects the infrastructure, but a vulnerable library inside your image, an open endpoint or a leaked secret remains your problem. Scan, restrict and monitor.

16Observability: Logs, Metrics and Tracing

Without clear signals, a scaling system of small services is hard to understand.

Container Apps sends logs and metrics to Azure Monitor. Each environment is linked to a log destination, usually a Log Analytics workspace, where console output and system messages are stored and can be searched.

Signal 1

Console Logs

Whatever your application writes to standard output and error. Write clear, structured messages to make them useful.

Signal 2

System Logs

Messages from the platform about revisions, replicas starting and stopping, scaling and probe failures.

Signal 3

Metrics

Numbers such as replica count, requests, processor and memory use, and restarts, available for charts and alerts.

Signal 4

Distributed Traces

Records of a request as it passes through several services, collected through Application Insights or open telemetry support.

Live log streaming

You can watch console output in near real time, which helps when debugging a new revision.

Alerts worth setting

Alert on replica restarts, failed probes, high error rates, replicas stuck at the maximum and scale rules that never trigger.

Open telemetry support

A managed telemetry agent can receive traces, logs and metrics from your code in a standard format and forward them to your chosen tools.

Cost of logging

Logs are billed by volume. Avoid noisy debug logging in production, and set retention to match your needs.

Simple Analogy

A busy cloud kitchen needs a manager who sees how many orders are waiting, how long dishes take and where mistakes happen. Logs are the order slips, metrics are the wall clock and counters, and traces follow one order from the counter to the plate.

i
Log to Standard Output

Write application logs to standard output, not to files inside the container. Container logs stored in files disappear with the replica, while standard output is collected by the platform.

17Building and Deploying: From Code to Running App

A good pipeline turns a code change into a safe release without manual steps.

1

Commit code

Developers push changes to source control, which triggers the pipeline.

2

Build and test

The pipeline compiles the code, runs automated tests and builds a container image. Some tools can build images from source without a hand-written container file.

3

Scan and sign

The image is scanned for known vulnerabilities and, where your rules require, signed.

4

Push to the registry

The image is stored in a private registry with a unique version tag.

5

Deploy a new revision

The pipeline updates the container app with the new image, creating a new revision.

6

Verify and shift traffic

Automated checks confirm health, traffic is moved gradually, and the pipeline rolls back automatically if checks fail.

Tool

GitHub Actions and Azure DevOps

Common pipeline systems with ready-made steps for building images and updating container apps.

Tool

Command Line Shortcuts

Commands that can create an environment, build from source and deploy in a few steps, handy for learning and quick tests.

Tool

Infrastructure as Code

Templates that describe environments, apps and settings, so that every environment is created the same way.

Tool

Container Registry Tasks

Services that build images in the cloud and can trigger rebuilds when base images are updated.

Simple Analogy

A packaged-food factory takes raw ingredients, cooks, tests samples, seals the packs, labels them with a batch number and ships them in stages to shops. A deployment pipeline does the same with code: build, test, label, ship and watch.

!
Common Mistake

Deploying by hand from a laptop for production. There is no record, no tests and no easy way to repeat or undo it. Use a pipeline with approvals, and treat the app definition as code stored in version control.

18Container Apps Compared with Other Azure Options

Azure has several ways to run containers, and each fits a different situation.

ServiceLevel of controlOperations effortBest for
Azure Container AppsMedium: app, scaling and networking settings, no cluster accessLowMicroservices, APIs, event-driven workers and jobs without cluster management
Azure Kubernetes ServiceHigh: full Kubernetes API, custom components and policiesHighComplex platforms, custom operators, large teams with Kubernetes skills
App Service for containersLow to medium: web app hosting modelLowSingle web apps and APIs, with simple scaling
Azure Container InstancesLow: individual container groupsVery lowSimple, short-lived or burst containers without scaling rules
Azure FunctionsLow: function-level programming modelVery lowShort event-driven code, with options to host in containers
Virtual MachinesFull: operating system and everything aboveHighestLegacy or special software needing full machine control
flowchart TD
  Q1{"Need direct Kubernetes API or custom operators?"} -->|"Yes"| AKS["Azure Kubernetes Service"]
  Q1 -->|"No"| Q2{"Single simple web app?"}
  Q2 -->|"Yes"| AS["App Service"]
  Q2 -->|"No"| Q3{"Microservices, workers, jobs, event-driven scale?"}
  Q3 -->|"Yes"| ACA["Azure Container Apps"]
  Q3 -->|"Short function-style code"| FN["Azure Functions"]
        
FIG 6 — A simple way to choose among container hosting options
Simple Analogy

AKS is renting a full commercial kitchen with freedom to arrange everything. Container Apps is a cloud kitchen that handles equipment. App Service is a ready stall for one dish. Container Instances is a pop-up counter for a single day. Choose according to how much kitchen management you want.

Choose Container Apps when

You want containers and microservices with autoscaling, scale to zero, traffic splitting and jobs, without managing Kubernetes.

Choose AKS when

You need access to the Kubernetes API, custom controllers, special network setups or you already have a platform team that runs clusters.

Choose App Service when

Your application is a single web app or API and you value the simplest possible hosting.

i
Portability Helps

Because the deployment unit is a standard container, moving between these services later is far easier than moving between platforms that use proprietary formats. Keep your images and configuration clean to preserve this freedom.

19Design Patterns That Work Well

These layouts appear again and again in successful Container Apps systems.

Pattern: Public Front End, Private Back End

One web front end or API gateway has external ingress. All other services have internal ingress and talk to each other inside the environment.

Pattern: Queue-Based Worker

A web app places work on a queue. A worker app with no ingress scales on queue length, from zero when idle to many replicas when busy.

Pattern: Scheduled Job for Housekeeping

A scheduled job runs reports, cleans old data and syncs systems on a timetable, costing money only while it runs.

Pattern: Canary Release with Revisions

New revisions receive a small share of traffic first. Automated checks on error rates and latency decide whether to continue or roll back.

Pattern: Sidecar for Cross-Cutting Needs

A sidecar container handles tasks such as log forwarding or a local proxy beside the main container, keeping application code simple.

Pattern: Event-Driven Processing Pipeline

Stages of a pipeline are separate apps connected by queues or topics. Each stage scales independently according to its own backlog.

“Scale each small service by its own workload, and pay only while it works.”

20Real-World Examples

Container Apps suits many everyday systems, particularly those with uneven traffic.

An online shop with sales peaks

The storefront, cart, catalogue and order services run as separate apps. During festival sales the storefront and cart scale out fast, while the less busy services stay small. After the sale they scale back automatically.

Image and document processing

Uploaded files trigger messages. A worker app scales from zero as files arrive, processes them in parallel and goes back to zero when the backlog is done, so the company pays only for actual processing.

Internal APIs for a business

Small APIs for HR, finance and reporting run with minimum cost because they scale to zero outside office hours. Internal ingress keeps them away from the internet.

Scheduled data jobs

Nightly jobs import data, build reports and clean old records. They start at a fixed time, run in parallel if needed and finish, with retry and history for monitoring.

Software-as-a-service back ends

A start-up runs all its back-end services in one environment with traffic splitting for safe releases, and moves a few heavy services to a dedicated profile as customers grow.

AI-powered applications

Teams host model-serving apps, retrieval services and agents that call model APIs. Apps scale with demand, and certain workloads use dedicated profiles with special hardware where available. Isolated sandbox features can run untrusted generated code safely, subject to current product availability.

Advantages

  • No cluster to build, patch or upgrade
  • Scale to zero and event-driven scaling with KEDA
  • Built-in revisions, traffic splitting and jobs
  • Optional Dapr building blocks for microservices
  • Standard containers keep you portable

Disadvantages / Trade-offs

  • No direct access to the Kubernetes API or custom operators
  • Cold starts when scaling from zero
  • Per-replica size limits on consumption, and Linux containers only
  • Network mode choices are hard to change after creation
  • Features evolve quickly, so documentation must be rechecked

21Anti-Patterns to Avoid

These habits regularly cause outages, leaks and surprise bills.

ANTI-PATTERN-01 Avoid
Problem

Every service has external ingress so that it can be reached “easily”, and none are protected by a gateway or firewall.

Why It’s Harmful

Back-end services are exposed to the internet and attacked directly. Weak spots in any one service become entry points to the whole system.

Correct Approach

Expose only a front door. Use internal ingress for everything else, restrict access and place a gateway with web protection in front of public apps.

ANTI-PATTERN-02 Avoid
Problem

Applications store files and session data on the container’s local disk and keep important state in memory.

Why It’s Harmful

Replicas are replaced and scaled at any time. State disappears, different replicas show different data and rollouts cause lost sessions.

Correct Approach

Keep services stateless. Use managed databases, caches and storage for data and sessions.

ANTI-PATTERN-03 Avoid
Problem

Scale rules have a huge maximum or none at all, and workers scale out against databases and external APIs with strict limits.

Why It’s Harmful

A burst of messages creates many replicas that overwhelm downstream systems, causing failures, throttling and large bills.

Correct Approach

Set sensible maximum replicas based on downstream capacity, add retry and back-off in code and alert when replicas reach the maximum.

ANTI-PATTERN-04 Avoid
Problem

Images use the latest tag, secrets are placed in images or source control, and deployments are done by hand.

Why It’s Harmful

Nobody knows exactly what runs in production, secrets leak through images and history, and releases cannot be repeated or undone reliably.

Correct Approach

Use unique version tags or digests, keep secrets in Key Vault with managed identities, and deploy through pipelines with tests and approvals.

ANTI-PATTERN-05 Avoid
Problem

Teams pick a dedicated profile and a high minimum replica count for every app, and keep many old revisions active.

Why It’s Harmful

Idle capacity and unused revisions cost money all month, and the benefits of scale to zero are lost.

Correct Approach

Start on consumption, use zero minimum replicas where cold starts are acceptable, deactivate old revisions and review usage and costs monthly.

22Best Practices and a Starter Checklist

Walk through these steps whenever you plan a new Container Apps workload.

1

Confirm it is the right platform

Check that you do not need direct Kubernetes control, and that Linux containers fit your app.

2

Decide the network up front

Choose virtual network integration and internal or external environment based on private connectivity and security needs, before creating the environment.

3

Build clean, small, versioned images

Use minimal base images, scan them, tag them uniquely and pull them from a private registry with managed identity.

4

Keep apps stateless and add health probes

Store data in managed services and define liveness, readiness and startup probes.

5

Set thoughtful scale rules

Choose minimum and maximum replicas, target values and triggers, based on load tests and downstream capacity.

6

Secure configuration

Use managed identities first, Key Vault for remaining secrets, internal ingress for back ends and access restrictions where useful.

7

Release safely

Deploy through pipelines, use revisions with traffic splitting for canary or blue-green rollouts, and keep rollback ready.

8

Observe and control cost

Send logs to a workspace, set alerts on restarts, errors and scaling, use consumption by default, and review revisions and spending monthly.

!
Frequent Beginner Mistakes

Making every app public, storing state in containers, using the latest tag, ignoring downstream limits when scaling, forgetting health probes, choosing the wrong network mode, keeping idle revisions and dedicated capacity, and writing secrets into images.

23Frequently Asked Questions

Q1Is Azure Container Apps the same as Kubernetes?

No. It runs on Kubernetes behind the scenes, but you do not manage or access the cluster. You work with simple concepts such as apps, revisions and scale rules, and the platform handles the rest.

Q2What does scale to zero mean?

When there is no traffic or work, the platform can reduce the replicas of an app to zero, so that you pay nothing for compute on the consumption profile. When a request or event arrives, a replica starts, which causes a short delay known as a cold start.

Q3What is a revision?

A revision is an unchangeable snapshot of a version of your container app, including its image and key settings. New versions create new revisions, and you can route traffic between revisions or roll back to an older one.

Q4How is Container Apps different from Azure Kubernetes Service?

Container Apps is a higher-level, simpler service with built-in scaling and no cluster access. Kubernetes Service gives full control of the Kubernetes API and cluster, with more flexibility and much more to operate.

Q5What is KEDA and why does it matter?

KEDA is an open-source tool for event-driven autoscaling. In Container Apps it allows apps to scale on many signals, such as queue length, stream lag and custom sources, and to scale to zero when idle.

Q6When should I use jobs instead of apps?

Use jobs for tasks that start, finish and exit, such as batch processing, scheduled work and one-off operations. Use apps for services that stay available to handle requests or continuous streams of messages.

Q7Can my apps reach private databases?

Yes, if you create the environment with virtual network integration, so that apps run inside your own network and can use private connections. Decide this when you create the environment, as it is hard to change later.

Q8How are containers updated without downtime?

Deploying a new image creates a new revision. The platform starts the new replicas, checks their health and then shifts traffic, and with multiple-revision mode you can control the shift gradually and roll back if problems appear.

Q9How do I keep costs low?

Use the consumption profile by default, scale to zero where cold starts are acceptable, set sensible maximum replicas, deactivate unused revisions, keep log volume reasonable and use dedicated profiles only when you need their size or hardware.

Q10Should I use Dapr?

Use Dapr when its building blocks, such as service invocation, pub-sub messaging and state management, solve real problems in your microservices. For simple systems, built-in service discovery and direct service calls are often enough.

24Summary and Key Takeaways

Azure Container Apps lets you run containers and microservices on a serverless platform that hides the complexity of Kubernetes. You create an environment, deploy container apps made of revisions and replicas, expose them through ingress when needed and scale them with simple rules powered by KEDA, even down to zero. Jobs handle tasks that run and finish, Dapr helps services work together, and workload profiles let you choose between pay-per-use and dedicated capacity. With stateless design, careful network and security choices, safe releases through revisions and clear observability, you can build flexible and economical systems, while remembering that the platform trades some control for simplicity.

Key Takeaways

  • Serverless containers — you bring images and settings, and the platform runs, scales and heals them without a cluster for you to manage.
  • Four core objects — environments hold apps, apps are made of immutable revisions, and revisions run as replicas that the platform adds and removes.
  • Scale by events — KEDA-powered rules react to requests, queues and custom signals, with minimum and maximum replicas, and scale to zero on consumption.
  • Release safely — use revisions and traffic splitting for canary and blue-green releases, with fast rollback and compatible data changes.
  • Choose capacity wisely — start on consumption and add dedicated profiles only for size, hardware or steady heavy load, watching idle and minimum-replica costs.
  • Design for the platform — keep services stateless, use internal ingress, managed identities and Key Vault, decide network mode early and log to standard output.
  • Know the trade-offs — Container Apps gives simplicity and low operations effort, but no direct Kubernetes access, so choose a Kubernetes service when you need that control, and always recheck features in the current documentation.