Webhook
An object that represents a webhook for a container registry. Uses Azure REST API version 2024-11-01-preview. In version 2.x of the Azure Native provider, it used API version 2022-12-01. Other available API versions: 2019-12-01-preview, 2020-11-01-preview, 2021-06-01-preview, 2021-08-01-preview, 2021-09-01, 2021-12-01-preview, 2022-02-01-preview, 2022-12-01, 2023-01-01-preview, 2023-06-01-preview, 2023-07-01, 2023-08-01-preview, 2023-11-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native containerregistry [ApiVersion]
. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.
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",
});
});
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
})
}
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());
}
}
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}
Properties
The Azure API version of the resource.
The provisioning state of the webhook at the time the operation was called.
Metadata pertaining to creation and last modification of the resource.