DEV Community

Cover image for Steps To Deploy a Linux Virtual Machine using an ARM Template
Chidera Enyelu
Chidera Enyelu

Posted on

Steps To Deploy a Linux Virtual Machine using an ARM Template

Deploying a virtual machine (VM) using an Azure Resource Manager (ARM) template involves defining the VM configuration in a JSON template and then deploying that template to Azure.
Here’s a step-by-step guide to help you deploy a linux VM using an ARM template.

Using Azure Portal

  • Go to the Azure Portal. Azure portal
  • On the searchbar, search for "Deploy a custom ARM template"

Image description

  • Click on "select a template",there are several default templates.
  • Select the already made template "Linux VM template" or choose to build your own template in the editor.

Image description

  • Edit the JSON default template you selected or Paste the JSON template you chose to build into the editor and click Save.

Image description

Image description

On the basics tab, select the region, create a resource group, add an admin name and i used SSH Key instead of password and downloaded the key file.

Image description

  • Click Review + Create, review the settings, and click Create.

Image description

Image description

After Deployment of VM

The resources created are displayed in the resource group, choose the virtual machine to check if its running.

Image description

Image description

To connect to the linux VM using SSH key on commandpromt/powershell

  • On the file explorer, find the path to the shh key and copy path

Image description

  • Open your terminals(commandpromt/powershell).
  • Run this commands on your command prompt terminal

code
ssh -i path\to\your\key\your-key.pem username@ip-address

Image description

  • Once connected, you can install either Nginx or jenkins.

NOTE: you can download the template and use the same template to create another virtual machine.
By following these steps, you should be able to deploy a virtual machine using an ARM template in Azure.

Top comments (0)