DUMB DEV Community

Cover image for Manage tags and locks
okunola babatunde
okunola babatunde

Posted on

Manage tags and locks

Cloud environments can scale rapidly, making proper organization and protection essential. After completing tasks such as creating a subnet, updating a virtual machine, and working with an Azure storage account, the next step was to improve governance by implementing tags and resource locks.

Tags allow administrators to attach key-value metadata to resources, making it easier to categorize, track, and manage them across the environment. Resource locks, on the other hand, help prevent accidental deletion or modification of critical resources, adding an extra layer of protection.

During this exercise, I revisited the previously created resources and applied appropriate tags, locks, or both to strengthen management and oversight.
A simple guide to implement, how locks and tags are set, is stated bellow.

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. 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.
  5. From the menu pane, select Tags.
  6. On one line for Name enter Department and for Value enter Customer Service
  7. On the next line, for Name enter Purpose and for Value enter FTP Server.
  8. Select 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 VM
  9. If necessary, expand the Settings submenu.
  10. Select Locks.
  11. Select + Add.
  12. For the name, enter VM-delete-lock.
  13. For the Lock type, select Delete.  You may enter a note to help remind you why you created the lock.
  14. Select OK.  That’s it. Now the VM is protected from deletion and has tags assigned to help track use. Time to move onto the network. Select Home to return to the Azure portal home page.  ## Add tags to network resources
  15. From the Azure portal home page, in the search box, enter virtual networks.
  16. Select virtual networks under services.
  17. Select the guided-project-vnet network.
  18. From the menu pane, select Tags.  ## Note: 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.
  19. For the Name select Department.
  20. For the Value enter IT.
  21. Select Apply.  Now both the VNet and VM have are organised.

Conclusion

Using tags and resource locks is a simple but powerful way to maintain organization, visibility, and security in Azure environments as they continue to grow.

Top comments (1)

Collapse
 
realcloudprojects profile image
SKILL.SCH

Welldone