Container Instances, Container Apps or AKS: which one?
In this task you'll find the three main places to run containers.
A container packs an app with everything it needs to run, so it behaves the same on a laptop and in the cloud. Docker is the best-known tool for building them. The packed-up app is called an image, and images are kept in a registry.
Azure has three main places to run containers. Container Instances run one container (or a small group) on demand, billed by the second. Container Apps run web apps and background workers that scale up and down by themselves, even to zero. AKS (Azure Kubernetes Service) gives you a full Kubernetes cluster for the most control.
Example. Ironbridge Payments uses all three: a nightly report job runs in Container Instances, its customer-facing API runs in Container Apps, and a large platform team runs dozens of services on AKS.
Before you start
You need: Any user (to look). Time: 10 minutes.
Where to look
- Home
- Search: container
Steps
- Type container in the search bar and look at the services listed: Container instances, Container Apps, Container registries and Kubernetes services.
- Open Container instances and then + Create, read the Basics tab, and close it without creating anything.Notice how few settings there are: an image, a size and a network. That's its strength.
- Open Container Apps, then + Create, and look at the tabs, including Ingress and the environment. Close it. A banner may offer a simpler, separate Container Apps portal: you can ignore it.An environment is a shared boundary for several container apps, with one network and one place for logs.
- Open Kubernetes services, then + Create, and look at the node pools and networking options. Close it.The extra settings show how much more you control, and look after, with AKS.
- Decide which fits. A short job or a quick test: Container Instances. A web app or API that should scale by itself: Container Apps. Many services and a team that knows Kubernetes: AKS.
Tip. Type container in the search bar to see Container Instances, Container Apps, Container registries and Kubernetes services side by side.
Commands
# What's running where, in the current subscription
az container list --output table
az containerapp list --output table
az aks list --output table
Watch out for
- Cost
- Looking is free. Container Instances bill per second while running, Container Apps has a monthly free allowance, and AKS bills for its nodes (VMs) all the time they run.
- Security
- Whichever you pick, keep images in a private registry and give the service a managed identity to pull them, rather than storing passwords.
- Common mistakes
- Choosing AKS for one small app, and then running and paying for a whole cluster. Choosing Container Instances for a web app that needs to scale, which it can't do by itself.
Clean up
Nothing to clean up, as long as you closed each Create page without creating anything.
Words to know
- Image
- A packaged app, ready to run as a container.
- Registry
- A store for images, such as Azure Container Registry or Docker Hub.
- Kubernetes
- Open-source software that runs and manages many containers across many machines.
- Scale to zero
- Running no copies at all when there's no traffic, so you pay nothing for idle time.
Tick off each step and track your progress in the guide.
Open this task in Azure Portal, Hands On