Search code examples
macosazurecommand-line-interface

Azure CLI won't login on MacOS


I am trying to login into the Azure CLI but when I run az login I get these error messages:

Roberts-Mac-Pro:~ robertcordingly$ az login
Port '8400' is taken with error '[Errno 8] nodename nor servname provided, or not known'. Trying with the next one
Port '8401' is taken with error '[Errno 8] nodename nor servname provided, or not known'. Trying with the next one
Port '8402' is taken with error '[Errno 8] nodename nor servname provided, or not known'. Trying with the next one
Port '8403' is taken with error '[Errno 8] nodename nor servname provided, or not known'. Trying with the next one
Port '8404' is taken with error '[Errno 8] nodename nor servname provided, or not known'. Trying with the next one
Port '8405' is taken with error '[Errno 8] nodename nor servname provided, or not known'. Trying with the next one
Error: can't reserve a port for authentication reply url
Login failed

I cut out most of the lines as it appears that it simply loops through a bunch of ports and gets Error number 8 every time.

If you have any idea why this is happening, I would really appreciate any help!


Solution

  • How did you install azure cli? use below brew formula

     brew update && brew install azure-cli