DEV Community

Cover image for Guided Project – Update and maintain resources.
daniel shaibu
daniel shaibu

Posted on

Guided Project – Update and maintain resources.

The scenario for the project focuses on managing Microsoft Azure resources. You should already be familiar with tasks such as creating a virtual machine or virtual network. The Prepare exercise creates a basic set of Azure resources. The resources from the prepared exercise are used in the rest of the scenario.

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

Introduction; This guided project consists of the following exercises:
i. Update the virtual network
ii. Manage virtual machines
iii. Control storage access
iv. Manage tags and locks
v. Clean up

**

prepared exercise

**

  1. Create a resource group
  • From the Azure portal home page, in the search box, enter resource groups.
  • Select Resource groups under services.

  • Select Create

  • Enter guided-project-rg in the Resource group name field.

  • The Region field will automatically populate. Leave the default value.

  • Select Review + create.

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

  1. Create a virtual network with one subnet
  2. From the Azure portal home page, in the search box, enter virtual networks.
  3. Select virtual networks under services.
  4. Select Create
  5. Scroll down to the Instance details section and enter guided-project-vnet for the Virtual network name.
  6. Select Review + create.
  7. Select Create.
  8. Wait for the screen to refresh and show Your deployment is complete.
  9. Select Home to return to the Azure portal home page.

  10. Create a virtual machine

  11. From the Azure portal home page, in the search box, enter virtual machines.

  12. Select virtual machines under services.

  13. Select Create and then select Virtual machine

  14. Select guided-project-rg for the Resource group.

  15. Enter guided-project-vm for the Virtual machine name.

  16. For the Image, select one of the Ubuntu Server options. (For example, Ubuntu Server 24.04 LTS - x64 Gen2)

  17. Continue further on the Basics page to the Administrator account section.

  18. Select Password for authentication type.

  19. Enter guided-project-admin for the admin Username.

  20. Enter a password for the admin account.

  21. Confirm the password for the admin account.

  22. Leave the rest of the settings as default settings.

  23. You can review the settings if you like, but shouldn’t change any.

  24. Select Review + create.

  25. Select Create to confirm the resource cost and create the virtual machine.

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

  27. Create a Storage account

  28. From the Azure portal home page, in the search box, enter storage accounts.

  29. Select Storage accounts under services.

  30. Select Create

  31. 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.

  32. Select Review + create.

  33. Select Create.

  34. Wait for the screen to refresh and show Your deployment is complete.

  35. Select Home to return to the Azure portal home page.
    Congratulations! You’ve completed the Prepare exercise. Return to Microsoft Learn to continue the guided project.

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.

  1. Create a new subnet on an existing virtual network (vNet)
  • Login to Microsoft Azure at https://portal.azure.com
  • From the Azure portal home page, in the search box, enter virtual networks.
  • Select virtual networks under services.
  • Select the guided-project-vnet virtual network.
  • From the guided-project-vnet blade, under settings, select Subnets.
  • To add a subnet, select + Subnet.
  • For Subnet purpose leave it as Default.
  • For Name enter: ftpSubnet.
  • Leave the rest of the settings alone and select Add.
  • Select Home to return to the Azure portal home page. Congratulations – we’ve completed the creation of a subnet. This subnet is only going to be used for SFTP traffic. To increase security, you need to configure a Network security group to restrict which ports are allowed on the subnet.
  1. Create a network security group
  2. From the Azure portal home page, in the search box, enter virtual networks.
  3. Select virtual networks under services.
  4. Select Network security groups.
  5. Select + Create.
  6. Verify the subscription is correct.
  7. Select the guided-project-rg resource group.
  8. Enter ftpNSG for the network security group name.
  9. Select Review + create.
  10. Once the validation is complete, select Create.
  11. Wait for the screen to refresh and display Your deployment is complete.
  12. Select Go to resource.

Create an inbound security rule

  • Under settings, select Inbound security rules.
  • Select + Add.
  • Change the Destination port ranges from 8080 to 22.
  • Select TCP for the protocol.
  • Set the name to ftpInbound.
  • Select Add.

  • Select Home to return to the Azure portal home page.
    Congratulations – you’ve created a new Network security group and configured rules to allow inbound FTP traffic. Now, you’ll need to associate the new network security group with the ftpSubnet.

Associate a network security group to a subnet

  • From the Azure portal home page, in the search box, enter virtual networks.
  • Select virtual networks under services.
  • Select the guided-project-vnet virtual network.
  • Under settings, select Subnets.
  • Select the ftpSubnet you created.
  • On the Edit subnet page, under the Security section heading, update the Network security group field to ftpNSG.
  • Select Save  It looks like we’ve completed the work needed to prepare the network for shifting the current Linux VM to a new subnet that’s designed to handle incoming FTP traffic.

Exercise – Manage virtual machines

In this exercise, you’ll manage the virtual machine. You’ll change the virtual machine's assigned subnet, vertically scale the virtual machine, add storage, and finally add an automatic shutdown.

  1. Move the virtual machine network to the new subnet
  • Login to Microsoft Azure at https://portal.azure.com
  • From the Azure portal home page, in the search box, enter virtual machines.
  • Select virtual machines under services.
  • Select the guided-project-vm virtual machine.
  • If the virtual machine is running, select Stop
  • Wait for the Status field to update and show Stopped (deallocated).
  • Within the Networking subsection of the menu, select Network settings.
  • Select the Network interface / IP configuration hyperlink for the VM.
  • On the IP Configurations page, update the Subnet to ftpSubnet.
  • Select Apply.
  1. ## Vertically scale the virtual machine
  • From the Azure portal home page, in the search box, enter virtual machines.
  • Select virtual machines under services.
  • Select the guided-project-vm virtual machine.
  • Locate the Availability + scale submenu and select Size.
  • Select a new VM size D2s_v5 for example. (Note: If you don’t see the same size as shown in this exercise, select something similar.)
  • Select Resize
  • Select Home to return to the Azure portal home page. Well done. With the VM scaled up to a more robust processor, it can handle the new role it’s being assigned.

However, now the Azure admin realizes that if the VM is going to server as an FTP server, it needs more storage. The Azure admin asked you to attach a new data disk to the VM.

  1. Attach data disks to a virtual machine
  • From the Azure portal home page, in the search box, enter virtual machines.
  • Select virtual machines under services.
  • Select the guided-project-vm virtual machine.
  • Locate the settings submenu and select Disks.
  • Select Create and attach a new disk.
  • Leave LUN as default.
  • Enter ftp-data-disk for the Disk name.
  • Leave the Storage type as default.
  • Enter 20 for the Size.
  • Select Apply to create the new storage disk and attach the disk to the machine.
  • Select Home to return to the Azure portal home page.

The final thing the Azure admin is concerned about is the cost of running the computer 24 hours a day. The first thing they’ll do every morning is start up the FTP server. However, they’d like you to configure it to automatically shutdown every day at 7 PM Coordinated Universal Time (UTC).

  1. Configure automatic shutdown on a virtual machine
  • From the Azure portal home page, in the search box, enter virtual machines.
  • Select virtual machines under services.
  • Select the guided-project-vm virtual machine.
  • Under the Operations submenu, select Auto-shutdown.
  • In order to let late uploads finish, set the Scheduled shutdown to 7:15:00 PM.
  • Select Save.

Top comments (0)