Azure-cli: az login WSL 2 Ubuntu 18.04 does not open browser

Created on 5 Aug 2020  路  7Comments  路  Source: Azure/azure-cli

Describe the bug
When running command az login web browser won't open.
Running on verbose mode

az login --verbose
Detect no GUI is available, so fall back to device code
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code GFHKIOWYA to authenticate.

To Reproduce
Run az login on WSL 2 Ubuntu 18.04

Expected behavior
Default browser opens on AZ login page.

Environment summary
Windows 10 Pro 2004

WSL 2 Ubuntu 18.04

uname -a
Linux MY-COMPUTER 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
az --version
azure-cli                         2.10.0

command-modules-nspkg              2.0.3
core                              2.10.0
nspkg                              3.0.4
telemetry                          1.0.4

Python location '/opt/az/bin/python3'
Extensions directory '/home/nico/.azure/cliextensions'

Python (Linux) 3.6.10 (default, Jul 31 2020, 08:33:11)
[GCC 7.5.0]

Additional context
Running

powershell.exe -Command 'Start-Process https://github.com/Azure/azure-cli/issues'

opens successfully the browser on the Azure CLI issues page.

Account customer-reported feature-request

Most helpful comment

Let me reopen it and put it into our roadmap.

All 7 comments

add to S174

We currently haven't developed and tested on WSL 2, so it is not supported yet. For now, you may use

az login --use-device-code

@yonzhan, maybe I missed it, but was there any actual resolution?

This feature is currently not supported in CLI and you can use the workaround provided by @jiasli . If you do want this, we can consider planning it in our backlog. Due to a bunch of high priority features, we do not have bandwidth to support it currently. Thanks for your understanding.
Please let me know if you have any further questions.

I totally understand the priorities but a bit disappointing to see no support for WSL2 when Microsoft is now backporting it to Windows 10 19.09 and 19.03.
I think the bug is rather simple and resides in the way the CLI is detecting WSL vs WSL2, and fall back in the default behavior.

Let me reopen it and put it into our roadmap.

Just use below - its Display issue
DISPLAY=:0 az login

Was this page helpful?
0 / 5 - 0 ratings