Describe the bug
az login with default options doesn't work with GitHub Codespaces. It fails when trying to hit localhost on response.
To Reproduce
Open GitHub Codespaces.
run az upgrade to get to 2.30
run az login in GitHub Codespaces, the default codespace is fine.
This is printed:
The default web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.

**Workaround **
- Use
--use-device-code option
- Detect if user is in Codespaces by checking
CODESPACES=true env var and call az login with --use-device-code
Expected behavior
It should work in GitHub Codespaces with default options.
Environment summary
GitHub Codespaces
Linux-5.4.0-1062-azure-x86_64-with-debian-bullseye-sid, Ubuntu 20.04.3 LTS
Python 3.6.10
Installer: DEB
azure-cli 2.30.0
Additional context
Describe the bug
az login with default options doesn't work with GitHub Codespaces. It fails when trying to hit localhost on response.
To Reproduce
Open GitHub Codespaces.
run az upgrade to get to 2.30
run az login in GitHub Codespaces, the default codespace is fine.
This is printed:
**Workaround **
--use-device-codeoptionCODESPACES=trueenv var and callaz loginwith--use-device-codeExpected behavior
It should work in GitHub Codespaces with default options.
Environment summary
GitHub Codespaces
Linux-5.4.0-1062-azure-x86_64-with-debian-bullseye-sid, Ubuntu 20.04.3 LTS
Python 3.6.10
Installer: DEB
azure-cli 2.30.0
Additional context