How to Manage tags and locks on VMs in Azure

How to Manage tags and locks on VMs in Azure

posted Originally published at dev.to 2 min read

Adding tags to resources is a quick way to be able to group and organize resources. Tags can be added at different levels, giving you the ability to organize and group resources at a level that makes sense for you.
In this lab exercise, you will learn how to effectively manage Azure resources by implementing tags and resource locks. Tags help organize and categorize resources for better tracking and cost management, while resource locks prevent accidental modifications or deletions of critical assets.

By the end of this exercise, you will have hands-on experience in:

  • Adding and managing tags for resource organization.
  • Applying resource locks to prevent accidental deletions.
  • Enhancing resource governance and monitoring in Azure.
  • Let’s get started by logging into the Azure portal and applying these configurations.

Step 1 Manage tags and locks on VMs.

You’ll start by adding a pair of tags to the virtual machine. One tag will be to identify the purpose of the virtual machine and the other will be to indicate the department the machine supports.

Image description

  • From the Azure portal home page, in the search box, enter virtual machines.
  • Select virtual machines under services.

Image description

  • Select the guided-project-vm virtual machine.

Image description

  • From the menu pane, select Tags.

Image description

  • On one line for Name enter Department and for Value enter Customer Service
  • On the next line, for Name enter Purpose and for Value enter FTP Server.
  • Select Apply.

Image description

Step 2 Add a resource lock to a VM

Resource lock is use to protect the VM is from deletion and has tags assigned to help track use.

  • If necessary, expand the Settings submenu.
  • Select Locks.

Image description

  • Select + Add.
  • For the name, enter VM-delete-lock.
  • For the Lock type, select Delete.
  • You may enter a note to help remind you why you created the lock.
  • Select OK.

Image description

Step 3 Add tags to network resources

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

Image description

  • Select the guided-project-vnet network.

Image description

  • From the menu pane, select Tags.

Image description

  • For the Name select Department.
  • For the Value enter IT.
  • Select Apply.

Image description

Conclusion

In this exercise, you successfully applied tags and resource locks to Azure resources to improve organization and security. By tagging the VM and VNet with relevant metadata (such as Department and Purpose), you enabled easier tracking and management. Additionally, applying a delete lock on the VM ensured that it cannot be accidentally removed, protecting critical infrastructure.

870 Points23 Badges7 16
Lagos, Nigeriadev.to/subair09
5Posts
0Comments
Highly skilled Cloud/DevOps Support Engineer with expertise in designing, implementing, and managing cloud infrastructure on Azure and AWS. Proficient in leveraging various DevOps tools to ensure seamless integration, deployment, and monitoring of applications. Passionate about delivering top-notch support and driving innovation in cloud computing.
Build your own developer journey
Track progress. Share learning. Stay consistent.

1 Comment

0 votes
🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelskiverified - Mar 19

Implementing Cellular Redundancy: Cross-Cloud Failover with AWS Transit Gateway and Azure ExpressRou

Cláudio Raposo - May 5

TypeScript Complexity Has Finally Reached the Point of Total Absurdity

Karol Modelskiverified - Apr 23

Your Tech Stack Isn’t Your Ceiling. Your Story Is

Karol Modelskiverified - Apr 9

3.5 best practices on how to prevent debugging

Codeac.io - Dec 18, 2025
chevron_left

Related Jobs

View all jobs →

Commenters (This Week)

1 comment
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!