Azure tagging strategy, part 1: what to tag, what not, and where tags can live
Tags without a strategy grow wild: inconsistent spellings, no cost attribution and slow incident routing. This is part 1 of 3. It follows one question: which question does a tag answer, and where can it live? It covers Azure's limits, the control plane vs. data plane boundary, what not to tag, and which implementation option fits. Part 2 shows how we generate the tags with Terraform and use them for incident routing. Part 3 covers Databricks, Microsoft Fabric and cost per data product.
- Tag what causes cost or incidents. Azure tags are control-plane metadata on Azure Resource Manager (ARM) resources. Tag data-plane objects such as Key Vault secrets only when a defined process reads that metadata.
- Every tag needs a named reader. A tag that no report, policy or process reads has no value and nobody will maintain it.
- Identity goes in the name, mutable context in tags. Changing a tag is an in-place update; a rename means recreating the resource.
- Let IaC write the tags and Azure Policy audit them. A
Modifypolicy and Terraform overwrite each other's changes.
- Part 1: what to tag, what not, and where tags can live (this post)
- Part 2: from alert to ticket with Terraform and ITSM tags
- Part 3: cost per data product on Databricks and Fabric
The problem
Every Azure estate starts the same way: someone adds env = dev to a storage account, someone else adds Environment = Development to a Key Vault, and a third person adds stage = DEV to a Databricks workspace. Six months later, the cost report has three "environment" columns and none of them adds up.
On a data platform with 30+ data products the problem multiplies:
- Inconsistent spelling.
owner,Owner,product-owner. Tag names are case-insensitive in Azure, but humans, scripts and reports are not. - No cost attribution. The invoice says "Azure Databricks: CHF X". Which product caused it? Nobody knows.
- Slow incidents. An alert fires on
st-xyz-prd-001. Which service is affected? Who is on call? Is it business critical? The on-call engineer starts a chat thread instead of fixing the issue.
Why tag, and when not
Tags answer questions that a resource name can't, or shouldn't:
| Purpose | Question the tag answers | Example tag | In our mandatory set? |
|---|---|---|---|
| Incident management | Which service is affected? Who is responsible? | itsm-level-1, itsm-level-2, itsm-level-3 | Yes, read by the ITSM integration |
| Cost control | Who pays? Which product or cost center? | data-product, cost-center | data-product yes, read by Cost Management and Databricks billing; cost-center no, nothing reads it |
| Lifecycle | Prod or sandbox? How was it created? | env, managed-by | Yes: Cost Management views and budgets split by env (prod vs. non-prod); a scheduled Resource Graph query flags resources without managed-by = terraform |
| Severity / SLA | How fast must we react? | criticality | No, ITSM holds priority per service |
| Confidentiality | How sensitive is the data in this resource? | data-classification | No, no process reads it today |
The table is a menu, not a checklist. A tag becomes mandatory only when a named report, policy or process reads it. criticality or data-classification earn their place the day something consumes them, not before.
Tags are metadata, not access control. A confidential tag protects nothing.
Tags vs. naming: mutable context (owner, cost, ITSM, classification) goes only in tags. Changing a tag is an in-place update; a rename means recreating the resource. Immutable identity (workload, environment, region, resource type) goes in the name. It goes in a tag as well only when a named reader must filter or group by it. Cost Management can't group by a part of a name, and Databricks cluster VMs don't carry your naming convention at all. That's why env is a tag and region isn't. For how tags compare with resource groups, subscriptions and management groups as grouping mechanisms, see Practical guide to organizing Azure resources.
What is possible: limits
| Limit | Value |
|---|---|
| Tag name/value pairs per resource, resource group, subscription | 50 (a few types, such as Automation and DNS zones, only 15) |
| Tag name length | 512 characters (storage accounts: 128) |
| Tag value length | 256 characters |
| Forbidden characters in tag names | < > % & \ ? / |
| Case sensitivity | Names case-insensitive, values case-sensitive |
| Inheritance from resource group or subscription | None by default |
Not every resource type supports tags, and not every tag reaches the cost report. The tag support reference lists both per type. Databricks adds stricter character rules (Part 3).
Control plane vs. Data plane
Azure distinguishes two kinds of operations:
- Control plane: managing resources through ARM (
management.azure.com). Azure resource tags live here and are available to authorized inventory and ITSM integrations; billing support depends on the resource type. - Data plane: working with what is inside a resource: secrets in a Key Vault, blobs in a storage account. Access uses service-specific endpoints and permissions, separate from ARM access.
Key Vault makes the boundary explicit: control-plane read access lets you inspect the vault's properties and ARM tags without granting access to secret values. An ITSM integration can use that metadata to route vault-level incidents; retrieving secret metadata is a separate integration decision, not an automatic consequence of tagging the vault.
| Object | Plane | Azure tags? | Useful for cost / ITSM? | Tag it? |
|---|---|---|---|---|
| Storage account, Key Vault, Event Hubs namespace, Databricks workspace | Control | Yes | Yes, with supported billing and configured incident routing | Yes, the agreed resource tag set |
| Event hub, consumer group | Control (child resource) | No | Only through the parent | No, the parent carries the tags |
| Key Vault secret | Data | Own secret tags (max. 15), not in the cost report | Not a billing dimension; per-secret routing needs explicit integration | Only if a process reads them, e.g. rotation automation |
| Blob, Unity Catalog table, Fabric item | Data / platform | No, own metadata | Requires service-specific metadata integration | Only for a concrete governance or operational use case |
The question for a data-plane object is never "can I tag it?" but "who reads the tag?". Blind tagging creates maintenance work and no value.
What to tag, and what not
Do tag every cost-bearing ARM resource with the tags that pass this filter, and nothing else. For us that is environment, the ITSM hierarchy, the data product and managed-by. managed-by also applies to resources created by IaC such as Terraform: managed-by = terraform tells everyone that portal changes will be overwritten by the next deployment.
- Secrets, keys or connection strings: tags are plain text, readable with Reader rights and copied into cost exports, deployment history and logs.
- Personal names or email addresses: people leave, and it's personal data.
Implementation options
| Option | How | Pros | Cons |
|---|---|---|---|
| Manual (portal, CLI) | People add tags by hand | Zero setup | Drifts within weeks; typos |
| Azure Policy | Built-ins such as Require a tag on resources (deny), Inherit a tag from the resource group if missing and Add or replace a tag on resources (modify + remediation) | Covers everyone, including portal clicks | Modify fights with IaC; limited logic |
| IaC (Terraform) | Tags computed in code and reviewed in PRs | Versioned, testable, consistent | Only covers resources deployed by IaC |
| IaC + Policy (audit) | Terraform sets tags; Policy only audits or denies | Best of both; no drift loop | Two places to maintain |
Why Modify fights with IaC: the policy adds tags outside Terraform, the next plan shows a diff and removes them again. If you need Modify, keep it away from IaC-managed scopes, or add lifecycle { ignore_changes = [tags] } deliberately and document why.
default_tags in azurermUnlike the AWS provider, azurerm has no provider-level default_tags(Open issue). Every resource needs an explicit tags = .... That gap is the main reason to put tag generation into a central module (Part 2).
- Azure Policy (audit)
- Resource Graph query
One definition, a list of required tags per assignment. We assign it twice: the five ITSM and lifecycle tags on the whole platform, plus data-product, assigned at the scope of the product resource groups so that it applies to the resources inside them. Shared platform resources don't carry data-product (Part 2 explains why). Audit by default, switch to Deny per assignment. mode: Indexed only evaluates resource types that support tags and location, so event hubs or consumer groups don't show up as non-compliant. Resource groups aren't evaluated in this mode either. The JSON shows the parts you pass to Terraform or the Azure CLI (mode, parameters and policyRule), not a full exported definition.
{
"mode": "Indexed",
"parameters": {
"tagNames": {
"type": "Array",
"defaultValue": ["env", "itsm-level-1", "itsm-level-2", "itsm-level-3", "managed-by"]
},
"effect": {
"type": "String",
"allowedValues": ["Audit", "Deny", "Disabled"],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"not": {
"count": {
"value": "[parameters('tagNames')]",
"name": "tagName",
"where": { "field": "tags", "containsKey": "[current('tagName')]" }
},
"equals": "[length(parameters('tagNames'))]"
}
},
"then": { "effect": "[parameters('effect')]" }
}
}
Find which mandatory tags are still missing, per tag and resource type:
resources
| extend required = dynamic(['env', 'itsm-level-1', 'itsm-level-2', 'itsm-level-3', 'managed-by'])
| mv-expand tagName = required to typeof(string)
| where isempty(tostring(tags[tagName]))
| summarize missing = count() by tagName, type
| order by missing desc
The scheduled reader of managed-by: everything in the platform subscriptions that Terraform didn't create, i.e. click-ops or drift:
resources
| where tostring(tags['managed-by']) != 'terraform'
| project name, type, resourceGroup, subscriptionId, managedBy = tostring(tags['managed-by'])
How this fits CAF and WAF
- Cloud Adoption Framework: Define your tagging strategy groups tags into functional, classification, accounting, purpose and ownership categories, and recommends starting with a small mandatory set that you enforce.
- Well-Architected Framework, Cost Optimization (CO:03) relies on consistent tags to attribute spend to workloads and owners.
- WAF service guide for Microsoft Fabric recommends tagging standards to make ownership and cost accountability visible.
- Cost Management tag inheritance copies subscription and resource group tags onto usage records for reporting only. It's a safety net, not a replacement for tagging resources.
Next: implementation
Part 2 turns these decisions into code: a Terraform module that generates the tags, and an ITSM service tree that gives them a reader. Continue with part 2.
Further Readings
- Microsoft Cloud Adoption Framework: Define your tagging strategy
- Microsoft Learn: Use tags to organize your Azure resources and management hierarchy
- Microsoft Learn: Tag support for Azure resources
- Microsoft Learn: Control plane and data plane operations
- Microsoft Learn: Azure RBAC for Key Vault data plane operations
- Microsoft Learn: Secure your Azure Key Vault: network security
- Microsoft Learn: About Azure Key Vault secrets
- Microsoft Learn: Assign policy definitions for tag compliance
- Microsoft Learn: Azure Policy definition structure basics (mode)
- Microsoft Learn: Group and allocate costs using tag inheritance
- Well-Architected Framework: CO:03 Recommendations for collecting and reviewing cost data
- Well-Architected Framework: Cost considerations for Microsoft Fabric workloads

