Azure Management Series — Managing Tags & Locks in Azure

Published: (December 10, 2025 at 06:55 AM EST)
2 min read
Source: Dev.to

Source: Dev.to

Introduction

Having completed the previous exercises, you’ve managed to add a subnet to a virtual network, made changes to a virtual machine, and worked with an Azure storage account.

As your Azure environment grows, keeping resources organized and protected becomes essential. Tags help you track metadata such as cost centers, owners, and environments—while locks ensure that important resources cannot be accidentally deleted or modified.

In this post, you’ll learn how to apply tags, manage resource locks, and strengthen governance across your Azure resources, building on the work you completed in the previous exercises.

Step‑By‑Step Guide

Add a Tag to a Resource

  1. Log in to Azure Portal.

  2. Select Virtual machines under Services.

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

  4. From the left menu, select Tags.

  5. Click + Add and add the following tags:

    • Name: Department
      Value: Customer Service

    • Name: Purpose
      Value: FTP Server

    Add tags screenshot

  6. Click Save, then Apply.

Your resource now has metadata attached for easier tracking and reporting.

Create a Resource Lock

  1. In the virtual machine’s settings, expand the Settings submenu.

  2. Select Locks.

  3. Click + Add.

    Locks menu screenshot

  4. Fill in the details:

    • Name: VM-delete-lock
    • Lock type: Delete
    • (Optional) Add a note explaining the purpose of the lock.

    Create lock screenshot

  5. Click OK.

Now the virtual machine cannot be deleted until the lock is removed.

Test the Lock

  1. Open the storage account associated with the VM.
  2. Select Delete.
  3. You’ll receive an error because the resource is locked.
  4. Cancel the operation – the lock works as expected.

The VM is protected from deletion and has tags assigned to help track usage.

Add Tags to Network Resources

  1. Return to the Azure portal home page.

  2. In the search box, type Virtual networks and select it under Services.

  3. Choose the guided-project-vnet network.

  4. From the menu pane, select Tags.

    Note: You can select an existing tag to apply or add a new one. You may also enter just the name or value and create the missing counterpart.

  5. Add the tag:

    • Name: Department
    • Value: IT
  6. Click Apply.

    VNet tags screenshot

Both the VNet and VM are now organized with consistent tagging.

Conclusion

Great work! You’ve improved governance in your Azure environment by using tags for organization and locks for protection. These steps make resource management more scalable and secure—especially in environments with multiple admins or large deployments.

Next up: Cleaning Up Azure Resources Safely and Efficiently.

Back to Blog

Related posts

Read more »

azure deployment - help!

!Forem Logohttps://media2.dev.to/dynamic/image/width=65,height=,fit=scale-down,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%...