Wingtip Toys stores the source and Dockerfile for its recommendation API in a private GitHub repository. Every commit to the main branch must build a new image and push it to Azure Container Registry, tagged with the run ID. Which command should you use to set this up?
- A.
az acr import with the GitHub repository as --source
- B.
az acr webhook create with the push action on the repository
- C.
az acr task create with the repo #main as --context and a GitHub PAT
- D.
az acr build with the repository URL as the build context
Show answer
Answer: C
az acr task create with a GitHub context such as https://github.com/org/repo.git#main, a Dockerfile and a PAT sets up commit-triggered builds.
- A. Import copies existing images from registries; it can't read a Git repository.
- B. A registry webhook reacts to registry pushes, not to commits in GitHub.
- C. A task with a Git context and personal access token creates the webhook that triggers builds on commit.
- D. az acr build runs one quick build on demand and creates no commit trigger.
