An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
Thanks for the very detailed write-up you've already ruled out the common culprits (AcrPull assignment, no imagePullSecrets, Content Trust off, public network access on), which genuinely narrows this down.
First, the reassuring part: the ACR being in a different resource group is not the cause. AKS authenticates to ACR using the kubelet managed identity's Microsoft Entra object, so resource-group boundaries within the same subscription are irrelevant to this.
One important clue: your error says failed to fetch **anonymous** token. AKS always first attempts an anonymous pull and only falls back to authenticated pull — so this specific wording often points to either an authorization model mismatch (ABAC), an image-reference problem, or an architecture mismatch, rather than a plain missing role. I'd suggest working through the steps below in order.
1) Confirm whether your registry is ABAC-enabled (most likely cause given your symptoms)
If your ACR is in "RBAC Registry + ABAC Repository Permissions" mode, the classic AcrPull role is not honored — which perfectly explains a 401 even though AcrPull "looks correct."
- In the portal: Container registry → Properties / Access control → check the Role assignment permissions mode.
- If it's ABAC-enabled, assign the
Container Registry Repository Readerrole to the kubelet identity instead of AcrPull. - ⚠️ Note:
az aks update --attach-acrdoes not support ABAC registries — you must assign the role manually (portal oraz role assignment create).
2) Validate the exact image reference
Because the error is the anonymous-token variant, an incorrect image path can produce this exact 401. Please double-check:
- Login server is
<acr-name>.azurecr.io(a common typo isazureacr.io). - Registry name, repository name, and tag/digest are all correct.
3) If the registry is not ABAC-enabled, re-run the attach to reconcile the integration
az aks update -n <aks-cluster> -g <aks-rg> --attach-acr <acr-resource-id>
Use the full ACR resource ID (not just the name), since the registry is in another resource group.
4) Confirm the kubelet identity is actually bound to the node VMSS
This is a very common cause of your exact symptom. Get the kubelet identity, then verify it's present on the node scale set:
az aks show -g <aks-rg> -n <aks-cluster> --query identityProfile.kubeletidentity
az vmss identity show -g <node-resource-group> -n <aks-vmss-name>
AKS never removes the kubelet identity from the VMSS on its own, so if it's missing it was removed out-of-band. Re-attaching (step 3) restores it. If a plain reconcile is needed: az aks update -g <aks-rg> -n <aks-cluster>.
5) Run the built-in end-to-end check
az aks check-acr -n <aks-cluster> -g <aks-rg> --acr <acr-name>.azurecr.io
This validates DNS, routing, and pull permission together.
6) Rule out an architecture (ARM64 vs AMD64) mismatch
An image/node architecture mismatch surfaces this identical anonymous token 401 (it really means "no matching platform in manifest"). If az aks check-acr returns exec /canipull: exec format error, that confirms a mismatch. Verify:
az acr manifest list-metadata --registry <acr-name> --name <repo> --query "[].architecture"
7) If AcrPull was granted via a Microsoft Entra group
There can be a propagation delay before group-based RBAC takes effect. If you assigned AcrPull to a group rather than directly to the kubelet identity, try assigning the role directly to the kubelet identity to rule this out.
Links for reference:
https://learn.microsoft.com/en-us/azure/aks/cluster-container-registry-integration?pivots=azure-cli
https://learn.microsoft.com/en-us/azure/container-registry/container-registry-rbac-abac-repository-permissions?tabs=azure-portal
If you have any questions please feel free to comment in the comment section with the ask i will be happy to assist you further.
Thanks,
Manish.