DEV Community

Cover image for How to Update an Azure virtual network.
EMMANUEL
EMMANUEL

Posted on

How to Update an Azure virtual network.

A Virtual Network (VNet) in Azure is a private, isolated network that enables Azure resources, like Virtual Machines (VMs), databases, and services, to securely communicate with each other, the internet, and your on-premises networks. Think of a VNet as your own data center's network in the cloud.

Why Use a Virtual Network

  • To host secure applications that aren’t exposed to the public internet.
  • To connect Azure VMs and other services to each other
  • To connect Azure to your on-premises environment
  • To implement hybrid cloud solutions

Scenario
You’re helping an Azure Admin maintain resources. While you won’t be responsible for maintaining the entire infrastructure, the Admin will ask you to help out by completing certain tasks. Currently, there’s a Linux virtual machine (VM) that’s underutilized, and a need for a new Linux machine to serve as an FTP server. However, the Azure admin wants to be able to track network flow and resource utilization for the needed FTP server, so has asked you to start out by provisioning a new subnet. The current subnet should be left alone, as there are future plans for using it for additional VMs.

How to update an Azure virtual network.

Create a new subnet on an existing virtual network (vNet) Steps:

1.Login to Microsoft Azure at https://portal.azure.com

Azure login

2.From the Azure portal home page, in the search box, enter virtual networks. Select grayed virtual networks under services.

virtual network search

3.Select the guided-project-vnet virtual network.

guided project vnet

4.From the guided-project-vnet blade, under settings, select Subnet

Subnet

5.To add a subnet, select + Subnet

+ Subnet

6.For Subnet purpose leave it as Default. For Name enter: ftpSubnet.

Subnet name and purpose

7.Leave the rest of the settings alone and select Add

Add

Added subnet confirmation

Create a network security group
How to create Network security group (NSG). Steps:

1.From the Azure portal home page, in the search box, enter virtual networks

virtual network portal search

2.Select virtual networks under services

Virtual services

3.Select Network security groups

Network security groups

4.Select + Create

+ Create

5.Select the guided-project-rg resource group. Enter ftpNSG for the network security group name.

Resource group and NSG name

6.Select Review + create

Review + Create

7.Select Create and wait for complete deployment.

Create

Complete deployment

Create an inbound security rule
Creating inbound security rule to control the inbound networks. Steps:

1.Under settings, select Inbound security rules

Inbound security rules.

2.Select + Add

+ Add

3.Change the Destination port ranges from 8080 to 22. Select **TCP **for the protocol

Destination port and protocol

4.Set the name to ftpInbound. Select Add

Inbound security rule name

ftpinbound

5.Select Home to return to the Azure portal home page

Home

Associate a network security group to a subnet
To associate a network security group to a subnet, we take the following steps:

1.From the Azure portal home page, in the search box, enter virtual networks. Select **virtual networks **under services

Virtual networks

2.Select the guided-project-vnet virtual network

Guided project vnet

3.Under settings, select Subnets

Subnets

4.Select the ftpSubnet you created

ftpSubnet

5.On the Edit subnet page, under the Security section heading, update the Network security group field to ftpNSG

Associate the subnet with NSG

6.Select Save

Save

Top comments (1)

Collapse
 
realcloudprojects profile image
SKILL.SCH

welldone