Azure CLI installation on Windows and VM creation using Azure CLI

Azure CLI installation on Windows

Command-line tools; The Azure CLI is a command-line tool providing a great experience for managing Azure resources. The CLI is designed to make scripting easy, query data, support long-running operations. The current version of the CLI is 2.0.55.

https://aka.ms/installazurecliwindows

In this article, we’ll install Azure CLI on windows and will create virtual machines using Azure CLI.

The MSI distributable is used for installing, updating, and uninstalling the az command on Windows. Firstly, lets start to download Azure CLI msi file then double click to install.

When the installer asks if it can make changes to your computer, click the “Yes” box

You can now run the Azure CLI with the az command from either Windows Command Prompt or PowerShell. PowerShell offers some tab completion features not available from Windows Command Prompt.

Run the login command on Powershell

az login

If the CLI can open your default browser, it will do so and load a sign-in page.

Otherwise, you need to open a browser page and follow the instructions on the command line to enter an authorization code after navigating to https://aka.ms/devicelogin in your browser.

Sign in with your account credentials in the browser.

Az login –use-device-code

In Azure, all resources are allocated in a resource management group. Resource groups provide logical groupings of resources that make them easier to work with as a collection.

az group create –name CloudepictResources –location eastus

Create a new virtual machine running Ubuntu, which uses SSH authentication for login

az vm create –resource-group CloudepictResources –name CloudepictVM1 –image UbuntuLTS –admin-username cloudepict –generate-ssh-keys –output json –verbose

You are able to see virtual machine on portal.azure.com as well.

Now that a VM has been created, detailed information about it can be retrieved. The common command for getting information from a resource is show.

az vm show –name cloudepictVM1 –resource-group CloudepictResources

Its time to connect Ubuntu VM using Putty client. For this purpose you need to find the following required rsa.

On Putty Key Generator find to rsa file and save as private key using “Save private key” clicking.

Now, we can connect this VM over VM’s public IP address using Putty client on port number 22

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.