1. Packages
  2. Azure Native v2
  3. API Docs
  4. containerregistry
  5. Webhook
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native-v2.containerregistry.Webhook

Explore with Pulumi AI

These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

An object that represents a webhook for a container registry. Azure REST API version: 2022-12-01. Prior API version in Azure Native 1.x: 2019-05-01.

Other available API versions: 2023-01-01-preview, 2023-06-01-preview, 2023-07-01, 2023-08-01-preview, 2023-11-01-preview, 2024-11-01-preview.

Example Usage

WebhookCreate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var webhook = new AzureNative.ContainerRegistry.Webhook("webhook", new()
    {
        Actions = new[]
        {
            AzureNative.ContainerRegistry.WebhookAction.Push,
        },
        CustomHeaders = 
        {
            { "Authorization", "******" },
        },
        Location = "westus",
        RegistryName = "myRegistry",
        ResourceGroupName = "myResourceGroup",
        Scope = "myRepository",
        ServiceUri = "http://myservice.com",
        Status = AzureNative.ContainerRegistry.WebhookStatus.Enabled,
        Tags = 
        {
            { "key", "value" },
        },
        WebhookName = "myWebhook",
    });

});
Copy
package main

import (
	containerregistry "github.com/pulumi/pulumi-azure-native-sdk/containerregistry/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := containerregistry.NewWebhook(ctx, "webhook", &containerregistry.WebhookArgs{
			Actions: pulumi.StringArray{
				pulumi.String(containerregistry.WebhookActionPush),
			},
			CustomHeaders: pulumi.StringMap{
				"Authorization": pulumi.String("******"),
			},
			Location:          pulumi.String("westus"),
			RegistryName:      pulumi.String("myRegistry"),
			ResourceGroupName: pulumi.String("myResourceGroup"),
			Scope:             pulumi.String("myRepository"),
			ServiceUri:        pulumi.String("http://myservice.com"),
			Status:            pulumi.String(containerregistry.WebhookStatusEnabled),
			Tags: pulumi.StringMap{
				"key": pulumi.String("value"),
			},
			WebhookName: pulumi.String("myWebhook"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.containerregistry.Webhook;
import com.pulumi.azurenative.containerregistry.WebhookArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var webhook = new Webhook("webhook", WebhookArgs.builder()
            .actions("push")
            .customHeaders(Map.of("Authorization", "******"))
            .location("westus")
            .registryName("myRegistry")
            .resourceGroupName("myResourceGroup")
            .scope("myRepository")
            .serviceUri("http://myservice.com")
            .status("enabled")
            .tags(Map.of("key", "value"))
            .webhookName("myWebhook")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const webhook = new azure_native.containerregistry.Webhook("webhook", {
    actions: [azure_native.containerregistry.WebhookAction.Push],
    customHeaders: {
        Authorization: "******",
    },
    location: "westus",
    registryName: "myRegistry",
    resourceGroupName: "myResourceGroup",
    scope: "myRepository",
    serviceUri: "http://myservice.com",
    status: azure_native.containerregistry.WebhookStatus.Enabled,
    tags: {
        key: "value",
    },
    webhookName: "myWebhook",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

webhook = azure_native.containerregistry.Webhook("webhook",
    actions=[azure_native.containerregistry.WebhookAction.PUSH],
    custom_headers={
        "Authorization": "******",
    },
    location="westus",
    registry_name="myRegistry",
    resource_group_name="myResourceGroup",
    scope="myRepository",
    service_uri="http://myservice.com",
    status=azure_native.containerregistry.WebhookStatus.ENABLED,
    tags={
        "key": "value",
    },
    webhook_name="myWebhook")
Copy
resources:
  webhook:
    type: azure-native:containerregistry:Webhook
    properties:
      actions:
        - push
      customHeaders:
        Authorization: '******'
      location: westus
      registryName: myRegistry
      resourceGroupName: myResourceGroup
      scope: myRepository
      serviceUri: http://myservice.com
      status: enabled
      tags:
        key: value
      webhookName: myWebhook
Copy

Create Webhook Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Webhook(name: string, args: WebhookArgs, opts?: CustomResourceOptions);
@overload
def Webhook(resource_name: str,
            args: WebhookArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def Webhook(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            actions: Optional[Sequence[Union[str, WebhookAction]]] = None,
            registry_name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            service_uri: Optional[str] = None,
            custom_headers: Optional[Mapping[str, str]] = None,
            location: Optional[str] = None,
            scope: Optional[str] = None,
            status: Optional[Union[str, WebhookStatus]] = None,
            tags: Optional[Mapping[str, str]] = None,
            webhook_name: Optional[str] = None)
func NewWebhook(ctx *Context, name string, args WebhookArgs, opts ...ResourceOption) (*Webhook, error)
public Webhook(string name, WebhookArgs args, CustomResourceOptions? opts = null)
public Webhook(String name, WebhookArgs args)
public Webhook(String name, WebhookArgs args, CustomResourceOptions options)
type: azure-native:containerregistry:Webhook
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var examplewebhookResourceResourceFromContainerregistry = new AzureNative.Containerregistry.Webhook("examplewebhookResourceResourceFromContainerregistry", new()
{
    Actions = new[]
    {
        "string",
    },
    RegistryName = "string",
    ResourceGroupName = "string",
    ServiceUri = "string",
    CustomHeaders = 
    {
        { "string", "string" },
    },
    Location = "string",
    Scope = "string",
    Status = "string",
    Tags = 
    {
        { "string", "string" },
    },
    WebhookName = "string",
});
Copy
example, err := containerregistry.NewWebhook(ctx, "examplewebhookResourceResourceFromContainerregistry", &containerregistry.WebhookArgs{
	Actions: []string{
		"string",
	},
	RegistryName:      "string",
	ResourceGroupName: "string",
	ServiceUri:        "string",
	CustomHeaders: map[string]interface{}{
		"string": "string",
	},
	Location: "string",
	Scope:    "string",
	Status:   "string",
	Tags: map[string]interface{}{
		"string": "string",
	},
	WebhookName: "string",
})
Copy
var examplewebhookResourceResourceFromContainerregistry = new Webhook("examplewebhookResourceResourceFromContainerregistry", WebhookArgs.builder()
    .actions("string")
    .registryName("string")
    .resourceGroupName("string")
    .serviceUri("string")
    .customHeaders(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .location("string")
    .scope("string")
    .status("string")
    .tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .webhookName("string")
    .build());
Copy
examplewebhook_resource_resource_from_containerregistry = azure_native.containerregistry.Webhook("examplewebhookResourceResourceFromContainerregistry",
    actions=[string],
    registry_name=string,
    resource_group_name=string,
    service_uri=string,
    custom_headers={
        string: string,
    },
    location=string,
    scope=string,
    status=string,
    tags={
        string: string,
    },
    webhook_name=string)
Copy
const examplewebhookResourceResourceFromContainerregistry = new azure_native.containerregistry.Webhook("examplewebhookResourceResourceFromContainerregistry", {
    actions: ["string"],
    registryName: "string",
    resourceGroupName: "string",
    serviceUri: "string",
    customHeaders: {
        string: "string",
    },
    location: "string",
    scope: "string",
    status: "string",
    tags: {
        string: "string",
    },
    webhookName: "string",
});
Copy
type: azure-native:containerregistry:Webhook
properties:
    actions:
        - string
    customHeaders:
        string: string
    location: string
    registryName: string
    resourceGroupName: string
    scope: string
    serviceUri: string
    status: string
    tags:
        string: string
    webhookName: string
Copy

Webhook Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Webhook resource accepts the following input properties:

Actions This property is required. List<Union<string, Pulumi.AzureNative.ContainerRegistry.WebhookAction>>
The list of actions that trigger the webhook to post notifications.
RegistryName
This property is required.
Changes to this property will trigger replacement.
string
The name of the container registry.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
ServiceUri This property is required. string
The service URI for the webhook to post notifications.
CustomHeaders Dictionary<string, string>
Custom headers that will be added to the webhook notifications.
Location string
The location of the webhook. This cannot be changed after the resource is created.
Scope string
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 all events.
Status string | Pulumi.AzureNative.ContainerRegistry.WebhookStatus
The status of the webhook at the time the operation was called.
Tags Dictionary<string, string>
The tags for the webhook.
WebhookName Changes to this property will trigger replacement. string
The name of the webhook.
Actions This property is required. []string
The list of actions that trigger the webhook to post notifications.
RegistryName
This property is required.
Changes to this property will trigger replacement.
string
The name of the container registry.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
ServiceUri This property is required. string
The service URI for the webhook to post notifications.
CustomHeaders map[string]string
Custom headers that will be added to the webhook notifications.
Location string
The location of the webhook. This cannot be changed after the resource is created.
Scope string
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 all events.
Status string | WebhookStatus
The status of the webhook at the time the operation was called.
Tags map[string]string
The tags for the webhook.
WebhookName Changes to this property will trigger replacement. string
The name of the webhook.
actions This property is required. List<Either<String,WebhookAction>>
The list of actions that trigger the webhook to post notifications.
registryName
This property is required.
Changes to this property will trigger replacement.
String
The name of the container registry.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
serviceUri This property is required. String
The service URI for the webhook to post notifications.
customHeaders Map<String,String>
Custom headers that will be added to the webhook notifications.
location String
The location of the webhook. This cannot be changed after the resource is created.
scope String
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 all events.
status String | WebhookStatus
The status of the webhook at the time the operation was called.
tags Map<String,String>
The tags for the webhook.
webhookName Changes to this property will trigger replacement. String
The name of the webhook.
actions This property is required. (string | WebhookAction)[]
The list of actions that trigger the webhook to post notifications.
registryName
This property is required.
Changes to this property will trigger replacement.
string
The name of the container registry.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
serviceUri This property is required. string
The service URI for the webhook to post notifications.
customHeaders {[key: string]: string}
Custom headers that will be added to the webhook notifications.
location string
The location of the webhook. This cannot be changed after the resource is created.
scope string
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 all events.
status string | WebhookStatus
The status of the webhook at the time the operation was called.
tags {[key: string]: string}
The tags for the webhook.
webhookName Changes to this property will trigger replacement. string
The name of the webhook.
actions This property is required. Sequence[Union[str, WebhookAction]]
The list of actions that trigger the webhook to post notifications.
registry_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the container registry.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group. The name is case insensitive.
service_uri This property is required. str
The service URI for the webhook to post notifications.
custom_headers Mapping[str, str]
Custom headers that will be added to the webhook notifications.
location str
The location of the webhook. This cannot be changed after the resource is created.
scope str
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 all events.
status str | WebhookStatus
The status of the webhook at the time the operation was called.
tags Mapping[str, str]
The tags for the webhook.
webhook_name Changes to this property will trigger replacement. str
The name of the webhook.
actions This property is required. List<String | "push" | "delete" | "quarantine" | "chart_push" | "chart_delete">
The list of actions that trigger the webhook to post notifications.
registryName
This property is required.
Changes to this property will trigger replacement.
String
The name of the container registry.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
serviceUri This property is required. String
The service URI for the webhook to post notifications.
customHeaders Map<String>
Custom headers that will be added to the webhook notifications.
location String
The location of the webhook. This cannot be changed after the resource is created.
scope String
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 all events.
status String | "enabled" | "disabled"
The status of the webhook at the time the operation was called.
tags Map<String>
The tags for the webhook.
webhookName Changes to this property will trigger replacement. String
The name of the webhook.

Outputs

All input properties are implicitly available as output properties. Additionally, the Webhook resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource.
ProvisioningState string
The provisioning state of the webhook at the time the operation was called.
SystemData Pulumi.AzureNative.ContainerRegistry.Outputs.SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
Type string
The type of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource.
ProvisioningState string
The provisioning state of the webhook at the time the operation was called.
SystemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
Type string
The type of the resource.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource.
provisioningState String
The provisioning state of the webhook at the time the operation was called.
systemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
type String
The type of the resource.
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the resource.
provisioningState string
The provisioning state of the webhook at the time the operation was called.
systemData SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
type string
The type of the resource.
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the resource.
provisioning_state str
The provisioning state of the webhook at the time the operation was called.
system_data SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
type str
The type of the resource.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource.
provisioningState String
The provisioning state of the webhook at the time the operation was called.
systemData Property Map
Metadata pertaining to creation and last modification of the resource.
type String
The type of the resource.

Supporting Types

SystemDataResponse
, SystemDataResponseArgs

CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
The type of identity that created the resource.
LastModifiedAt string
The timestamp of resource modification (UTC).
LastModifiedBy string
The identity that last modified the resource.
LastModifiedByType string
The type of identity that last modified the resource.
CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
The type of identity that created the resource.
LastModifiedAt string
The timestamp of resource modification (UTC).
LastModifiedBy string
The identity that last modified the resource.
LastModifiedByType string
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
The type of identity that created the resource.
lastModifiedAt String
The timestamp of resource modification (UTC).
lastModifiedBy String
The identity that last modified the resource.
lastModifiedByType String
The type of identity that last modified the resource.
createdAt string
The timestamp of resource creation (UTC).
createdBy string
The identity that created the resource.
createdByType string
The type of identity that created the resource.
lastModifiedAt string
The timestamp of resource modification (UTC).
lastModifiedBy string
The identity that last modified the resource.
lastModifiedByType string
The type of identity that last modified the resource.
created_at str
The timestamp of resource creation (UTC).
created_by str
The identity that created the resource.
created_by_type str
The type of identity that created the resource.
last_modified_at str
The timestamp of resource modification (UTC).
last_modified_by str
The identity that last modified the resource.
last_modified_by_type str
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
The type of identity that created the resource.
lastModifiedAt String
The timestamp of resource modification (UTC).
lastModifiedBy String
The identity that last modified the resource.
lastModifiedByType String
The type of identity that last modified the resource.

WebhookAction
, WebhookActionArgs

Push
push
Delete
delete
Quarantine
quarantine
Chart_push
chart_push
Chart_delete
chart_delete
WebhookActionPush
push
WebhookActionDelete
delete
WebhookActionQuarantine
quarantine
WebhookAction_Chart_push
chart_push
WebhookAction_Chart_delete
chart_delete
Push
push
Delete
delete
Quarantine
quarantine
Chart_push
chart_push
Chart_delete
chart_delete
Push
push
Delete
delete
Quarantine
quarantine
Chart_push
chart_push
Chart_delete
chart_delete
PUSH
push
DELETE
delete
QUARANTINE
quarantine
CHART_PUSH
chart_push
CHART_DELETE
chart_delete
"push"
push
"delete"
delete
"quarantine"
quarantine
"chart_push"
chart_push
"chart_delete"
chart_delete

WebhookStatus
, WebhookStatusArgs

Enabled
enabled
Disabled
disabled
WebhookStatusEnabled
enabled
WebhookStatusDisabled
disabled
Enabled
enabled
Disabled
disabled
Enabled
enabled
Disabled
disabled
ENABLED
enabled
DISABLED
disabled
"enabled"
enabled
"disabled"
disabled

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:containerregistry:Webhook myWebhook /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
azure-native-v2 pulumi/pulumi-azure-native
License
Apache-2.0
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi