Skill 1.1.2

Build and run images by using Azure Container Registry Tasks

Key Concepts

A quick task runs az acr build, which uploads a build context (a local folder, a Git repository URL or a tarball), builds the Dockerfile in Azure and pushes the result to the registry. az acr run runs a command or a YAML file in a container in Azure. Builds target linux/amd64 by default, and the --platform option selects other architectures. Task logs stream to the console for manual runs and are stored for automatic runs.

Tasks created with az acr task create run automatically on a source code commit (on by default when the context is a Git repository), a pull request (off by default), a base image update or a timer. Multi-step tasks describe build, push and cmd steps in a YAML file, so one task can build an image, run its tests in a container and push it only if they pass. Run variables such as {{.Run.ID}} give each image a unique tag.