Open axis7818 opened 5 years ago
tagging @bmoore-msft @JulienFloris
@jsturtevant Could you please fix this issue?
@jcorioland how did you work around this issue for the terraform module?
Currently ACR doesn't support home replication deletion by the users. The workaround is to include the home replication in the template but skip its creation by using the condition : false as shown below
{ "name": "[concat(parameters('acrName'), '/', parameters('location'))]", "condition": false, "type": "Microsoft.ContainerRegistry/registries/replications", "apiVersion": "2017-10-01", "location": "[parameters('location')]", "properties": {}, "dependsOn": [ "[concat('Microsoft.ContainerRegistry/registries/', parameters('acrName'))]" ] },
I just put up a PR including the workaround. #5801
This issue has been fixed. Home replication can now be deleted if it's the only replication.
I'm still getting this issue. ARM deployment appears to be in an infinite loop. Also can't cancel the deployment.
@jamiemccrindle Are you getting the same error message HomeReplicationCannotBeDeleted
?
Does the deployment succeed without Complete mode?
Yes, it did succeed when I switched to Incremental. This is the only thing in the resource group, so Incremental will work.
@jamiemccrindle Great! Although, the complete mode deployment should work as well.
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.
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
az group deployment create . . . --mode Complete
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 to always be false. This seems to let ARM know that the resource exists and to not attempt to delete it.