Installing and Configuring Windows Azure CLI on Ubuntu

You can create and manage Azure Resources using Azure Command-Line Interface (Azure CLI). I’m doing this all on an Ubuntu VM.

  • Azure CLI installation
  • Connect your Azure subscription

The first step open your terminal

2016-04-04_11-35-41

We need to install the latest nodejs version from the ubuntu repository

sudo add-apt-repository ppa:chris-lea/node.js

2016-04-04_11-43-31

Update the local package index with the latest changes

sudo apt-get update

2016-04-04_11-48-22

Now we are ready to install nodejs :

Note: Most of the recent distributions require installing nodejs-legacy in order to get a properly configured npm tool to install the Azure CLI.

Some of the older distributions, such as Ubuntu 12.04, require installing the current binary distribution of Node.js. The following code shows how to do that by installing and using curl.

sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs

2016-04-04_12-18-36

Install Azure CLI

sudo npm install -g azure-cli

2016-04-04_14-03-51

azure login

2016-04-04_14-03-12

Use the provided code for login, open up the browser for authentication

2016-04-04_14-12-11

2016-04-04_14-16-45

We can check if your account associated with your id :

2016-04-04_14-19-34

List locations for Azure VM

azure vm location list

2016-04-04_14-49-07

Thanks,
Onur Yazir

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.