DEV Community

Cover image for Managing Tags and Locks
lotanna obianefo
lotanna obianefo

Posted on

Managing Tags and Locks

Manage tags and locks on VMs

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.

Add tags to a virtual machine
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.

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 project-vm virtual machine.
From the menu pane, select Tags.
ytftrdw
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.
gyf65r5fd

While you’re working on the virtual machine, it’s a great time to add a resource lock.

Add a resource lock to a VM

If necessary, expand the Settings submenu.
Select Locks.
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.
ytffdrf
jugytjnj
That’s it. Now the VM is protected from deletion and has tags assigned to help track use. Time to move onto the network.

Add tags to network resources

From the Azure portal home page, in the search box, enter virtual networks.
Select virtual networks under services.
Select the project-vnet network.
From the menu pane, select Tags.

Notice that now you can select an existing tag to apply or add a new tag. You can also select just the name or value and apply create something new in the other field.

For the Name select Department.
For the Value enter IT.
Select Apply.
NHJBGFR
Now both the VNet and VM are organized.

In the cloud, visibility and control are essential. Azure Tags help you understand and manage your environment better, while Locks ensure critical resources are not mistakenly altered or removed. When used together with good governance practices, they become key tools for cost optimization, security, and compliance.

Top comments (0)