diff --git a/src/azure-cli-core/azure/cli/core/_profile.py b/src/azure-cli-core/azure/cli/core/_profile.py index f1d3b1ba880..38877ec69df 100644 --- a/src/azure-cli-core/azure/cli/core/_profile.py +++ b/src/azure-cli-core/azure/cli/core/_profile.py @@ -1202,6 +1202,11 @@ def _get_authorization_code_worker(authority_url, resource, results): break except socket.error as ex: logger.warning("Port '%s' is taken with error '%s'. Trying with the next one", port, ex) + except UnicodeDecodeError: + logger.warning("Please make sure there is no international (Unicode) character in the computer name " + r"or C:\Windows\System32\drivers\etc\hosts file's 127.0.0.1 entries. " + "For more details, please see https://github.com/Azure/azure-cli/issues/12957") + break if reply_url is None: logger.warning("Error: can't reserve a port for authentication reply url")