An Azure container registry stores and manages private Docker container images, similar to the way Docker Hub stores public Docker images. It can also host repositories for Helm charts (preview), a packaging format to deploy applications to Kubernetes. You can use webhooks to trigger events when certain actions take place in one of your registry repositories. Webhooks can respond to events at the registry level, or they can be scoped down to a specific repository tag. With a geo-replicated registry, you configure each webhook to respond to events in a specific regional replica.
The endpoint for a webhook must be publicly accessible from the registry. You can configure registry webhook requests to authenticate to a secured endpoint.
For details on webhook requests, see Azure Container Registry webhook schema reference.
PrerequisitesExample webhook form:
Create webhook - Azure CLITo create a webhook using the Azure CLI, use the az acr webhook create command. The following command creates a webhook for all image delete events in the registry mycontainerregistry:
az acr webhook create --registry mycontainerregistry --name myacrwebhook01 --actions delete --uri http://webhookuri.com
Test webhook Azure portal
Prior to using the webhook, you can test it with the Ping button. Ping sends a generic POST request to the specified endpoint and logs the response. Using the ping feature can help you verify you've correctly configured the webhook.
To test an ACR webhook with the Azure CLI, use the az acr webhook ping command.
az acr webhook ping --registry mycontainerregistry --name myacrwebhook01
To see the results, use the az acr webhook list-events command.
az acr webhook list-events --registry mycontainerregistry08 --name myacrwebhook01
Delete webhook Azure portal
Each webhook can be deleted by selecting the webhook and then the Delete button in the Azure portal.
Azure CLIaz acr webhook delete --registry mycontainerregistry --name myacrwebhook01
Next steps Webhook schema reference
For details on the format and properties of the JSON event payloads emitted by Azure Container Registry, see the webhook schema reference:
Azure Container Registry webhook schema reference
Event Grid eventsIn addition to the native registry webhook events discussed in this article, Azure Container Registry can emit events to Event Grid:
Quickstart: Send container registry events to Event Grid
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4