Using Azure Container Registry With Kubernetes | Pull and Push Docker Images


In this tutorial, I’m showing how to configure Azure ACR with Kubernetes. This will allow you pull or push docker images from you private repository hosted on Azure Container Registry.
The steps involve creating a service principal and testing the it’s credentials using docker cli, then with that created account, I created a secret into my kubernetes cluster, which then I use as an image pull secret to pull my container image from my private Azure Container Registry.

👀 Commands used during the video:

# Query the registry ID
az acr show –name k8srepo –query id –output tsv

# Get the service principal password
az ad sp create-for-rbac –name –scopes (REGISTRY-ID) `
–role acrpull –query password –output tsv

# Get the service principal appId
az ad sp show –id –query appId –output tsv

# pull an image
docker pull hello-world

# Log in to Docker with service principal credentials
docker login –username (SP_APP_ID) –password (SP_PASSWD)
az acr login –name k8srepo

# tag and push the docker image
docker tag hello-world
docker push

# Create the image pull secret

kubectl create secret docker-registry k8srepo
–namespace default

Hope you find it helpful, if the mood strike hit that like button.👍👍👍


🔥 Don’t miss any future video! hit that subscribe button and click the bell 🔔 notification icon to be alerted of new videos I release.

💡 You can follow me on :
[*] Github:
[*] Website:
[*] Linkedin:
[*] Twitter:


Avatar of vNugget

By vNugget

One thought on “Using Azure Container Registry With Kubernetes | Pull and Push Docker Images”

Leave a Reply

Your email address will not be published.

Captcha loading...