DEV Community

Cover image for How to manage tags and locks in Azure.
UMEOHIA NNAMDI
UMEOHIA NNAMDI

Posted on

How to manage tags and locks in Azure.

As more companies use Microsoft Azure for their cloud needs, it's important to manage resources in a way that keeps things secure, cost-effective, and easy to run. Two helpful tools for this are tags and locks.
Tags help you label and group resources so they’re easier to track, organize, and manage.
Locks protect important resources from being accidentally changed or deleted.
Knowing how to use tags and locks the right way can make a big difference in how you manage your Azure environment.
In this article, we’ll look at simple and effective ways to use these tools to keep your Azure resources safe and well-organized.

Manage tags and locks on Virtual Machine

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.

1.Login to Microsoft Azure at https://portal.azure.com

2.In the Azure portal, search and select virtual machines.

search and select virtual machines

3.Select the guided-project-vm virtual machine.

guided project vm

4.From the menu, select Tags. 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.

select tags, fill and apply

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

Add a resource lock to a Virtual Machine

1.Expand the Settings submenu. Select** Locks**.

settings, lock

2.Select + Add.

select + add

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

Lock name, type and note

4.Select OK.

ok

lock created

That’s it. Now the VM is protected from deletion and has tags assigned to help track use.

Add tags to network resources

1.In the Azure portal, search and select virtual networks.

search and select VN

2.Select the guided-project-vnet network.

guided project vn

3.From the menu, select Tags.

select vn

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

Tag and apply

Now both the Virtual Network and Virtual Machine are organized.

Top comments (0)