Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Lesson 02 Demo 03

Working with Azure CLI

Objective: To create Azure resources using Azure CLI

Tools required: Azure Account

Prerequisites: None

Steps to be followed:

1. Install the CLI on Windows


2. Verify Azure CLI installation
3. Log in to Azure
4. Create a resource group
5. Verify the resource group

Step 1: Install the CLI on Windows


1.1 Install Azure CLI on the Windows operating system using the MSI installer.
1.2 Go to https://aka.ms/installazurecliwindows, and in the browser security dialog box,
click Run.
1.3 Accept the license terms in the installer, and then click Install.

1.4 In the User Account Control dialog, select Yes.

Step 2: Verify Azure CLI installation


2.1 You run Azure CLI by opening a Bash shell for Linux or macOS or from the command
prompt or PowerShell for Windows.
2.2 Start Azure CLI and verify your installation by running the version check:
az version

Note: Running Azure CLI from PowerShell has some advantages over running Azure
CLI from the Windows command prompt. PowerShell provides more tab completion
features than the command prompt.
Step 3: Log in to Azure
3.1 Authenticate to Azure by running the following command:
az login
3.2 Azure CLI will launch the default browser to open the Azure Sign in page.

3.3 After successful sign in, you will be connected to Azure subscription.

Step 4: Create a resource group


4.1 Azure CLI group create command creates a resource group.
4.2 Specify a name and location. The name must be unique within your subscription.
az group create --name <name> --location <location>
Step 5: Verify the resource group
5.1 To verify the successful creation of resource group, run the following command:
az group list
5.2 To get a more concise view, format the output as a simple table by the following
command:
az group list –output table

5.3 If there are several items in the group list, filter the output using the query option.
az group list –query “[?name==’<rg name>’]”

After completing this demo, you will be able to successfully install the Azure CLI on your local
machines and can directly manage your Azure resources from your local machine.

You might also like