After logout az logout
, then logged in again, the command worked.
How to login into Azure Container Registry in Terminal
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>.azurecr.io/v2/": dialing <my registry name>.azurecr.io:443 with direct connection: resolving host <my registry name>.azurecr.io: lookup <my registry name>.azurecr.io 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.
3 answers
Sort by: Most helpful
-
Caio Bonani 5 Reputation points
2023-11-16T19:48:26.7+00:00 -
kobulloc-MSFT 26,131 Reputation points Microsoft Employee
2023-11-16T17:10:22.45+00:00 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:
- Public access needs to be configured. (Solution)
- VNet access needs to be configured. (Solution)
- Service access needs to be configured. (Solution)
- The registry is configured behind a firewall. (Solution)
- Ensure the registry name is correct (typos can happen)
- Use the registry fully qualified domain name (FQDN)
- ACR permissions are needed.
- (AKS) Credentials need to be renewed.
- Pipeline values were changed.
Azure Container Registry login troubleshooting guide:
https://learn.microsoft.com/en-us/azure/container-registry/container-registry-troubleshoot-login
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!
-
kobulloc-MSFT 26,131 Reputation points Microsoft Employee
2023-11-16T19:59:52.0866667+00:00 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.
Issue:
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.