DEV Community

1suleyman
1suleyman

Posted on

Project 3: Virtual Machine Setup in Azure

Introduction

In this project, I focused on creating and configuring a virtual machine (VM) in Azure. I learned how to select a VM image, configure its size, set up networking, and install software. Additionally, I explored how to connect to the VM remotely using Remote Desktop Protocol (RDP) for Windows. This project helped me understand how to set up VMs for testing or development purposes and manage them efficiently.

Project Overview
In this project, I:

  • Created a Virtual Machine (VM) in Azure.
  • Configured networking and disk settings.
  • Installed software on the VM.
  • Connected to the VM using RDP.
  • Managed the VM by stopping, restarting, and deleting it as necessary.

Step 1: Create a Virtual Machine (VM)

1️⃣ Navigate to the Virtual Machines Section:
I started by logging into the Azure portal and searching for "Virtual Machines" in the search bar or selecting it from the left-hand menu.

2️⃣ Create a New Virtual Machine:
I clicked on + Add or + Create to start creating a new VM.

3️⃣ Select Subscription and Resource Group:
I selected the Subscription I was working under.
For the Resource Group, I created a new one called MyWindowsVM_group to keep things organized.

4️⃣ Provide VM Basics:
Virtual Machine Name: I chose a name for my VM like MyWindowsVM.
Region: I selected UK South as the closest region to me for better performance.

Availability Options: I left this as No infrastructure redundancy required since it was a simple setup.

Image: I selected Windows Server 2019 Datacenter - x64 Gen2.

Size: I chose B1s (1 vCPU, 1 GB RAM), which is sufficient for this basic VM.

Authentication Type: I provided a Username and Password (e.g., Username: adminuser, Password: a secure password).

5️⃣ Networking Configuration:

For Virtual Network: I created a new network.

Subnet: I chose the default subnet.

Public IP: I ensured the Public IP option was selected so that I could connect to the VM remotely using RDP.

Network Security Group (NSG): I made sure the NSG allowed inbound traffic on port 3389 (RDP) to enable remote access.

6️⃣ Disks:
I left the default settings for disks and chose Standard SSD (locally redundant storage).

7️⃣ Monitoring:
I enabled Boot diagnostics to help with troubleshooting if necessary.

8️⃣ Review + Create:
Once everything was set up, I reviewed the configuration and clicked Create to provision the VM. After a few minutes, my VM was successfully created.

Step 2: Connect to the Virtual Machine (VM)
After the VM was created, I connected to it remotely using RDP.

1️⃣ Go to Your Virtual Machine:
I went to the Virtual Machines section in the Azure portal and selected the newly created VM (MyWindowsVM).

2️⃣ Get the Public IP Address:
On the Overview tab, I copied the Public IP address (e.g., 52.174.123.45).

3️⃣ Download RDP File:
I clicked on Connect, selected RDP, and clicked Download RDP File to download the .rdp file that contains the connection details.

4️⃣ Open RDP File:
I double-clicked the downloaded .rdp file to launch the Remote Desktop client.

5️⃣ Enter Credentials:
I entered the Username and Password I had set when creating the VM.

6️⃣ Connect to the VM:
After entering my credentials, I clicked OK, and I was connected to the Windows desktop of my VM. Now, I could interact with the VM just like a local machine.

Step 3: Install Software on Your VM
Once connected to the VM, I began installing the necessary software.
For a Windows VM, I used Server Manager or PowerShell to install required software.
I could also download and install software directly from the internet or use Windows Package Manager to automate the process.

Step 4: Stop, Restart, and Delete Your VM (Optional)
After completing my tasks on the VM, I managed it via the Azure portal:

1️⃣ Stop the VM:
In the VM overview page, I clicked Stop to shut down the VM. Note that stopping the VM doesn’t stop the billing for associated resources like storage and public IP.

2️⃣ Restart the VM:
If I needed to restart the VM, I clicked Restart from the same page.

3️⃣ Delete the VM:
If I no longer needed the VM, I clicked Delete to remove the VM and its resources from Azure.

4️⃣ Clean-Up:
After completing the project, I deleted the resource group MyWindowsVM_group to avoid any extra charges for unused resources.

Conclusion
In this project, I successfully created, configured, and connected to a virtual machine in Azure. I was able to interact with it remotely using RDP, install necessary software, and manage it via the Azure portal. This project is a great introduction to working with virtual machines in Azure, and I now have the skills to create, configure, and manage VMs for development or testing purposes.

By the end of this project, I had a strong understanding of how to set up and interact with virtual machines in Azure, which is essential for cloud-based development and infrastructure management.

Credits : https://www.datacamp.com/blog/azure-project-ideas

🚀 Stay tuned for more as I continue my learning journey with Azure!

Top comments (0)