Setup Microsoft Azure Command Line interface


Overview

The purpose of this page is to walk through the process of installing and configuring the Microsoft Azure Command line interface. The command line interface is useful as certain commands are easier, scriptable, or unsupported in the Microsoft Azure GUI.

This guide is not meant to be exhaustive but rather a quick start.


Prerequisites

  • An Microsoft Azure account
  • Access to a supported command line environment such as Windows, Linux or Apple OSX.

What’s covered in this guide


Install The MS Azure Command Line interface

The Microsoft command line interface can be installed in a variety of environments

Important Note

Important

The Microsoft Azure CLI install process is governed by Microsoft Corporation and may change at any moment. This page is meant as a guide. Please consult the Microsoft Azure documentation for exact details of the command line interface and similar topics.

  1. Open a browser to Microsoft Azure CLI overview page.
  2. In the Download section select an appropriate environment.
  3. Execute the download and install scripts for your environment:
    For example on Mac OSX:
    brew update && brew install azure-cli

    On Windows 10 using powershell as administrator:
    Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'

Configure Azure Environment

You must login to use the Microsoft Azure cli environment. 

  1. After installing the Microsoft Azure environment, login using
    az login
  2. A browser will be opened and direct you to the Microsoft Azure login.
    Login using appropriate credentials.
  3. On success the command line display results similar to:

    You have logged in. Now let us find all the subscriptions to which you have access...
    [{ 
       "cloudName": "AzureCloud", 
       "id": "a937247b-. . . ", 
       "isDefault": true, 
       "name": "Azure subscription",
       "state": "Enabled",
       "tenantId": "f1f9fcc4-. . . ",
       "user": { 
            "name":"your.user@tld",
            "type":"user"
            }
    }]
    
Top