DEV Community

Cover image for Creating Resource group and Virtual machine using Command-line interface (CLI) in Azure
Konkwo Godwin
Konkwo Godwin

Posted on • Updated on

Creating Resource group and Virtual machine using Command-line interface (CLI) in Azure

Definition
Azure command-line interface (Azure CLI) is a different approach of creating Virtual Machine in Azure other than PowerShell. Note that the Azure CLI is a command-driven scripting environment like PowerShell that also uses the Azure REST API to execute management tasks in Azure. Approximately identical to Azure PowerShell in capability and function, running on Windows, Linux, and Mac.
Like Azure PowerShell, you can run the Azure CLI in a web browser through the Azure Cloud Shell, giving one the capability to run the Azure CLI in schemes were running it natively might not be possible or feasible.
Steps to taken when using CLI to create Resource group and Virtual machine in Azure are highlighted below

Login to your Azure portal, click on the cloud shell in the Azure portal, then select Bash

Image description
Write and paste the resource group and virtual machine scripts to create Resource group and virtual machine as shown below

Image description

Image description

The resource group and virtual machine that are created are shown below

Image description

Image description
The deployed VM is running

Image description

Top comments (1)

Collapse
 
yemmyoye profile image
Yemisi Oyesainu

good