Solving problems with authentication

Sometimes AKS cannot access Azure Container Registry and needs the creation of a service principal, which can be used in pod deployment. To create it, you will need to perform the following script:

$ az acr show --name {REGISTRY_NAME} --query loginServer --output tsv{YOUR_REGISTRY_NAME}$ az acr show --name handsonazureregistry --query id --output tsv/subscriptions/94f33c43-60b5-4042-ae74-51777f69f99a/resourceGroups/handsonazure-rg/providers/Microsoft.ContainerRegistry/registries/handsonazureregistry{REGISTRY_ID}$ az ad sp create-for-rbac --name acr-service-principal --role Reader --scopes {REGISTRY_ID} --query password --output tsv{PASSWORD}$ az ad sp show --id http://acr-service-principal --query appId ...

Get Hands-On Azure for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.