DEV Community

Samuel Ojo
Samuel Ojo

Posted on

Update and maintain azure resources

Lab overview
In this guided lab, you perform a series of tasks and actions to manage Microsoft Azure resources. You have the opportunity to modify a network, move a virtual machine between subnets, manage access to storage containers and file shares, and work with resource locks and resource tags.

During the setup, you create a virtual network, a virtual machine, a storage account, and associated resources.

Learning objectives
In this module, you'll practice how to:

  • Update a virtual network and subnet.
  • Manage virtual machines.
  • Control storage access.
  • Manage resource tags and locks.
  • Clean up

First, we prepare the environment:

Login to Microsoft Azure

Login to Microsoft Azure

Create a resource group
In order to make clean-up easy at the end, start with creating a new resource group to hold the resources for this guided project.
Using resource groups to organize things is a quick way to ensure you can manage resources when a project is over.

1.From the Azure portal home page, in the search box, enter resource groups.
2.Select Resource groups under services.

Search Resource groups

3.Select Create

Select Create resource

4.Enter guided-project-rg in the Resource group name field.
5.The Region field will automatically populate. Leave the default value.

Resource group name

6.Select Review + create.
7.Select Create.

Create resource group

8.Return to the home page of the Azure portal by selecting Home.

Select Home

Create a virtual network with one subnet
1.From the Azure portal home page, in the search box, enter virtual networks.
2.Select virtual networks under services.

Search virtual networks

3.Select Create.

4.Scroll down to the Instance details section and enter guided-project-vnet for the Virtual network name.

5.Select Review + create.

Review + create

6.Select Create.
7.Wait for the screen to refresh and show Your deployment is complete.

Your deployment is complete

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

Create a virtual machine
1.From the Azure portal home page, in the search box, enter virtual machines.
2.Select virtual machines under services.

Select virtual machines

3.Select Create and then select Virtual machine.

Create and then select Virtual machine

4.Select guided-project-rg for the Resource group.
5.Enter guided-project-vm for the Virtual machine name.
6.For the Image, select one of the Ubuntu Server options. (For example, Ubuntu Server 24.04 LTS - x64 Gen2)
7.Continue further on the Basics page to the Administrator account section.
8.Select Password for authentication type.
9.Enter guided-project-admin for the admin Username.
10.Enter a password for the admin account.
11.Confirm the password for the admin account.
12.Leave the rest of the settings as default settings. You can review the settings if you like, but shouldn’t change any.

  1. Select Review + create. 14.Select Create to confirm the resource cost and create the virtual machine. 15.Select Home to return to the Azure portal home page.

Create a Storage account

  1. From the Azure portal home page, in the search box, enter storage accounts. 2.Select Storage accounts under services.

Select Storage accounts

3.Select Create.
4.Scroll down to the Instance details section and enter a name for the storage account. Storage accounts must be globally unique, so you may have to try a few different times to get a storage account name.
5.Select Review + create.

Select Review + create

6.Select Create.
7.Wait for the screen to refresh and show Your deployment is complete.
8.Select Home to return to the Azure portal home page.

Exercise – Update the virtual network
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.

Create a new subnet on an existing virtual network (vNet)
1.Login to Microsoft Azure at https://portal.azure.com
2.From the Azure portal home page, in the search box, enter virtual networks.
3.Select virtual networks under services.
4.Select the guided-project-vnet virtual network.

guided-project-vnet

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

Under settings select Subnets

6.To add a subnet, select + Subnet.

7.For Subnet purpose leave it as Default.
8.For Name enter: `ftpSubnet`.
9.Leave the rest of the settings alone and select Add.

Enter Subnet name as ftpSubnet

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

Create a network security group
1.From the Azure portal home page, in the search box, enter virtual networks.
2.Select virtual networks under services.
3.Select Network security groups.

Network security groups

4.Select + Create.

Select Create Network security groups

5.Verify the subscription is correct.
6.Select the guided-project-rg resource group.
7.Enter ftpNSG for the network security group name.
8.Select Review + create.

1.Once the validation is complete, select Create.
2.Wait for the screen to refresh and display Your deployment is complete.
3.Select Go to resource.

Go to resource

Create an inbound security rule
1.Under settings, select Inbound security rules.
2.Select + Add.
3.Change the Destination port ranges from 8080 to 22.
4.Select TCP for the protocol.
5.Set the name to ftpInbound.
6.Select Add.
7.Select Home to return to the Azure portal home page.

Move the virtual machine network to the new subnet
1.Login to Microsoft Azure at https://portal.azure.com
2.From the Azure portal home page, in the search box, enter virtual machines.
3.Select virtual machines under services.
4.Select the guided-project-vm virtual machine.

Select the guided-project-vm

5.If the virtual machine is running, select Stop.
6.Wait for the Status field to update and show Stopped (deallocated).
7.Within the Networking subsection of the menu, select Network settings.
8.Select the Network interface / IP configuration hyperlink for the VM.

Select the Network interface/IP configuration

9.On the IP Configurations page, update the Subnet to ftpSubnet.
10.Select Apply.

Apply ftpSubnet

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

Vertically scale the virtual machine
1.From the Azure portal home page, in the search box, enter virtual machines.
2.Select virtual machines under services.
3.Select the guided-project-vm virtual machine.
4.Locate the Availability + scale submenu and select Size.

Top comments (0)