You need to configure an automated build and push process for a containerized application using Azure Container Registry (ACR) Tasks. The process must trigger automatically whenever source code in a private GitHub repository is updated. Which sequence of steps should you perform to create and verify the triggered build task?
- 1Generate a GitHub Personal Access Token (PAT) with 'repo' and 'admin:repo_hook' permissions.
- 2Create the task by running the 'az acr task create' command, specifying the registry, repository URL, target image name, and the PAT.
- 3Run the 'az acr task run' command to trigger a manual execution of the task.
- 4Push a commit to the GitHub repository to verify that the webhook triggers the build automatically.
Cevap
To configure and verify the triggered task, first generate a GitHub Personal Access Token (PAT) with repository and hook permissions. Next, create the task using the 'az acr task create' command with the PAT. Then, manually run the task using the 'az acr task run' command to verify the build configuration. Finally, push a commit to the GitHub repository to verify that the automated trigger functions correctly.
The correct order requires generating a GitHub Personal Access Token (PAT) first, since the token must be supplied during task creation to register the webhook. The task must then be created with 'az acr task create'. Testing the build with 'az acr task run' ensures that the build configuration is correct before verifying the automated webhook trigger by pushing a code change.
Adım Adım Çözüm
Anahtar Kavram
Automating container image builds with Azure Container Registry Tasks and GitHub commit triggers.