Skip to main content

Azure Tag

An Azure tag is a name and value pair attached to a resource, resource group, or subscription for organisation and reporting. Tags do not change how a resource runs.

Azure Tag

Tags such as environment=production or costCenter=payments let teams filter cost reports, target automation, and scope Azure Policy rules. A resource can carry up to 50 tag pairs. Tag names are case-insensitive for operations, while tag values are case-sensitive, so Prod and prod are different values.

Are Tags Inherited From Resource Groups?

No. Tags on a resource group or subscription are not inherited by resources inside them. To copy a tag down, use an Azure Policy with the Modify effect, such as the built-in "Inherit a tag from the resource group".

How Do You Apply Tags?

Bash
az resource tag --tags costCenter=orders environment=prod owner=rahul@devops.in \
--ids /subscriptions/<sub-id>/resourceGroups/mumbai-orders-prod-rg
# Find everything tagged for one team
az resource list --tag costCenter=orders --output table

Why It Matters in Production

A platform team at a company like Swiggy can tag every resource with costCenter, environment, and owner, so finance builds a per-team spend report in Cost Management without a separate subscription per team.

Common Mistake

Treating tags as a security boundary. Tags are plain metadata and grant no access control, although RBAC conditions can reference them in some scenarios.

Tip

Enforce a tag taxonomy with Azure Policy (Deny or Append on required tag names) when the subscription is created, instead of cleaning up inconsistent tags after hundreds of resources exist.

Frequently Asked Questions

Do tags affect cost?

Tags themselves are free, but they let you group and filter costs in Cost Management. Only resources that carry the tag appear in a tag-based view.

Why do my cost reports miss some resources?

Usually inconsistent value spelling or tags that were never applied, since resource group tags do not flow down on their own. Use a policy to inherit or require them.

Can I tag every resource type?

Most resource types support tags, but a few do not, and tag values are also visible in billing data, so avoid putting secrets in them.

Found a mistake, an outdated step or a broken link?