As I mentioned in my previous post, today I want to show you how to enable geo-replication of your ACR. This feature will allow us to manage a single registry across all regions, push images to a single registry while the Azure service manages the replication, and last but not least, allows us to keep images very close to the application infrastructure.

Prerequisites

  • This tutorial assumes that you already have a Microsoft Azure account configured.
  • You already have an Azure Container Registry (ACR) and properly configured. If you want to know how to create it, see this link.

Azure PowerShell Workaround

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.

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:

Once you set your default subscription, you’re ready to start.

Set the variables

Here, we define the characteristics of our environment and the resource’s properties.

Geo-replication in ACR

Please note that Geographic Replication is a feature of Premium records only. Geographic replication will allow you to manage a single ACR that will serve multiple regions, among other interesting features.

if you don’t know if your ACR is premium you can check it, using the following command

Get-AzContainerRegistry

If your ACR is not yet Premium, you can change it using the following command.

Update-AzContainerRegistry

Creates a container registry replication

To create a new container registry replication, use the New-AzContainerRegistryReplication cmdlet with the following syntax.

As you can see, you should refer to the Master ACR in the -RegistryName parameter, specify a name for the new ACR and select the zone where the new replica will be hosted.

New-AzContainerRegistryReplication

Gets the status of the replication

To get information about the status of replication, use the Get-AzContainerRegistryReplication cmdlet with the following syntax.

Get-AzContainerRegistryReplication

ACR Geo-Replication

Removes a container registry replication

finally, to remove a container registry replication, you should use the Remove-AzContainerRegistryReplication cmdlet as shown below.

In the next post, I will show you how to use Azure Container Registry webhooks.

Thanks for reading my post, I hope you find it useful.

If you want to know more about Azure Container Registry, check out this link: https://docs.microsoft.com/en-us/azure/container-registry/