How to login into Azure Container Registry in Terminal

Caio Bonani 5 Reputation points

I'm trying to log in my Container Registry to Push an Image to it.

Just doing az login (this command works fine) and then az acr login --name <my registry name>.

The second command gives me the error:

Error response from daemon: Get "https://<my registry name>": dialing <my registry name> with direct connection: resolving host <my registry name> lookup <my registry name> on <my router ip>:53: no such host

Login failed.

I've tried to use the --expose-token flag and do the docker login registry_name -u 0000......, but get the same error...

I already have an image pushed to my registry (made the same commands ), but this times the commands are not working.

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
417 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Caio Bonani 5 Reputation points

    After logout az logout, then logged in again, the command worked.

    1 person found this answer helpful.

  2. kobulloc-MSFT 25,401 Reputation points Microsoft Employee

    Hello, @Caio Bonani !

    Why am I getting a no such host error when attempting to login to Azure Container Registry?

    There are a variety of possible causes for this error (including CLI scenarios). This can be caused when:

    Azure Container Registry login troubleshooting guide:

    If none of those are helpful, let us know in the comments so we can continue to troubleshoot this.

    I hope this has been helpful! Your feedback is important so please take a moment to accept answers.

    If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!

    User's image

    0 comments No comments

  3. kobulloc-MSFT 25,401 Reputation points Microsoft Employee

    Answer reported by @Caio Bonani . Thank you!

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others", I'll repost your solution in case you'd like to "Accept" the answer.


    Pushing to the registry works however az acr login results in a no such host error.

    Solution by Caio Bonani:

    After logout az logout, then logged in again, the command worked.

    0 comments No comments