Introduction to Azure CLi 2.0 and It’s Installation

Introduction to Azure CLi 2.0 and It’s Installation

Azure CLI 2.0 is a new command line utility from the Azure Team.it got released on 28th Feb 2017 and the moment it got released and I read about it so the first thing that came to my mind was  why do we need it? I am a big fan of Powershell from 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 it but after going through 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 the python. It supports from python 3.5 & above.

Here are the main reason that we need Azure CLI 2.0

Let us discuss them in details

  • Architectured for Mac and Linux Unix Users

 

Although there was Azure CLI and powershell for linux which works well on cross platform but still they were not able to provide the native experience to the linux and mac users. So the idea was that the Linux user should be able to do apt get and mac user should be able to get it from the bash and use azure seamlessly.

 

  • Works well with GREP, CUT, jq etc

As it was designed for the Unix and mac users to they make sure that we can use tools like GREP, Cut, jq, jpterm etc which is quite popular with the AWS and open source developers and directly pass the output of one command to the other tools and work with it.

  • Built For ARM Templates

As the people who migrated from the version 1 to version 2 of azure( which was fully based on ARM Templates or you can relate it to the Resource Group Deployment Model) knows that the old cmdlets no longer make sense for the new infrastructure. Azure CLI support the new and old deployment model but it is inconsistent and confusing due to the transaction but Azure CLI 2.0 is built for the ARM Template based deployment model and hence it is more streamlined with the new deployments.

 

  • Swagger Pipeline

 

Now this is one of the most important reason that I took Azure CLi 2.0 Seriously. As most of the azure developers and IT Pros must be aware that azure is growing massively and they’re introducing one or the other new service or feature every now and then and it was very difficult for teams like powershell and CLI to keep upto that pace and release the commands for those new services and cmdlets so the backlog was increasing massively and the experience was inconsistent. With this new pipeline model, all the other services has to provide their api with the swagger which will give all the metadata required to built the new commands for the services and which will make the turn around time for the commands lesser and hence it will be shipped to the customers which is us in this case soon. I believe due to this development pipeline this azure CLI 2.0 is going to be much much stronger and powerful in the coming future.

 

 

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 platform.

 

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 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.

 

 

 

Comments

comments

Leave a Reply

Your email address will not be published. Required fields are marked *