Containers: ACR, Container Instances and Container Apps
Store images in Azure Container Registry, run them quickly in Container Instances, and scale microservices with Container Apps.
In this lesson you'll learn
- What containers are and the build, push and run flow
- Container Registry SKUs, tasks and access
- Container Instances: groups, restart policies and storage
- Container Apps: revisions, scaling rules and when to pick AKS
1. The container flow
New to containers? Start here
A container image packages an app with everything it needs to run: code, runtime and libraries. It runs the same on a laptop, a test server or Azure. A registry stores images, like an app store for your own software.
2. Azure Container Registry
| SKU | Adds |
|---|---|
| Basic | Entry level storage and throughput |
| Standard | More storage and throughput |
| Premium | Geo-replication, private endpoints, content trust |
az acr build --registry crsskaiser --image shop:v2 . az aks update -n aks-shop -g rg-apps --attach-acr crsskaiser
- ACR Tasks (az acr build) builds images in Azure, with no Docker on your machine.
- Grant AcrPull to services that only pull images, and AcrPush to build pipelines.
3. Azure Container Instances
The fastest way to run a container: no servers and no orchestrator, billed per second.
- A container group is a set of containers sharing a host, network and storage. Multi-container groups are Linux only.
- Restart policies: Always (default), OnFailure and Never.
- For data that must survive restarts, mount an Azure file share as a volume.
- Set the IP address type to Public for internet access, optionally with a DNS name label.
4. Azure Container Apps
Serverless containers for web APIs, microservices and background workers, with Kubernetes power but none of the cluster management.
- Scaling rules: HTTP traffic, TCP connections, CPU and memory, or event-driven rules powered by KEDA, such as messages waiting in Service Bus. Apps can scale to zero.
- Revisions are immutable versions of an app. In multiple revision mode you can split traffic, for example 80% to v1 and 20% to v2.
| Need | Service |
|---|---|
| Run one container quickly, a batch job or a simple task | Container Instances |
| Microservices that scale on events and traffic | Container Apps |
| Full Kubernetes control and custom networking | AKS |
Example
SS Kaiser's order processor reads messages from a Service Bus queue. Overnight the queue is empty, so the Container App scales to zero and costs nothing. When the morning rush arrives, its KEDA rule sees 5,000 waiting messages and scales to 20 replicas within a minute.
Exam traps to remember
- Push to the registry before deploying the image anywhere.
- Geo-replication needs ACR Premium.
- Windows containers in ACI support single-container groups only.
- Scaling on queue messages means an event-driven (KEDA) rule.
Test yourself: 3 check questions and exam-style practice questions on this topic are in the AZ-104 Azure Administrator app.
Practise in the app