Lesson 3 of 4 Azure Container Services

Running Applications with Azure Container Apps

This lesson explains Container Apps environments, ingress, revisions and other capabilities, and how the service compares with Container Instances.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe Container Apps environments and ingress options.
  • Explain revisions and traffic splitting.
  • Distinguish between Container Apps and Container Instances.

Environments and apps

Every container app runs in a Container Apps environment, a secure boundary around a group of apps that share a virtual network and write logs to the same Log Analytics workspace. An environment can use its own VNet (with a dedicated subnet) for private networking and can be internal-only. Environments support the serverless Consumption workload profile and optional dedicated workload profiles with reserved hardware, including GPU profiles.

Creating a container app sets the environment, the container (image from ACR, Docker Hub or another registry; CPU and memory; environment variables), secrets (values or Key Vault references), ingress and scale. Ingress is external (reachable from the internet, or from the VNet for an internal environment) or internal (reachable only from other apps in the environment), with a target port, HTTP or TCP transport and an automatic HTTPS endpoint such as app-name.region-hash.region.azurecontainerapps.io.

True or false

Environments and ingress

Exam skills 3.3.3

Check how Container Apps environments and ingress work.

Log in to try this activity Interactive activities are free with an account.

Revisions and traffic splitting

A revision is an immutable snapshot of a container app's template: the containers, their settings and the scale rules. Changing these creates a new revision, while changes to application-wide settings such as ingress or secrets do not. In single revision mode, the default, the new revision replaces the old one once it is ready. In multiple revision mode, several revisions run at the same time and traffic weights split requests between them, enabling blue-green deployments and canary testing. Revision labels give a revision a stable URL for testing.

The following diagram shows the traffic weights between two revisions over a canary release in Azure Container Apps.

A canary release in Azure Container Apps. In multiple revision mode, deploying the new image creates a new revision; traffic weights send 90% to the current revision and 10% to the new one for a day, then 100% to the new one. Rolling back means moving the weight back, which single revision mode cannot do.
The scenario is illustrative.
Sort into groups

New revision or not?

Exam skills 3.3.3

Decide whether each change to a container app creates a new revision.

Log in to try this activity Interactive activities are free with an account.

Other capabilities

Container Apps also provides jobs (manual, scheduled with a cron expression, or event-driven) for tasks that run to completion, Dapr integration for service invocation, state and pub/sub, built-in authentication, managed identities for registry pulls and Azure services, custom domains with free managed certificates, volume mounts for Azure Files, and log streaming and console access. The table below contrasts it with Container Instances.

RequirementContainer InstancesContainer Apps
Run a single container or task quicklyYesYes (jobs)
HTTPS ingress with automatic certificateNo (public IP and DNS label)Yes
Autoscaling and scale to zeroNoYes
Revisions and traffic splittingNoYes
Scenario questions

Container Apps or Container Instances?

Exam skills 3.3.2 · 3.3.3

Choose the container service that fits each workload.

Log in to try this activity Interactive activities are free with an account.
Worked example

A canary release

An API runs as a container app. The team wants to send 10% of traffic to a new image version for a day and then move all traffic to it, with an instant rollback option. What should you configure?

Switch the app to multiple revision mode, deploy the new image (creating a new revision), and set traffic weights of 90% to the current revision and 10% to the new one. After validation, set the new revision to 100%; rolling back means moving the weight back to the old revision. Single revision mode would replace the old revision immediately.

Check yourself

Which revision mode is needed to split traffic between two versions of a container app?

Show answer

Multiple revision mode.

Exam Tips

Remember for the exam

  • Apps share an environment, which provides the network boundary and Log Analytics workspace.
  • Internal ingress: reachable only within the environment.
  • Traffic splitting needs multiple revision mode.
  • Run-to-completion tasks: Container Apps jobs.