Browsed by
Tag: CLI

Azure CLI 2.0 (preview) at first glance

Azure CLI 2.0 (preview) at first glance

Around four months ago Microsoft announced a new version of its Azure Command-Line Interface with the name Azure Command-Line Interface 2.0
If you want to read more, use this URL: https://azure.microsoft.com/en-gb/blog/announcing-azure-cli-2-preview 

Three weeks ago a newest beta of this CLI was shared to be publicly available:
https://docs.microsoft.com/en-us/cli/azure/install-az-cli2
There are versions for three major OS: Windows, Linux and OS X. There is also Docker image.

Microsoft decided to completely redesign it’s CLI backbone. Azure CLI is based on NodeJS whereas Azure CLI 2.0 is based on Python. Azure CLI 2.0 is still in Preview version, and I haven’t found any exact date when it will be officially release in non-preview state.

I decided to install Azure CLI 2.0 on Linux, in order to check whether the process is as really simple as Microsoft states on a it’s website. I used Linux Mint (newest version 18.1), mostly because I really like this distro.

Installation

Here is the full article how to install Azure CLI 2.0: https://docs.microsoft.com/en-us/cli/azure/install-az-cli2

I used instructions from the section connected with the newest version of Ubuntu (Ubuntu 16.04 LTS), as Linux Mint
is based on Ubuntu (which in turns Ubuntu is based on Debian). The instruction itself is not very sophisticated and consists of just two steps.

First step is about installation and update some packages, like SSL dev libs , Foreign Function Interface libs,
python dev and build-essential:

sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev build-essential

Microsoft encourages that If you haven’t installed any Python yet, install version 3.5.X at least, but installation went smoothly on my 2.7.12 version of Python:

Azure CLI 2.0 works also well with Python 2.7.X

 

Second step (and the last one) is about downloading and installation a new Azure CLI 2.0.
Installer will be run automatically and will ask some simple questions about localisation where the new CLI
will be installed.

curl -L https://aka.ms/InstallAzureCli | bash

Again, this step also went really smoothly.

After this, we can just start playing with new Azure CLI 2.0 by typing az in terminal.

Yes, there is a change:
the current version (CLI 1.0) uses azure as a main command whereas the upcoming major release (CLI 2.0)
uses az command instead of azure

Azure CLI 2.0 interface after installation