Microsoft Azure CLI 2.0 is an excellent Azure CLI reboot based on Python which is now GA. If you want to install and run it on the bash on Ubuntu shell provided as a developer feature with the Windows 10 Anniversary update, here’s what you need to do.
1. Install the bash on Ubuntu shell. Follow these instructions if you don’t have it. If you already have it but have installed random libraries and want to reset, you can do that by uninstalling (after saving any data) with the ‘lxrun /uninstall’ command from a command window, and then clicking on the bash on Ubuntu icon again to reinstall.
2. Get the Ubuntu subsystem up to date:
sudo apt-get update
sudo apt-get upgrade
3. Make sure you can ping your host name. The first CLI install instruction in the next step will fail if you can’t ping your hostname. To fix it I edited my /etc/hosts file and added the hostname to the 127.0.0.1 localhost line:
127.0.0.1 localhost PONDLIFE
I might change this later depending on what I need to do with networking and name resolution, but this works for now.
4. Follow the apt-get install instructions for a 64-bit system from the Azure CLI github install notes:
$ sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 $ sudo apt-get install apt-transport-https $ sudo apt-get update && sudo apt-get install azure-cli
Once the azure-cli package is installed you can run the ‘az’ command and see the options: