Azure Command Line 2.0 generally available.

This new version of Azure CLI should feel much more native to developers who are familiar with command line experiences in the bash enviornment for Linux and macOS. With simple commands that have smart defaults for most common operations and that support tab completion.

The number of Azure services supported in Azure CLI 2.0 has grown and now it have command modules for sql, documentdb, redis, and other.

Installing the Azure CLI

The CLI runs on Mac, Linux, and of course, Windows. Get started now by installing the CLI on whatever platform you use.

Here’s an example of the features included with the “vm command”:

Working with the Azure CLI

Accessing Azure and starting one or more VMs is easy. Here are two lines of code that will create a resource group and a Linux VM using Azure’s latest Ubuntu VM Image in the westus2 region of Azure.

Using the public IP address for the VM, connect directly to your VM from the command line:

For Windows VMs on Azure, you can connect using remote desktop (“mstsc <public ip address>” from Windows desktops).

The “create vm” command is a long running operation, and it may take some time for the VM to be created, deployed, and be available for use on Azure.

The Azure CLI 2.0 lets you list your Azure resources and provides different output formats.

You can use the “–query” option with the list command to find specific resources, and to customize the properties that you want to see in the output. Here are a few examples:

Azure CLI 2.0 supports management operations against SQL Server on Azure.