The Azure Command-line Interface is a cross-platform open source command-line tool that we may use to build and manage resources in the Azure portal.
This application allows us to issue commands and manage Azure resources directly from the Windows command prompt. Since this application is cross-platform users can easily install it on windows, linux or macOS.
It is nearly identical to Azure Powershell in capability and function.
In this guide we will be using Azure CLI to create a resource group and virtual machine, execute commands in the cloud shell.
Creating Resource Group and Virtual Machine with Azure CLI
On the Azure portal page click the icon on the top right corner, then select bash
Click confirm to switch to bash
To create a resource group paste these codes into your Azure CLI:
az group create --name mycoolRg --location EastUS
To create a Virtual Machine paste these codes into your Azure CLI:
az vm create \ --resource-group mycoolRg \ --name myVMcli \ --image UbuntuLTS \ --generate-ssh-keys
in the code above i used mycoolRg and myVMcli as my resource group name and my virtual machine name respectively, you can use any name of your choice
Confirming the Resource group and Virtual Machine created
Go to Azure portal page and search for resource group and click it
Here is the resource group created, click it
As you can see here is the Virtual Machine we created with Azure CLI
Thank you for reading!!! 🙏