An Azure service that provides a registry of Docker and Open Container Initiative images.
Root Cause: networkRuleBypassOptions set to None
After extensive debugging, I found the root cause. The ACR had networkRuleBypassOptions set to None, which blocks Azure's own internal services — including the Artifact Cache service — from writing cached layers and manifests into the registry.
With this setting, the cache can proxy pulls (pass-through from upstream registries) but cannot store anything, because the cache service's write operations are blocked by the network rules. This explains the exact symptom: repositories get created (namespace creation works), but manifestCount and tagCount remain at 0, and no ContainerRegistryRepositoryEvents are ever generated.
How I confirmed it
- Created a fresh ACR in West Europe with
networkRuleBypassOptions: AzureServices— caching worked immediately (manifestCount: 1, tagCount: 1 after a pull). - Created another fresh ACR in UK South (same region as the broken one) with
networkRuleBypassOptions:AzureServices— also worked. This ruled out a region-level issue. - Updated the existing broken ACR to set
networkRuleBypassOptions: AzureServices— caching started working immediately.
The fix
az acr update --name <acr-name> --allow-trusted-services true
Or in Terraform/OpenTofu:
resource "azurerm_container_registry" "this" {
# ...
network_rule_bypass_option = "AzureServices"
}
Why this happened
If you're using the https://registry.terraform.io/modules/Azure/avm-res-containerregistry-registry/azurerm/latest (Azure/avm-res-containerregistry-registry/azurerm), the network_rule_bypass_option variable defaults to "None". Combined with public_network_access_enabled = false and network_rule_set.default_action = "Deny" (a typical private endpoint setup), this silently breaks Artifact Cache. The Azure documentation for Artifact Cache doesn't mention this requirement, which makes it easy to miss.