A developer is configuring a continuous integration workflow using Azure Container Registry (ACR). The developer needs to automate container image builds whenever source code changes are pushed to a GitHub repository. The developer plans to create a task in the registry named acrtask204 to build and push the image. Which sequence of steps should the developer perform to configure, execute, and monitor the task?
- 1Generate a GitHub Personal Access Token (PAT) with appropriate scopes to access the repository.
- 2Run the `az acr task create` command, specifying the repository URL, task name, and the GitHub PAT.
- 3Run the `az acr task run` command to manually trigger the build task for the first time.
- 4Run the `az acr task logs` command to stream the build logs and monitor the progress.
Answer
The correct sequence of steps is: first generate a GitHub Personal Access Token (PAT); second, create the task using the `az acr task create` command; third, trigger the task manually using the `az acr task run` command; and finally, view the build logs using the `az acr task logs` command.
The correct sequence starts with generating a GitHub Personal Access Token (PAT) because authentication credentials must exist before creating the task. Next, the task is created using the `az acr task create` command to specify the repository and credentials. Once defined, the task is manually triggered using `az acr task run`. Finally, the progress of the execution is monitored by streaming the build logs using the `az acr task logs` command.
Step-by-Step Solution
Key Concept
Automating container builds and image management using Azure Container Registry (ACR) Tasks with source code triggers.
Estimated Time:2m 0s