DEV Community

Cover image for Provisioning an Azure VM using AZURE CLI
emmilly immaculate
emmilly immaculate

Posted on

Provisioning an Azure VM using AZURE CLI

NB. Cover picture credit to Varonis
definition
Alright, so being a software developer, i definately prefer cli to clicking through various interfaces.
So this is how i have decided to navigate through the Azure Portal.

  1. First we shall download Azure cli on ubuntu using
    curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

  2. Next we shall log into azure using
    az login .

  3. To verify that we have logged we shall type
    az account show.

  4. First we shall create a resource group by specifying the name and location of the resource group using

create resource group
This should show

result of resource group creation

5.Next, we shall create a VM using

create vm

  • --name - specify the name of the vm
  • --resource-group - to specify the name of the resource group
  • -- image - to specify the operating system to install on the vm
  • --admin-username - to specify the username to use to log into the the vm
  • --generate-ssh-keys - to genrate ssh keys create vm result

6.To log into the vm, we shall use ssh, our ip address and the admin username.
ie ssh testadmin@public_ip_address_of_vm
loginto vm.

7.Lastly to delete the resources, we shall delete the resource group we have created.

  • First use Ctrl + D to jump out of the ubuntu vm.
  • Then use delete resource group

voila.

Top comments (0)