Azure CLI 2.0 is a new command line utility from the Azure Team. It got released on February 28 2017 and the moment it got released I read about it so the first thing that came to my mind was why do we need it? I have been a big fan of Powershell for many years and all my cross-platform scripts are written using Azure XPlath CLI. I wasn’t quite impressed by the idea of learning new commands for the same thing that can be done by the other technologies that I am familiar and comfortable with but after going through a couple of videos and blog posts from the official team, I was not only convinced but also impressed. Azure CLI was built on the top of Node.js whereas Azure CLI 2.0 is built on the top of Python. It supports from Python 3.5 and above.

Here are the main reasons why we need Azure CLI 2.0.

Azure

Let us discuss them in details.

Installation

As Azure CLI 2.0 is an open source cross-platform tooling from the Azure Team, we need to install its binaries to our system and here are the commands you need to run for the different platforms.

WINDOWS

You need to install Python and PIP before installing the Azure CLI 2.0.

pip install --user azure-cli

MacOS

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

Linux

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

exec -l $SHELL

Docker

docker run azuresdk/azure-cli-python:<version>

Azure CLI 2.0 also has a docker image and they update that image on a nightly basis. So, if you have a docker, you can directly put Azure CLI 2.0 in your container and run your scripts without worrying about setting up that environment again.