Skip to main content

Azure Container Registry

Azure Container Registry (ACR) is a managed private registry for storing and distributing container images and OCI artifacts. It integrates with AKS, Container Instances, and App Service so workloads pull images without stored credentials.

Azure Container Registry

ACR is where a CI pipeline pushes built images before they are deployed to AKS, Azure Container Apps, or App Service. Images stay private by default and access is controlled by Azure RBAC roles such as AcrPush and AcrPull. It comes in Basic, Standard, and Premium tiers, and Premium adds geo-replication, private endpoints, and zone redundancy.

How Do You Give AKS Pull Access to ACR?

Grant the cluster's kubelet managed identity the AcrPull role on the registry. The --attach-acr flag does this for you, so no image pull secret ever lives in the cluster.

Bash
az acr create --name mumbaiprodacr --resource-group mumbai-prod-rg \
--sku Premium --admin-enabled false
az aks update --name mumbai-prod-aks --resource-group mumbai-prod-rg \
--attach-acr mumbaiprodacr

How Do You Avoid Docker Hub Rate Limits?

ACR can act as a pull-through cache, called artifact cache, for public registries. Nodes pull common base images such as nginx from your registry instead of Docker Hub, which avoids rate limits and outages during scale-out.

Why It Matters in Production

A team like CRED's builds images in CI, pushes them to a Premium registry replicated to a second region, and lets AKS pull via managed identity. Private endpoints keep image traffic off the public internet.

Security

Keep the admin user disabled and use managed identities or repository-scoped tokens. Sign production images with a tool such as Notation and verify signatures before deployment.

Tip

Use ACR Tasks to rebuild images automatically when a base image is patched.

Frequently Asked Questions

Why use ACR instead of Docker Hub for private images?

ACR keeps proprietary images inside your Azure trust boundary with RBAC, managed identity pulls, private networking, and vulnerability scanning options. Docker Hub is fine for public open-source bases but adds rate limits and external dependency.

Which ACR tier do I need for production?

Premium is the usual choice, since it adds geo-replication, private endpoints, and zone redundancy. Basic and Standard suit dev, test, and small workloads.

Why does my AKS pod show ImagePullBackOff from ACR?

The most common causes are a missing AcrPull role on the kubelet identity, a wrong image tag, or a network rule blocking the node subnet from the registry. Check the pod events for the exact error.

Found a mistake, an outdated step or a broken link?