Skip to content

Instantly share code, notes, and snippets.

@yuriburger
Created May 10, 2019 09:38
Show Gist options
  • Save yuriburger/4337d770ed7d1ccda30daf2e180bc128 to your computer and use it in GitHub Desktop.
Save yuriburger/4337d770ed7d1ccda30daf2e180bc128 to your computer and use it in GitHub Desktop.
[grant aks access to acr] Grant Azure Kubernetes Service pull access to Azure Container Registry #kubernetes #azure
// vim: syntax=bash
# Get the id of the service principal configured for AKS
CLIENT_ID=$(az aks show -g <resource group> -n <aks cluster> --query "servicePrincipalProfile.clientId" --output tsv)
# Get the ACR registry resource id
ACR_ID=$(az acr show -g <resource group> -n <name acr> --query "id" --output tsv)
# Create role assignment
az role assignment create --assignee $CLIENT_ID --role acrpull --scope $ACR_ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment