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"
- 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.
- Edit the JSON default template you selected or Paste the JSON template you chose to build into the editor and click Save.
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.
- Click Review + Create, review the settings, and click Create.
After Deployment of VM
The resources created are displayed in the resource group, choose the virtual machine to check if its running.
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
- 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
- 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)