DEV Community

Hyacienth Ugochukwu
Hyacienth Ugochukwu

Posted on

Creating a virtual machine using CLI (Bash)

Go to your Azure Portal dashboard and click on the Cloud Shell icon. A coding environment will pop up below your screen. Select Bash and proceed to create your resource group and virtual machine.

Creating a resource group in bash just requires this command;
az group create --name [the name that you want to use] --location [the location that you want to use]

Image description

Creating a virtual machine in bash requires this command;

az vm create \
--resource-group [resource group name] \
--name [name of your virtual machine] \
--image Ubuntu2204 \
--generate-ssh-keys
Enter fullscreen mode Exit fullscreen mode

Image description

Top comments (0)