Skip to main content

webhooks

Creates, updates, deletes, gets or lists a webhooks resource.

Overview

Namewebhooks
TypeResource
Idazure.container_registry.webhooks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the private link resource.
actionsarrayThe list of actions that trigger the webhook to post notifications. Required.
locationstringThe geo-location where the resource lives. Required.
provisioningStatestringThe provisioning state of the webhook at the time the operation was called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". (Creating, Updating, Deleting, Succeeded, Failed, Canceled)
scopestringThe 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 all events.
statusstringThe status of the webhook at the time the operation was called. Known values are: "enabled" and "disabled". (enabled, disabled)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, registry_name, webhook_name, subscription_idGets the properties of the specified webhook.
listselectresource_group_name, registry_name, subscription_idLists all the webhooks for the specified container registry.
createinsertresource_group_name, registry_name, webhook_name, subscription_id, locationCreates a webhook for a container registry with the specified parameters.
updateupdateresource_group_name, registry_name, webhook_name, subscription_idUpdates a webhook with the specified parameters.
deletedeleteresource_group_name, registry_name, webhook_name, subscription_idDeletes a webhook from a container registry.
list_eventsexecresource_group_name, registry_name, webhook_name, subscription_idLists recent events for the specified webhook.
get_callback_configexecresource_group_name, registry_name, webhook_name, subscription_idGets the configuration of service URI and custom headers for the webhook.
pingexecresource_group_name, registry_name, webhook_name, subscription_idTriggers a ping event to be sent to the webhook.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
registry_namestringThe name of the container registry. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
webhook_namestringThe name of the webhook. Required.

SELECT examples

Gets the properties of the specified webhook.

SELECT
id,
name,
actions,
location,
provisioningState,
scope,
status,
systemData,
tags,
type
FROM azure.container_registry.webhooks
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND registry_name = '{{ registry_name }}' -- required
AND webhook_name = '{{ webhook_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates a webhook for a container registry with the specified parameters.

INSERT INTO azure.container_registry.webhooks (
tags,
location,
properties,
resource_group_name,
registry_name,
webhook_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ resource_group_name }}',
'{{ registry_name }}',
'{{ webhook_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;

UPDATE examples

Updates a webhook with the specified parameters.

UPDATE azure.container_registry.webhooks
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND registry_name = '{{ registry_name }}' --required
AND webhook_name = '{{ webhook_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;

DELETE examples

Deletes a webhook from a container registry.

DELETE FROM azure.container_registry.webhooks
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND registry_name = '{{ registry_name }}' --required
AND webhook_name = '{{ webhook_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Lists recent events for the specified webhook.

EXEC azure.container_registry.webhooks.list_events 
@resource_group_name='{{ resource_group_name }}' --required,
@registry_name='{{ registry_name }}' --required,
@webhook_name='{{ webhook_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;