BlogPost

Azure - Using Azure CLI - Part 1

Azure - Using Azure CLI - Part 1



The Azure PowerShell module is available on Linux and Mac OS, in addition to Windows, its primary users tend to work mostly with Microsoft technologies. Those operating in the open-source environments favour scripting tools that resemble UNIX and Linux shell interfaces. Azure CLI provides this type of interface. In this lesson, you will learn about the basic characteristics of Azure CLI, its installation methods, and a few basic commands that allow you to access your Azure subscription.



Step One

Connecting to your Azure subscription by using Azure CLI

On your machine click Start, in the Start menu, expand the Windows System folder, right-click Command Prompt, click More, and click Run as administrator. When prompted by User Account Control for confirmation, click Yes.

From Administrator: Command Prompt, type the following command and then press Enter:


AZ Login



Result




You will be presented with the message instructing you to open a browser at the page https://aka.ms/devicelogin and provide the code included in the message to authenticate. Start Microsoft Edge and browse to https://aka.ms/devicelogin.

On the Device Login page, type the code included in the message. This will identify Microsoft Azure Cross-platform Command Line Interface as the application publisher. Click Continue.




In the sign-in windows that appears, sign in by using the Microsoft account that is the Service Administrator of your Azure subscription.




Note the message stating that you have signed in to the Microsoft Azure Cross-platform Command Line Interface application on your device. Close the Microsoft Edge window.




From Administrator: Command Prompt, type the following command and then press Enter:


az account show



Take note of the value of the id parameter, representing your Azure subscription ID. You will need it in the next post.

From Administrator: Command Prompt, type the following command and then press Enter:


az provider list

Examine the output, including Azure resource providers, resource types, and the Azure regions where these resources are available.





In the next post we will Manage Azure resources and resource groups by using Azure CLI