Easy Ways to Push to Azure Container Registry (Azure ACR)

Will Toth
2 min readDec 28, 2021
What is the easiest way to push to an Azure ACR Repo?

Introduction

Hi, if you are like me you have certainly had to deal with pushing to Azure ACR. And, if like me you don’t do this on a regular basis it always feels like a pain to go back through the Azure Documentation (which is almost always over-complicated) or to communicate the method to your developers.

So, I have listed two easy methods to push your Docker Images to an Azure ACR Repo.

Create a Repo

I’m not going to go into the specifics of how to do this as it is outside of the scope of this article, but if you need help check the Azure Docs or other Medium Articles.

Once created you should make sure to enable the Admin User access in Container Registry -> Access Keys (see picture below) and then you can follow one of the two methods below to push to your repo.

Push via Standard Docker Commands

This is the easiest way I have found to push your image to an ACR. Works on linux, mac, and windows.

Go to your Container Registry -> Access Keys

Passwords is cut off of this screenshot but it should be self explanatory

Take the information on this page and plug it into the below code

docker login <LoginServer>.azurecr.io -u <Username> -p <Password>docker tag <LocalImageName> <LoginServer>.azurecr.io/<path>/<name>docker push <LoginServer>.azurecr.io/<path>/<name>

Following this your Image should be in the Repo!

Push via Azure CLI

If you are working on a computer/server that already has the Azure CLI installed you can follow the steps below to push to your ACR.

az login
az acr login --name <RegistryName>

From here you should be able to use the same commands as above to push your image to the ACR Repo.

docker tag <LocalImageName> <LoginServer>.azurecr.io/<path>/<name>docker push <LoginServer>.azurecr.io/<path>/<name>

Conclusion

Azure ACR is a diverse and powerful tool for integrating Docker images into your production systems whether that is through webapps, Azure Kubernetes Service (AKS), or through standard container hub functions.

Thanks for reading!

If you have any questions or feedback please reach out to me on twitter @wtothdev or leave a comment!

If you aren’t already a Medium Member you can Join here!

--

--