az aks browse doesn't open browser automatically on WSL and only showing JSON instead of the dashboard az aks browse works fine on my Mac Mini, but I'm trying to work with it in WSL2 Ubuntu 18.04 with Azure CLI on a Windows 10 machine.

$ az version                      
This command is in preview. It may be changed/removed in a future release.
{
  "azure-cli": "2.1.0",
  "azure-cli-command-modules-nspkg": "2.0.3",
  "azure-cli-core": "2.1.0",
  "azure-cli-nspkg": "3.0.4",
  "azure-cli-telemetry": "1.0.4",
  "extensions": {}
}


Kubernetes 1.14.8 which shouldn't make a difference given it works fine in macOS. Appears to be an issue with WSL2.

The first issue is running:

az aks browse -g &lt;groupname&gt; -n &lt;clustername&gt;

Just brings up the following in az cli:

Proxy running on http://127.0.0.1:8001/
Press CTRL+C to close the tunnel..


It doesn't automatically open the browser from WSL2 like it does in macOS and Linux. So you have to CTRL + Click the http://127.0.0.1:8001 which will open the browser.

The second issue is it only brings up a JSON response with a list of API endpoints that looks like the following:

paths   
0   "/api"
1   "/api/v1"
2   "/apis"
3   "/apis/"
4   "/apis/acme.cert-manager.io"
5   "/apis/acme.cert-manager.io/v1alpha2"
6   "/apis/admissionregistration.k8s.io"
7   "/apis/admissionregistration.k8s.io/v1beta1"
8   "/apis/apiextensions.k8s.io"
9   "/apis/apiextensions.k8s.io/v1beta1"
10  "/apis/apiregistration.k8s.io"
11  "/apis/apiregistration.k8s.io/v1"
12  "/apis/apiregistration.k8s.io/v1beta1"
13  "/apis/apps"
14  "/apis/apps/v1"
....


And doesn't do anything after that.

Followed all of the necessary steps for az login, az aks get-credentials, and RBAC.

What gives?
I would expect it to work like az login and open up a new tab in default browser. But somehow it doesn't work like that. I think the fix must come from azure CLI.

Temporarily, For az aks browse you can setup an environment variable on WSL.

export BROWSER="/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"


In this case next when I run az aks browse it will open up the dashboard in new chrome tab.

You can use this variable to use your favorite browser. I would also add this variable to .bashrc or profile to be added on every session.