Run a container on Azure Container Apps
In this task you'll run a container with a public address and no servers to manage.
Azure Container Apps runs containers without a cluster to look after. Apps live in an environment and scale on traffic, even to zero. Each change makes a new revision.
A Container Apps job runs a container to completion on a schedule or on demand, and stops.
Example. SS Kaiser's nightly report moved from an always-on VM to a Container Apps job that runs for five minutes a night.
Costs money. This task creates resources that are charged while they exist. Delete them as soon as you finish.
Before you start
You need: Contributor on a resource group. Time: 15 minutes.
Where to look
- Home
- Container Apps
- Create
Steps
- Run
az containerapp up -n hello -g rg-dv-practice -l uksouth --image mcr.microsoft.com/k8se/quickstart:latest --ingress external --target-port 80. - Open the URL it prints.
- Run
az containerapp revision list -n hello -g rg-dv-practice -o table.
Commands
az containerapp up -n hello -g rg-dv-practice -l uksouth --image mcr.microsoft.com/k8se/quickstart:latest --ingress external --target-port 80
az containerapp job create -n job-nightly -g rg-dv-practice --environment <env> --trigger-type Schedule --cron-expression "0 2 * * *" --image mcr.microsoft.com/k8se/quickstart-jobs:latest --cpu 0.25 --memory 0.5Gi
Watch out for
- Cost
- Consumption plan: a monthly free allowance, then per second of use. Pennies for practice.
- Security
- Use managed identity to pull from your registry and reach Key Vault.
- Common mistakes
- On our free trial the whole subscription could have only one Container Apps environment (MaxNumberOfGlobalEnvironmentsInSubExceeded): delete old ones first.
Clean up
Delete the resource group. Environments take a few minutes to delete.
Words to know
- Environment
- The boundary apps share: network and logs.
- Revision
- An immutable version of an app.
- Job
- A container that runs to completion.
Tick off each step and track your progress in the guide.
Open this task in DevOps, Hands On