First use of your private registry

First thing you need to do is actually let docker to know what registry you use. In most cases command line will look something like this:

docker login yoursuperregistry.somewhere.com -u username -p password

But we can do better.

New Azure CLI provides really awesome `--query` parameter. In simple words, any structured output of the tool could be transformed with JMESPath expressions. Now lets put this to work for us.

Azure CLI provides us with `az acr credential show` that will return your generated registry credentials in structured way:

{

"password": "=oo1+PRLZDxwHyJLFzm8R7GTkB2fE/34",

"username": "myveryownregistry"

}

Using credentials,` — query` and ` — output tsv` parameters, we can construct `docker login` command automatically and then pipe to any command interpreter(powershell — iex, bash, sh, cmd -c):

az acr credential show -n myveryownregistry \

--query "join(' ', ['docker login myveryownregistry-on.azurecr.io', '-u', username, '-p', password])" \

--output tsv \

| sh

I have gist with this stuff for you. After this command executed, your local docker will point to your registry, you are logged in and ready to push your valuable stuff!