Tuesday, January 14, 2020

How to create Ubuntu 16.0.4 Virtual Machine (VM) in Azure? Create Ubuntu 16.0.4 Virtual Machine (VM) in Azure and Connect using SSH keys from locally into Azure Virtual Machine

How to Create Virtual Machine in Azure?

Creating Virtual Machine is easy and straight forward. Let us see how to do that.

Pre-requistes:

1. Make sure you create SSH keys locally in your local machine - windows or Apple. You can create SSH keys by executing below command:
ssh-keygen

and then copy key using below command:
sudo cat ~/.ssh/id_rsa.pub

Steps to create Virtual Machine in Azure 

1. Login to Azure portal, go to portal.azure.com
2. Click on Virtal Machines.


3. Now enter the details as below or give values per what your subscription and requirements:


4. Also enter username as azure (make sure your key has this name and copy content of ssh keys


5. Then under management, choose options as below:

Make sure you choose Boot Diagnostics off, by default it will be on.

Once done, click on Review + create
It should pass the validations as shown below:


6. It may take more than a couple of mins to create the VM.

7. Once created, Click on virtual machines.

8. You should see the new VM is running like below:



9. Now select that instance, click on connect


Then choose SSH 


10. Copy the value as it shows below in your local terminal(iTerm for Apple laptop) or Git bash for Windows laptop.


11. Paste the value as below in the terminal, remove -i <private key path>


ssh -i  devopscoaching@13.66.4.124
Now it should show you that you are connected to Azure.



No comments:

Post a Comment

Fix for Jenkins slowness when Running in AWS EC2 instance | Jenkins Very Slow Upon Starting EC2 Instance after Stopping

Let's say that you have configured Jenkins in AWS EC2 instance and you are using AWS free tier and you are NOT using Elastic IP, so when...