Automating Windows Azure with Windows Azure CLI

Recently, Microsoft Windows Azure team has announced the release of azure-cli 0.6.10 which can be used for automating Windows Azure in an easy and elegant manner. The azure-cli is a Node.js based cross platform command line tool for Windows Azure, which can be used for managing and deploying Windows Azure Websites, Windows Azure Storage, Mobile Services, Virtual Machines, Service Bus from command prompt on Windows, Mac and Linux.

Installing Windows Azure CLI

You can install Windows Azure CLI by either using a MSI installer for Windows or using a Node.js NPM module azure-cli. The Windows installer can download from here 

image

The Azure CLI is a Node.js based command line tool, so the Windows installer for Azure CLI  will automatically install Node.js and other required components.

Azure CLI is delivering as a Node.js NPM module so that we can install the Azure CLI using Node.js. The following command will install Azure CLI  by using Node.js Package Manager.

image

In the above command, we install NPM module azure-cli

Using Windows Azure CLI

After installing Azure CLI, just type azure and enter in the command prompt that will show the following output which including all available commands

image

The information provided below is a few sample commands for automating Windows Azure with Azure CLI

Managing Windows Azure Accounts

The Azure CLI command “azure account download” will download a publishsettings file from Windows Azure portal. You have to login to the Windows Azure portal in order to download the publishsettings file.

image

The Azure CLI command “azure account import [publishsettings file] imports Windows Azure credentials so that you can easily manage Windows Azure Websites, Mobile Services, Virtual Machines, Service Bus by using the CLI commands.

image

Managing Windows Azure Storage

The Azure CLI  command “azure account storage list” list out the all storage account

image

The Azure CLI  command “azure account storage create [name] --location ["location"]” creates a storage account in the specified location.

image

The Azure CLI command “azure account storage delete [name]” removes the specified storage account

image

Managing Windows Azure Websites

The Azure CLI command “azure site list” list out the websites created in the Windows Azure account.

image

The Azure CLI command “azure site create [name]” creates a Website in the specified data center region. The below command creates a Website in West US region.

image

The Azure CLI command “azure site show [name]” shows the all details about the specified Azure Website

image

The Azure CLI command “azure site delete [name]” removes the specified Windows Azure Website

image

More Information on Azure CLI

For more details on the commands and reference on Azure CLI, check out the following links:

Summary

The Azure CLI is a great command line tool which lets Windows Azure developers to automate Windows Azure by using your favorite command line tools regardless of operating systems. By using Windows Azure CLI, we can manage and deploy Windows Azure Websites, Windows Azure Storage, Mobile Services, Virtual Machines, Service Bus from command prompt on Windows, Mac and Linux.

No Comments