Skip to content

Container Registry replica location is not allowed#

Security · Container Registry · Rule · 2025_09 · Important

The replication location determines the country or region where container images and metadata are stored and processed.

Description#

Azure supports deployment to many locations around the world called regions. Many organizations have requirements or legal obligations that limit where data can be stored or processed. This is commonly known as data residency.

Azure Container Registry supports geo-replication to multiple regions. When geo-replication is enabled, container images are replicated to the specified regions. Data in these replica regions is stored, processed, and subject to local legal requirements in those regions.

To align with your organizational requirements, you may choose to limit the regions that replicas can be configured. This allows you to ensure that container images replicate to regions that meet your data residency requirements.

Some regions, particularly those related to preview services or features, may not be available for all services.

Recommendation#

Consider configuring container registry replicas to allowed regions to align with your organizational requirements.

Examples#

Configure with Bicep#

To deploy container registries that pass this rule:

  • Set the location and name property of each replica to an allowed region, in the list of supported regions.

For example:

Azure Bicep snippet
resource registryReplica 'Microsoft.ContainerRegistry/registries/replications@2025-04-01' = {
  parent: registry
  name: secondaryLocation
  location: secondaryLocation
  properties: {
    regionEndpointEnabled: true
    zoneRedundancy: 'Enabled'
  }
}

Configure with Azure Verified Modules

A pre-validated module supported by Microsoft is available from the Azure Bicep public registry. To reference the module, please use the following syntax:

br/public:avm/res/container-registry/registry:<version>

To use the latest version:

br/public:avm/res/container-registry/registry:0.9.1

Configure with Azure template#

To deploy container registries that pass this rule:

  • Set the location and name property of each replica to an allowed region, in the list of supported regions.

For example:

Azure Template snippet
{
  "type": "Microsoft.ContainerRegistry/registries/replications",
  "apiVersion": "2025-04-01'",
  "name": "[format('{0}/{1}', parameters('name'), parameters('secondaryLocation'))]",
  "location": "[parameters('secondaryLocation')]",
  "properties": {
    "regionEndpointEnabled": true,
    "zoneRedundancy": "Enabled"
  },
  "dependsOn": [
    "[resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))]"
  ]
}

Notes#

Geo-replication of a Container Registry requires the Premium SKU.

This rule requires one or more allowed regions to be configured. By default, all regions are allowed.

Rule configuration#

AZURE_RESOURCE_ALLOWED_LOCATIONS

To configure this rule set the AZURE_RESOURCE_ALLOWED_LOCATIONS configuration value to a set of allowed regions.

For example:

configuration:
  AZURE_RESOURCE_ALLOWED_LOCATIONS:
  - australiaeast
  - australiasoutheast

If you configure this AZURE_RESOURCE_ALLOWED_LOCATIONS configuration value, also consider setting AZURE_RESOURCE_GROUP the configuration value when resources use the location of the resource group.

For example:

configuration:
  AZURE_RESOURCE_GROUP:
    location: australiaeast

Comments