Skip to main content

Command Palette

Search for a command to run...

T is for Tags

An introduction to Tagging in Azure Cloud

Updated
5 min readView as Markdown
T is for Tags
D
I've been an IT professional for around a decade. I started my career working in and around on-prem infrastructure straight after university before making the swap to cloud full time in early 2021. Since then I've picked up my Azure Solutions Architect Expert Certification and now I'm looking to share my experience and knowledge with the wider community.

Introduction

In our previous entry covering Resource Groups, you might recall that we skipped right past the 'Tags' menu during our deployment. I promised we would cover them in a future post, noting that they give you even more granular control over your deployments. Well, the time has come to make good on that promise.If Subscriptions and Resource Groups are the physical containers defining the boundaries of your cloud environment, Tags are the labels on the outside of those boxes that tell you exactly what is inside, who owns it, and how important it is.

What are Azure Tags?

At their core, Azure Tags are simple metadata elements consisting of a Key and a Value pair.

Think of it like filing a document. The 'Key' is the category (e.g., Department), and the 'Value' is the specific detail (e.g., Finance). You apply these key-value pairs directly to your Azure resources, resource groups, or even entire subscriptions.

While clicking around the Azure Portal and adding tags manually is fine for a single sandbox environment, in an enterprise scenario, this metadata becomes the lifeblood of your cloud management strategy. When adopting the Microsoft Cloud Adoption Framework (CAF), a robust tagging strategy is mandatory for proper governance and resource organisation.

Aligning Tags with the Well-Architected Framework (WAF)

To truly understand the power of tags, we need to look beyond simply labelling things and see how they drive enterprise-grade automation and AI integration. Here is how a solid tagging strategy directly supports the five pillars of the Microsoft Well-Architected Framework:

  • Cost Optimisation: This is often the primary driver for tagging. By tagging resources with keys like CostCentre, ProjectCode, or Environment, you can filter your Azure billing reports to see exactly how much your testing environment is costing compared to production. It allows finance teams to automate cross-charging across the business without having to decipher cryptic resource names.

  • Operational Excellence: This is where tags shine for automation. When building CI/CD pipelines, your DevOps tools can query tags to perform automated tasks. For instance, an automated script can look for all virtual machines tagged Environment: Dev and shut them down at 7:00 PM every evening to save money, automatically starting them again at 8:00 AM.

  • Security: Tags are vital for data classification and governance. By applying a tag like DataClassification: Confidential, you can use Azure Policy to automatically enforce stricter security controls, ensuring that highly sensitive resources cannot be accidentally exposed to the public internet.

  • Reliability: In a disaster recovery scenario, you need to know what to restore first. Tagging resources with Criticality: Tier1 or Criticality: Tier3 allows your automated recovery runbooks to prioritise mission-critical workloads over lower-priority internal tools, ensuring your business gets back online efficiently.

  • Performance Efficiency: Tags help in grouping resources to monitor performance telemetry. By tagging a web app, its backend database, and its storage account with an identical ApplicationName: CustomerPortal tag, you can aggregate Azure Monitor metrics across all related components to identify performance bottlenecks holistically.

Real-World Example

Let's stick with the retail store example we used when discussing Resource Groups.

Imagine your retail company has expanded massively. You now have hundreds of microservices, databases, and AI-driven inventory prediction tools scattered across your cloud environment.

If an engineer needs to update the stock-taking application, they don't want to accidentally apply an automated patch to the live checkout system. By enforcing a tagging policy, every resource tied to the stock system might carry the tags:

Now, when your automated deployment pipelines run, they specifically target resources matching those exact metadata criteria, entirely mitigating the risk of human error.

Creating/ Deploying Tags

How to Enforce a Tagging Strategy

As your cloud footprint grows, relying on engineers to manually remember to add tags will inevitably lead to mistakes.

The enterprise standard is to enforce your tagging strategy using Azure Policy. You can configure a policy that dictates, for example, "No resource can be created in this subscription unless it has a 'CostCentre' tag." If an engineer attempts to deploy a resource via the portal, Bicep, or Terraform without that tag, the deployment will automatically fail, returning an error explaining the missing requirement.

Furthermore, you can set up policies that automatically inherit tags. If you tag a Resource Group with Department: Marketing, any new storage account or virtual machine deployed into that group can automatically inherit that tag, ensuring compliance with zero extra effort from your engineers.

Closing Thoughts

While they might seem like a minor administrative detail during a deployment, Tags are the foundation of mature cloud governance. They transform a chaotic list of servers and databases into a highly structured, automated, and trackable enterprise environment.

Take the time to define your tagging strategy early. A well-planned taxonomy will save you endless headaches when you start scaling your automation, auditing your security, or trying to explain your monthly Azure bill to the finance department!

4 views

The A-Z Guide

Part 1 of 4

The core blog series that covers the 'A-Z 'of Microsoft Azure, this series is aimed primarily for new users of the Azure platform to help understand the different services Azure has to offer while providing some context and examples on use cases in a real-world scenario.

Up next

A is for Artificial Intelligence (AI)

A Beginners guide to Azure Artificial Intelligence (AI)

More from this blog

A

atozazure

7 posts

Welcome! I’m Daniel, and this blog is a dedicated space for me to share personal insights, technical knowledge, and practical experience centred on Microsoft Azure. Beyond Azure, I explore the broader Microsoft cloud ecosystem and its various services. My goal is to provide valuable perspectives that inspire and inform, whether you are a seasoned industry veteran or just beginning your journey in the cloud space.