Showing posts with label Azure VM. Show all posts
Showing posts with label Azure VM. Show all posts

Saturday, June 21, 2025

How to create Ubuntu 22.0.4 Virtual Machine (VM) in Azure? | Create Ubuntu 22.0.4 VM in Azure | How to connect to Azure VM from your local machine

 How to Create Ubuntu 22.0.4 Virtual Machines(VM) in Azure portal? Creating Virtual Machine is easy and straight forward in Azure Cloud. Let us see how to do that in Azure portal. 

Pre-requisites:

  • Azure account subscription, click here if you dont have one.
Watch Steps in YouTube channel:


Steps to create Ubuntu 22.0.4 Virtual Machine in Azure
 
1. Login to Azure portal, go to https://portal.azure.com/
2. Click on Virtual Machines.

3. Click on Add virtual machine.

 

4. Now enter the details as below or give values per your subscription and requirements. Select Ubuntu 22.0.4 VM



5. choose authentication type as SSH public key, enter azureuser as user name, enter key pair name.
This step will eventually create SSH keys and allow you to download in your machine.



6. Under Networking


Go with Allow selected ports - SSH port 22
And also select Delete public IP and NIC when VM is deleted option


7. Click on Review, it may take a few mins to finish the validations. If all good, it should pass the validations. Click on Create.

8.  Now download the SSH keys and save it locally.
 

9. Once created, Click on virtual machines.

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


How to connect to Azure VM from your local machine?



11. Now select that instance, click on connect


Then choose SSH 


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

13. Make sure your SSH keys is not accessible by others, by executing the below command:

chmod 400 myUbuntuVM_key.pem
14. Now ssh into VM from your local machine using the key

ssh -i myUbuntuVM_key.pem azureuser@your_ip_address


Now it should show you that you are connected to Azure.



Saturday, August 19, 2023

How to connect to Azure Virtual Machine from your local machine? | Connect to Azure VM from your local machine | Connect to Azure VM from your local machine

Let's learn how to connect to a Virtual machine running in Azure cloud from your local machine. Your local machine can be a Windows laptop or MacBook laptop.




Pre-requisites:

1. Keys(for e.g., yourkey.pem) already downloaded in your local machine, preferably in downloads folder.
2. Azure VM is up and running
3. SSH client - for Windows laptop, you need to install an SSH client such as Git bash or putty. You can download Git from this URL - https://git-scm.com/downloads. For Apple laptop you need to download iTerm from here.

Steps to connect to your Azure VM instance:

1. Go to Azure console --> https://portal.azure.com
2. Click on Virtual machines, click on VM
3. Click on connect





Choose Native SSH




Enter SSH key name in step # 3 in the screen


4. copy the values from step # 4

 
Copy the url from SSH which looks like below:

For e.g.
ssh -i myAzVMKey.pem azureuser@104.43.214.12

Watch steps in YouTube channel:

Windows Laptop instructions
5. Go to your local machine, Open Git Bash in Windows


make sure you are in downloads directory where your keys got downloaded. Type the below commands:

type below commands: 
pwd
this should tell you which directory you are and then navigate to downloads dir.

cd  ~/downloads 


Now copy the value from Example in the above screen

ssh -i myAzVMKey.pem azureuser@104.43.214.12

and then type enter, say yes and enter
now you should be in Azure cloud, screen should show something like this, It means you are successfully connected to VM instance running on Azure cloud. 


Mac Book Laptop or iMac Instructions

Open iTerm window, type the below command to go to downloads directory.
cd downloads


For few Mac laptops, it may add .txt in the end of pem file. in that case you need to remove .txt in the end


ssh -i myAzVMKey.pem azureuser@104.43.214.12

pwd
and then execute below command to make sure the keys have only read permissions.

chmod 400 *.pem

6. Paste the url from example highlighted above in step # 4.
ssh -i myAzVMKey.pem azureuser@104.43.214.12
7. type yes when it is asking to connect.
8. now you should be in Azure cloud, screen should show something like this, It means you are successfully connected to VM instance running on Azure cloud. 




 

Friday, June 9, 2023

Install Jenkins on Ubuntu 22.0.4 in Azure VM | Setup Jenkins on Azure Linux instance | How to setup Jenkins in Ubuntu Virtual Machine running in Azure Cloud?

Jenkins is an open source continuous integration/continuous delivery and deployment (CI/CD) automation software DevOps tool written in the Java programming language. It is used to implement CI/CD workflows, called pipelines.


Please follow the steps to install Java, Jenkins, Maven on Ubuntu 22.0.4 instance. Jenkins, Maven are Java based applications, so we need to install Java first. 

Pre-requisites:

Change Host Name to Jenkins
sudo hostnamectl set-hostname Jenkins

Perform update first
sudo apt update

Install Java 11
sudo apt install default-jdk -y

 
Once install java, enter the below command

Verify Java Version
java -version

Maven Installation
Maven is a popular build tool used for building Java applications. Please click here to learn more about Maven. You can install Maven by executing below command:

sudo apt install maven -y

you can type mvn --version
you should see the below output.



Now lets start Jenkins installation

Jenkins Setup

Add Repository key to the system
curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null

Append debian package repo address to the system
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null


Update Ubuntu package
sudo apt update
Install Jenkins
sudo apt install jenkins -y


The above screenshot should confirm that Jenkins is successfully installed.

Access Jenkins in web browser

Now Go to Azure Portal console. Click on Jenkins VM, Copy the public IP address.
 

Now go to browser. enter public IP address with port no 8080.

Unlock Jenkins
You may get screen, enter the below command in Git bash( Ubuntu console)
Get the initial password from the below file
sudo cat /var/lib/jenkins/secrets/initialAdminPassword


Copy the password and paste in the browser.
Then click on install suggested plug-ins. 
Also create user name and password.
enter everything as admin. at least user name as admin password as admin
Click on Save and Finish. Click on start using Jenkins. Now you should see a screen like below:


That's it. You have setup Jenkins successfully. 

Please watch the steps in our YouTube channel:    

Saturday, April 15, 2023

How to create Ubuntu 22.0.4 Virtual Machine (VM) in Azure? | Create Ubuntu 22.0.4 VM in Azure | How to connect to Azure VM from your local machine

How to Create Ubuntu 22.0.4 Virtual Machines(VM) in Azure portal? Creating Virtual Machine is easy and straight forward in Azure Cloud. Let us see how to do that in Azure portal. 

Pre-requisites:

  • Azure account subscription, click here if you dont have one.
Watch Steps in YouTube channel:


Steps to create Ubuntu 22.0.4 Virtual Machine in Azure
 
1. Login to Azure portal, go to https://portal.azure.com/
2. Click on Virtual Machines.

3. Click on Add virtual machine.

 

4. Now enter the details as below or give values per your subscription and requirements. Select Ubuntu 22.0.4 VM



5. choose authentication type as SSH public key, enter azureuser as user name, enter key pair name.
This step will eventually create SSH keys and allow you to download in your machine.



6. Under Networking


Go with Allow selected ports - SSH port 22
And also select Delete public IP and NIC when VM is deleted option


7. Click on Review, it may take a few mins to finish the validations. If all good, it should pass the validations. Click on Create.

8.  Now download the SSH keys and save it locally.
 

9. Once created, Click on virtual machines.

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


How to connect to Azure VM from your local machine?



11. Now select that instance, click on connect


Then choose SSH 


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

13. Make sure your SSH keys is not accessible by others, by executing the below command:

chmod 400 myUbuntuVM_key.pem
14. Now ssh into VM from your local machine using the key

ssh -i myUbuntuVM_key.pem azureuser@your_ip_address


Now it should show you that you are connected to Azure.



Master DevSecOps and Multi Cloud Computing Course by Coach AK | DevSecOps and Cloud Computing Online Classes | Sep 2025 Schedule

  Master DevSecOps and cloud Computing Bootcamp Schedule for Sep 2025 Are you ready to  supercharge your career  in  DevSecOps ? Whether you...