Installing Azure CLI on Debian GNU/Linux for WSL

We just released the Debian GNU/Linux for WSL. More information can be found at the following "Debian GNU/Linux for WSL now available in the Windows Store" blog post.

After downloading the Debian WSL from the Microsoft Store I wanted to first install the Azure CLI tools. According to the Azure CLI installation documentation one of the first steps is modifying your sources list:

 AZ_REPO=$(lsb_release -cs)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | \
     sudo tee /etc/apt/sources.list.d/azure-cli.list

But when running lsb_release -cs on the Debian WSL you are not getting the correct result returned.

Because lsb_release -cs does not return a value on the Debian WSL you should modify the sources list accordingly:

 echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ stretch main" | \
     sudo tee /etc/apt/sources.list.d/azure-cli.list

Now you should be able to continue with the installation of the Azure CLI tools on your Debian WSL.

Hope this helps!

References: