Site icon Narayana Tutorial

Azure AKS unauthorized: authentication required

azure

azure

While trying to executing the skaffold command, the docker image created and the same image pushed to the Azure container registry but unable to create POD and getting the following error.

error: code = Unknown desc = Error response from daemon: Get https://forgerockcontrainerregistry.azurecr.io/v2/skaffold-example/manifests/sha256:60636cbcbf6fce3d2b7acf90d103e3c3d4907d41f1ed0b1a8861e4fd46e26305: unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.

mBack-off pulling image “forgerockcontrainerregistry.azurecr.io/skaffold-example:v1.14.0-16-g10275c66a@sha256:60636cbcbf6fce3d2b7acf90d103e3c3d4907d41f1ed0b1a8861e4fd46e26305″←[0m
←[34mCleaning up…←[0m

Problem Statement

By default, Azure Cluster does not allow the Azure Container registry to create PODs.

Solution:

We need to allow Azure Container to create PODS in the Azure Cluster by updating the Azure Cluster permission.

It means attach Azure Container Registry to Azure Cluster

az aks update --name forgerock-cluster 
--group container-registry-resource-group 
--attach-acr forgerockcontrainerregistry

–name : Azure Cluster Name – we can omit the suffix .azure.io

–group: Azure Cluster Group

–attach-acr : Azure Container Registry

This is one-time activity have to do.