Azure / Azure/azure-quickstart-templates

101-container-registry-geo-replication deployment hangs with ARM deployment in Complete mode

Open
#5,485 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
14.9k
Forks
16.2k
Avg merge
6d 21h
Merged PRs (30d)
6

Description

[101-container-registry-geo-replication](https://github.com/Azure/azure-quickstart-templates/tree/master/101-container-registry-geo-replication)

### Issue Details

I am working on an infrastructure-as-code project that requires the automatic provisioning of ACR with geo-replication. And, I found an issue with ACR and ARM interactions that causes deployment to hang.

I used this template to provision ACR with geo-replication enabled and one additional replication. The goal being to setup a CI pipeline that will provision and apply updates to these resources through a resource group deployment. In order for these automatic updates to happen, I have been trying to use ARM deployments with the [Complete mode](https://docs.microsoft.com/en-us/azure/azure-resource-manager/deployment-modes).

When ACR is provisioned with geo-replication, it automatically creates a home replication resource that is not specified in the ARM template. But, when an ARM deployment uses the Complete mode, it attempts to delete all resources that are not specified in the template. The result is a deployment that hangs with repeated `HomeReplicationCannotBeDeleted` errors shown, which is a problem when setting up CI pipelines.

### Repro steps
1. Create a new resource group
2. Deploy this ARM template with Complete mode: `az group deployment create . . . --mode Complete`
3. View the deployment in the Azure portal and see that it never finishes, but repeatedly shows an error event: `HomeReplicationCannotBeDeleted`

### Work-Around

The one work-around that I discovered is to include the automatically created home-replication as a resource in an ARM template, but to set its [`condition` field](https://docs.microsoft.com/en-us/azure/architecture/building-blocks/extending-templates/conditional-deploy) to always be false. This seems to let ARM know that the resource exists and to not attempt to delete it.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the 101-container-registry-geo-replication template and reproduce the deployment using `az group deployment create ... --mode Complete`, then inspect the deployment events for repeated `HomeReplicationCannotBeDeleted` errors. No target file or repository change is identified; done would require confirming whether the template can address this ARM behavior or documenting the limitation and workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.