Step-By-Step Demo Of Creating Azure Virtual Network, Subnets And Network Security Groups - Part Three


This is the third part of the series where I am going to explain how to create an Azure Virtual Network, Subnets, and Network Security Groups and how to associate them with Virtual Machines.

If you have missed the previous parts, here are Part 1 and Part 2.
You will need an Azure Subscription to go ahead with this demo.
 
Step 1

Go to your first VM and click on Connect. If it is not running already, click on Start and then click on Connect.
 
Azure
 
Step 2

When you click on create, it downloads an RDP file. Open that RDP file.
 
Azure
 
Step 3

If you counter any errors while connecting to your VM, you can go to this link for troubleshooting options.
 
Step 4

Enter your VM credentials to start the VM and click OK.
 
Step 5

Once the VM starts, it looks something like this. It doesn't have any IIS server. Basically, this is just a raw VM. So, to make it useful as a Web Server, we need to configure it.
 
Azure
Step 6

Go to the Server Manager Dashboard and click on Add Roles and Features.
 
Azure
 
Step 7

Keep clicking on Next until you reach this window. Add the server of Web Server (IIS).
 
Azure
 
Step 8

When you tick it, it will open a new window. Click on Add Features.
 
Azure
Step 9

Keep clicking on Next until you reach the final window. Then click on Install. It will start the installation which will take a while.
 
Step 10

Once the installation gets finished, you can go and check the C drive of the VM and you will find the inetpub folder there.
 
Azure
Step 11

Now, from your VM overview in Azure, copy the public IP address of the VM. Currently, it doesn't have any name. Let's see if the public IP is working well or not.
 
Azure

It works perfectly fine.
 
Azure
Step 12

Now, we are going to give our VM's IP address a domain name. In the VM overview, click on configure DNS name. Change the DNS name to whatever you want and click on Save. Now, using this address, you can access the VM from the browser.
 
Azure
Step 13

You will be able to see that the DNS name would be visible in the overview as well. Now it can be accessed using the given name.
 
Azure
Step 14

The database VM that we had created will not allow us to connect normally. It would only allow us to connect via a private IP. So, we need to establish an RDP allow rule for it. So, in our BackEnd NSG, we are going to add one more rule.
 
Azure
 
Azure

Change the port number to 3389 and protocol to TCP. And click on Save.
 
 Azure
 
Step 15

Go to your database's network interface and go to its IP configurations. Find the IP name there and click on it.
 
Azure
 
Step 16

Enable the public IP address and give it some name. Click on Save.
 
Azure
 
Now it will be displaying the public IP.
 
Azure
 
Step 17

Now, you can easily connect to your VM. Click on "Connect".
 
Step 18
Open the RDP File.
 
Step 19

Enter the credentials and it should all work fine.
 
Step 20

But from this VM, you cannot connect to the internet because the outbound requests are denied. You can see that Google cannot be accessed because of our defined NSG.
 
Azure
 
Step 21

But from our Web Server, we can access it.
 
Azure
 
So we can say that our Network Security Groups are working correctly.

This is how you can create Virtual Networks, Subnets, and Network Security Groups and associate them with each other. 


Similar Articles