In preparation for some upcoming work using the Azure platform I took the Pluralsight course Developing with Node.js on Microsoft Azure - Getting Started by Scott Allen. In the course the Azure portal is used for many of the configuration and administration tasks but Scott also demonstrates the use of the Azure Command Line Interface. I installed the Azure CLI but had a lot of trouble on the way.
The first step is to Install Bash - Ubuntu on Windows which is fairly easy to accomplish. Next I used the instructions at Install Azure CLI 2.0 for the CLI install. I ran all the scripts in the section ‘Windows -> Bash on Ubuntu’ under the Windows section:
There is a warning to run the last command twice, which I did. But when I tried to run “az –version” I would get a message the az command is unknown. I did a lot of searches and tried a lot of fixes from Stack Overflow and other sources to no avail.
The page Failure during installing the azure-cli 2.0 in Bash on Ubuntu on Windows #1075 instructs you to run the following commands before installing the CLI on Bash for Windows.
Not being sure about the last command, I also ran:
But trying the original install scripts again did not work.
Then somewhere, and I can’t pin down where, I saw this command for the install:
There is an entry under ‘Errors with curl redirection’ on the page Install Troubleshooting that gives a workaround if the command does not work. Running the curl command did the trick. It was obvious that this was different because there were now user prompts not present in the original install I tried:
In trying to find the source of this command I pulled up a few pages of strong opinions about using CURL and Bash with a pipe. One of these had the title about the victim-less crime. As Ford Prefect told Arthur Dent once, “Don’t knock it, it worked.”