A developer needs to configure an Azure Container Registry (ACR) named `registry204` to notify an external service via a webhook whenever a new container image tag is pushed. The developer must also verify that the webhook is successfully triggered by a push event. Which sequence of steps should the developer perform?
- 1Ensure the Azure Container Registry is configured with the Standard or Premium service tier, and obtain the target webhook destination URL.
- 2Run the `az acr webhook create` command, specifying the registry name, a unique webhook name, the target URL, and setting the actions parameter to `push`.
- 3Authenticate to the registry, tag a local container image, and run the `docker push` command to upload the image.
- 4Run the `az acr webhook list-events` command to review the delivery log and response status of the webhook trigger.
Answer
First, verify that the Azure Container Registry is using either the Standard or Premium service tier and obtain the target webhook URL. Next, create the webhook with the `az acr webhook create` command, configuring it to trigger on the `push` action. Then, perform a `docker push` to upload a container image to the registry, triggering the webhook. Finally, run the `az acr webhook list-events` command to verify successful delivery of the webhook notification.
The correct order begins with verifying that the registry is Standard or Premium tier (as Basic does not support webhooks) and obtaining the target URL. Next, the webhook must be created using the `az acr webhook create` command. After the webhook is created, a container image is pushed to trigger the webhook. Finally, the event delivery is verified by running the `az acr webhook list-events` command.
Step-by-Step Solution
Key Concept
Configuring and verifying webhooks in Azure Container Registry (ACR) to respond to image push events.