An Azure service that provides a registry of Docker and Open Container Initiative images.
Thank you for sharing the details of your setup.
While using az acr login --expose-token to generate a short‑lived token and storing it in a Kubernetes docker-registry secret can work technically, this approach is not the recommended or supported primary authentication model for Azure Kubernetes Service (AKS) when pulling images from Azure Container Registry (ACR).
For AKS clusters, Microsoft strongly recommends using managed identities with Azure RBAC to authenticate to ACR. Specifically:
- Assign the AcrPull role (or Container Registry Repository Reader for ABAC‑enabled registries) to the AKS kubelet (node) managed identity.
- This enables AKS nodes to pull images natively and securely, without storing credentials or tokens in Kubernetes secrets.
This integration is built into AKS and is the most secure, scalable, and supported pattern for AKS–ACR authentication.
AKS automatically uses the kubelet managed identity to authenticate to ACR when the appropriate role is assigned, eliminating the need for image pull secrets.
https://learn.microsoft.com/en-us/azure/aks/cluster-container-registry-integration?tabs=azure-cli
Your current approach—using a short‑lived ACR token generated via --expose-token and storing it in an imagePullSecrets—has the following limitations:
- Tokens are short‑lived and require rotation; expired tokens can cause unexpected image pull failures.
- Credentials are stored as Kubernetes secrets, which increases operational and security overhead.
- This pattern is not the recommended model for AKS, and is primarily intended for:
- Non‑AKS Kubernetes clusters
- External or cross‑tenant registries
- Specialized scenarios where managed identity cannot be used
- External or cross‑tenant registries
- Non‑AKS Kubernetes clusters
Microsoft documentation explicitly notes that image pull secrets are mainly intended for external or non‑AKS clusters, not for native AKS–ACR integration.
Authenticate ACR from Kubernetes
https://docs.azure.cn/en-us/container-registry/authenticate-kubernetes-options
For a production‑ready and fully supported configuration, we recommend:
- Identify the AKS kubelet managed identity.
- Assign the AcrPull role (or Container Registry Repository Reader if ABAC is enabled) at the ACR scope.
- Remove dependency on
imagePullSecretsfor ACR authentication.
If the issue persists or if you have specific constraints that prevent using managed identity–based authentication, please share the details in the Comment section, and we will be happy to assist you further and respond promptly.
Also I have requested few details over the private chat please respond at your earliest.
Thanks.