New-AzureRmContainerRegistryWebhook

Creates a container registry webhook.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

New-AzureRmContainerRegistryWebhook
   [-Name] <String>
   [-ResourceGroupName] <String>
   [-RegistryName] <String>
   [-Uri] <Uri>
   [-Action] <String[]>
   [-Header <Hashtable>]
   [-Tag <Hashtable>]
   [-Status <String>]
   [-Scope <String>]
   [-Location <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzureRmContainerRegistryWebhook
   [-Name] <String>
   [-Uri] <Uri>
   [-Action] <String[]>
   -Registry <PSContainerRegistry>
   [-Header <Hashtable>]
   [-Tag <Hashtable>]
   [-Status <String>]
   [-Scope <String>]
   [-Location <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzureRmContainerRegistryWebhook
   [-Name] <String>
   [-Uri] <Uri>
   [-Action] <String[]>
   [-Header <Hashtable>]
   [-Tag <Hashtable>]
   [-Status <String>]
   [-Scope <String>]
   [-Location <String>]
   -ResourceId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzureRmContainerRegistryWebhook cmdlet creates a container registry webhook.

Examples

Example 1: Create a container registry webhook.

PS C:\> New-AzureRmContainerRegistryWebhook -ResourceGroupName "MyResourceGroup" -RegistryName "MyRegistry" -Name "webhook001" -Uri http://www.bing.com -Action Delete,Push -Header @{SpecialHeader='headerVal'} -Tag @{Key="val"} -Location "east us" -Status Enabled -Scope "foo:*"

Name            Location   Status     Scope           Actions         Provisioni ServiceUri
                                                                      ngState
----            --------   ------     -----           -------         ---------- ----------
webhook001      westus     enabled    foo:*           {push, delete}  Succeeded

Create a container registry webhook.

Parameters

-Action

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

Type:String[]
Aliases:WebhookActions
Accepted values:delete, push
Position:4
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Header

Custom headers that will be added to the webhook notifications.

Type:Hashtable
Aliases:WebhookHeaders
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Location

Webhook Location. Default to the location of the registry.

Type:String
Aliases:WebhookLocation
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Webhook Name.

Type:String
Aliases:WebhookName, ResourceName
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Registry

Container Registry Object.

Type:PSContainerRegistry
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RegistryName

Container Registry Name.

Type:String
Aliases:ContainerRegistryName
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Resource Group Name.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

The container registry resource id

Type:String
Aliases:Id
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Scope

Webhook scope.

Type:String
Aliases:WebhookScope
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Status

Webhook status, default value is enabled

Type:String
Aliases:WebhookStatus
Accepted values:enabled, disabled
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Tag

Webhook tags.

Type:Hashtable
Aliases:Tags
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Uri

The service URI for the webhook to post notifications.

Type:Uri
Aliases:WebhookUri
Position:3
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Outputs

PSContainerRegistryWebhook