<p>Looking for the best way to integrate ACR with AKS for Producation environment, Seems there are multiple ways like, during installation, and after installation, using service principala,a nd using image pull secret etc..</p>
<p>So for our production environment looking for most recommended option, where the requirement as follows.</p>
<ul>
<li>Is it mandatory to attach acr during aks creation itself</li>
<li>What will be the advantage if we are integrating ACR along with AKS instalation itself.  (seems , we dont want to pass the image pull secret to the pod spec in that case and for other options we need to)</li>
<li>What is the another way to integrate ACR with AKS ( az aks update) command will help in this case?  if yes, what will be the difference from the previous method where we integrated during AKS installation.</li>
<li>IF I want to setup a secodary AKS cluster in another region, but need to connect the ACR georeplicated instance of Primary instance of ACR , How i can get it done? In this case is it mandaory to attach tge ACR during AKS installation or later post installation  also its good to go?</li>
</ul>

Vowneee
<p>IMHO the best way is Azure RBAC. You dont need to attach the ACR while creating the AKS. You can leverage Azure RBAC and assign the Role &quot;AcrPull&quot; to the Kubelet identity of your nodepool. This can be done for every ACR you have:</p>
<pre><code>export KUBE_ID=$(az aks show -g &lt;resource group&gt; -n &lt;aks cluster name&gt; --query identityProfile.kubeletidentity.objectId -o tsv)
export ACR_ID=$(az acr show -g &lt;resource group&gt; -n &lt;acr name&gt; --query id -o tsv)
az role assignment create --assignee $KUBE_ID --role &quot;AcrPull&quot; --scope $ACR_ID
</code></pre>
<p>Terraform:</p>
<pre><code>  resource &quot;azurerm_role_assignment&quot; &quot;example&quot; {
    scope                            = azurerm_container_registry.acr.id
    role_definition_name             = &quot;AcrPull&quot;
    principal_id                     = azurerm_kubernetes_cluster.aks.kubelet_identity[0].object_id
  }
</code></pre>
