ACR Azure PowerShell Connect-AzAccount Containers Docker Get-AzContainerRegistryWebhook Get-AzContainerRegistryWebhookEvent Get-AzSubscription Microsoft Microsoft Azure New-AzContainerRegistryWebhook Select-AzSubscription Test-AzContainerRegistryWebhook Update-AzContainerRegistryWebhook WebHook
Hello everyone, as I mentioned in my
previous post, today I want to show you how you can use a webhook to trigger events when certain actions are performed in your Azure container registry (ACR). With this latest post in the series, we have reviewed all the cmdlets currently available to manage an ACR using Azure PowerShell.
If you want to know how to install the PowerShell Azure module on your machine, check out this
link. The simplest way to get started is to sign in interactively at the command line.
Connect-AzAccount
This cmdlet will bring up a dialog box prompting you for your email address and password associated with your Azure account. If you have more than one subscription associated with your mail account, you can choose the default subscription. To perform this task, we will use the following commands:
To create a webhook using the Azure PowerShell, use the New-AzContainerRegistryWebhook cmdlet with the following syntax.
New-AzContainerRegistryWebhook`-Name$acRegWebHook`-ResourceGroupName$resourceGroupName`-RegistryName$azcRegName`-Urihttps://www.jorgebernhardt.com`-Actionpush### -Uri: The URI where the webhook should send POST notifications.## -Action: You must set one or more actions that will cause the webhook to post notifications.## -Scope: You can specify for a specific repository or tag. If not specified, the scope is for all events in the registry.##
To test it, use the Test-AzContainerRegistryWebhook cmdlet with the following syntax. This command sends a generic POST request and records the response.
Thank you for reading my post. I hope you found this series of articles about Azure container registration helpful. If you want to know more about Azure Container Registry, check out this link:
https://docs.microsoft.com/en-us/azure/container-registry/