az acr webhook

Manage webhooks for Azure container registries.

Commands

az acr webhook create Creates a webhook for a container registry.
az acr webhook delete Deletes a webhook from a container registry.
az acr webhook get-config Gets the configuration of service URI and custom headers for the webhook.
az acr webhook list Lists all the webhooks for the specified container registry.
az acr webhook list-events Lists recent events for the specified webhook.
az acr webhook ping Triggers a ping event to be sent to the webhook.
az acr webhook show Gets the properties of the specified webhook.
az acr webhook update Updates a webhook.

az acr webhook create

Creates a webhook for a container registry.

az acr webhook create --actions {delete, push}
--name
--registry
--uri
[--headers]
[--resource-group]
[--scope]
[--status {disabled, enabled}]
[--tags]

Examples

Create a webhook for a container registry that will deliver Docker push and delete events to the specified service URI.

az acr webhook create -n MyWebhook -r MyRegistry --uri http://myservice.com --actions push delete

Create a webhook for a container registry that will deliver Docker push events to the specified service URI with Basic authentication header.

az acr webhook create -n MyWebhook -r MyRegistry --uri http://myservice.com --actions push --headers "Authorization=Basic 000000"

Required Parameters

--actions

Space separated list of actions that trigger the webhook to post notifications.

accepted values: delete, push
--name -n

The name of the webhook.

--registry -r

The name of the container registry. You can configure the default registry name using az configure --defaults acr=.

--uri

The service URI for the webhook to post notifications.

Optional Parameters

--headers

Space separated custom headers in 'key[=value]' format that will be added to the webhook notifications. Use "" to clear existing headers.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

--scope

The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means events for all repositories.

--status

Indicates whether the webhook is enabled.

accepted values: disabled, enabled
default value: enabled
--tags

Space separated tags in 'key[=value]' format. Use "" to clear existing tags.

az acr webhook delete

Deletes a webhook from a container registry.

az acr webhook delete --name
--registry
[--resource-group]

Examples

Delete a webhook from a container registry.

az acr webhook delete -n MyWebhook -r MyRegistry

Required Parameters

--name -n

The name of the webhook.

--registry -r

The name of the container registry. You can configure the default registry name using az configure --defaults acr=.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

az acr webhook get-config

Gets the configuration of service URI and custom headers for the webhook.

az acr webhook get-config --name
--registry
[--resource-group]

Examples

Get service URI and headers for the webhook.

az acr webhook get-config -n MyWebhook -r MyRegistry

Required Parameters

--name -n

The name of the webhook.

--registry -r

The name of the container registry. You can configure the default registry name using az configure --defaults acr=.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

az acr webhook list

Lists all the webhooks for the specified container registry.

az acr webhook list --registry
[--resource-group]

Examples

List webhooks and show the results in a table.

az acr webhook list -r MyRegistry -o table

Required Parameters

--registry -r

The name of the container registry. You can configure the default registry name using az configure --defaults acr=.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

az acr webhook list-events

Lists recent events for the specified webhook.

az acr webhook list-events --name
--registry
[--resource-group]

Examples

List recent events for the specified webhook.

az acr webhook list-events -n MyWebhook -r MyRegistry

Required Parameters

--name -n

The name of the webhook.

--registry -r

The name of the container registry. You can configure the default registry name using az configure --defaults acr=.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

az acr webhook ping

Triggers a ping event to be sent to the webhook.

az acr webhook ping --name
--registry
[--resource-group]

Examples

Triggers a ping event to be sent to the webhook.

az acr webhook ping -n MyWebhook -r MyRegistry

Required Parameters

--name -n

The name of the webhook.

--registry -r

The name of the container registry. You can configure the default registry name using az configure --defaults acr=.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

az acr webhook show

Gets the properties of the specified webhook.

az acr webhook show --name
--registry
[--resource-group]

Examples

Get the properties of the specified webhook.

az acr webhook show -n MyWebhook -r MyRegistry

Required Parameters

--name -n

The name of the webhook.

--registry -r

The name of the container registry. You can configure the default registry name using az configure --defaults acr=.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

az acr webhook update

Updates a webhook.

az acr webhook update --name
--registry
[--actions {delete, push}]
[--add]
[--headers]
[--remove]
[--resource-group]
[--scope]
[--set]
[--status {disabled, enabled}]
[--tags]
[--uri]

Examples

Update headers for a webhook

az acr webhook update -n MyWebhook -r MyRegistry --headers "Authorization=Basic 000000"

Update service URI and actions for a webhook

az acr webhook update -n MyWebhook -r MyRegistry --uri http://myservice.com --actions push delete

Disable a webhook

az acr webhook update -n MyWebhook -r MyRegistry --status disabled

Required Parameters

--name -n

The name of the webhook.

--registry -r

The name of the container registry. You can configure the default registry name using az configure --defaults acr=.

Optional Parameters

--actions

Space separated list of actions that trigger the webhook to post notifications.

accepted values: delete, push
--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty .

--headers

Space separated custom headers in 'key[=value]' format that will be added to the webhook notifications. Use "" to clear existing headers.

--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

--scope

The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means events for all repositories.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

--status

Indicates whether the webhook is enabled.

accepted values: disabled, enabled
--tags

Space separated tags in 'key[=value]' format. Use "" to clear existing tags.

--uri

The service URI for the webhook to post notifications.