DEV Community

Cover image for Update and Maintain Resources in Azure - Update the virtual network
nnamdi nmarah
nnamdi nmarah

Posted on

Update and Maintain Resources in Azure - Update the virtual network

In this scenario, you’re assisting an Azure Administrator with managing cloud resources. While you’re not handling the entire infrastructure, you’ll support by carrying out specific assigned tasks.

At the moment, there is an underutilized Linux virtual machine, and there’s a requirement to deploy another Linux VM that will function as an FTP server. To properly monitor network traffic and resource usage for this new server, the administrator has decided that a separate subnet should be created. The existing subnet will remain unchanged, as it is reserved for future virtual machine deployments.

This article builds on the previous one, and all previously created resources will be reused in this setup.

Create a New Subnet in an Existing Virtual Network

From the Azure Portal homepage, search for and select Virtual networks under Services to begin creating a new subnet within your existing VNet.

  • From the Azure portal home page, search for and select virtual networks under services.

search and select

-Select the guided-project-vnet virtual network.

Select the guided-project-vnet

  • From the guided-project-vnet blade, under settings, select Subnets.

select subnets

  • To add a subnet, select + Subnet.

select subnet

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

subnet name

  • Leave the rest of the settings unchanged and select Add.

select add

Create a network security group

  • From the virtual network blade, select network security group

select network security group

  • Select + Create.

select + create

  • Select the guided-project-rg resource group.

Select the guided-project-rg

  • Enter ftpNSG for the network security group name.

Enter ftpNSG

  • Select Review + Create

Review + Create

  • Select Create.

create

  • Wait for the screen to refresh and display Your deployment is complete, then select Go to resource.

select Go to resource

Create an inbound security rule

  • Under settings, select Inbound security rules.

Inbound security rules

  • Select + Add.

select + Add

  • Change the Destination port range from 8080 to 22.

Change the Destination port range

  • Select TCP for the protocol.

Select TCP

  • Set the name to ftpInbound.

ftpInbound

  • Select Add.

select Add

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

Associate a network security group to a subnet

  • From the Virtual network page, select the guided-project-vnet virtual network.

select the guided-project-vnet

  • Under settings, select Subnets.

select subnets

  • Select the ftpSubnet you created.

select the ftpsubnet

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

update

Conclusion

Creating a subnet within an existing Azure Virtual Network (VNet) allows administrators to divide the network into smaller, well-organized segments. Each subnet represents a defined IP address range, making it easier to manage resource placement and control network traffic. Once created, the subnet serves as a dedicated space where resources like virtual machines can be deployed and communicate securely within the broader network.

After setting up the subnet, a Network Security Group (NSG) can be linked to it to enforce security rules. Acting as a virtual firewall, an NSG regulates both inbound and outbound traffic based on parameters such as IP addresses, ports, and protocols. When associated with a subnet, these rules are automatically applied to all resources within it, ensuring consistent protection, restricting unauthorized access, and maintaining controlled communication across the environment.

Top comments (0)