@Ankit Rathod , Thank you for your question.
If you are using Azure CLI:
Integrate an existing ACR with existing AKS clusters by supplying valid values for acr-name or acr-resource-id as below.
az aks update -n myAKSCluster -g myResourceGroup --attach-acr <acr-name>
or,
az aks update -n myAKSCluster -g myResourceGroup --attach-acr <acr-resource-id>
Running az aks update --attach-acr
uses the permissions of the user running the command to create the role ACR assignment. This role is assigned to the kubelet managed identity. For more information on the AKS managed identities, see Summary of managed identities.
If you are using Azure PowerShell:
Integrate an existing ACR with existing AKS clusters by supplying valid values for acr-name as below.
Set-AzAksCluster -Name myAKSCluster -ResourceGroupName myResourceGroup -AcrNameToAttach <acr-name>
Running Set-AzAksCluster -AcrNameToAttach
uses the permissions of the user running the command to create the role ACR assignment. This role is assigned to the kubelet managed identity. For more information on the AKS managed identities, see Summary of managed identities.
For more information please check this section.
----------
Hope this helps.
Please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.