# How to Make Tags Show Up in Cost Data on AWS, GCP and Azure

> Tags on resources do not reach billing data by default everywhere. Activate AWS cost allocation tags, query GCP labels, and enable Azure tag inheritance.

Source: https://zop.dev/learn/how-to/configure-tag-based-cost-attribution
Published: 2026-07-01 · Updated: 2026-09-24 · Author: avinash-gaurav · Tags: zopnight, how-to, learn

---

Putting a tag on a resource is step one. Each cloud has a second step before that tag can split a bill, and they are all different.

A tag that exists on a resource but not in billing data is invisible to anyone slicing cost. AWS needs the tag key activated, Google Cloud carries labels into its billing export but you have to query them, and Azure only copies resource group and subscription tags down to usage if you ask it to. Here is the second step on each.

## AWS: activate cost allocation tags

Only the management account of an organization (or a standalone account) can manage cost allocation tags.

1. Find candidate keys. Newly applied tags can take up to 24 hours to appear.

```bash
aws ce list-cost-allocation-tags --status Inactive --type UserDefined
```

2. Activate the keys you want in cost data, up to 20 per call:

```bash
aws ce update-cost-allocation-tags-status --cost-allocation-tags-status \
  TagKey=team,Status=Active TagKey=environment,Status=Active
```

Activation itself can take up to another 24 hours. The console equivalent is **Billing and Cost Management › Cost allocation tags › Activate**.

3. Backfill, because activation is otherwise forward-looking. A management account can backfill activation status for up to twelve months, once every 24 hours; the start must be the first day of a month:

```bash
aws ce start-cost-allocation-tag-backfill --backfill-from 2025-10-01T00:00:00Z
```

Backfill cannot invent history: months before the tag was on the resource still have no value for it.

4. Verify with `aws ce list-cost-allocation-tags --status Active`, then group by the tag in Cost Explorer.

## Google Cloud: query labels in the billing export

Resource labels flow into the Cloud Billing export to BigQuery as a repeated `labels` field. Labels must be lowercase letters, digits, underscores and dashes, keys start with a letter, and each resource can hold up to 64. To add one to a VM:

```bash
gcloud compute instances add-labels web-1 --zone=us-central1-a --labels=team=checkout
```

To split cost by a key without silently dropping unlabeled spend, join on the key rather than filtering with `WHERE`, as Google's own example does:

```sql
SELECT labels.value AS team, SUM(cost) AS cost
FROM `billing-project.billing_dataset.gcp_billing_export_v1_XXXXXX_XXXXXX_XXXXXX`
LEFT JOIN UNNEST(labels) AS labels ON labels.key = "team"
GROUP BY team;
```

The `null` row is your untagged spend. Do not sum rows across different keys: Google warns that combining key/value groupings double counts.

## Azure: enable tag inheritance

Azure resources carry their own tags into usage, but tags set on a resource group or subscription do not reach the resources' usage records unless tag inheritance is on. It is available for EA, MCA and MPA (Azure plan) billing accounts and needs Cost Management Contributor to change on a subscription.

1. Open **Cost Management** (not Cost Management + Billing) and select the scope.
2. Under **Settings**, select **Configuration**, then **Tag inheritance › Edit**.
3. Select **Automatically apply subscription and resource group tags to new data**.

Inherited tags are written onto usage records, not the resources. To tag a resource group itself:

```bash
az tag update --resource-id /subscriptions/SUB_ID/resourceGroups/checkout-rg \
  --operation Merge --tags team=checkout
```

## Check the result the same way everywhere

Pick one tag key, one month, and compare the untagged share before and after. If it does not drop, the tag is not on the resources that bill (volumes, snapshots and load balancers are frequent gaps). Naming the keys consistently is covered in <a href="https://zop.dev/learn/cloud-tagging-best-practices">tagging strategy</a>.

## Tag attribution in ZopNight

ZopNight reads AWS tags, GCP labels and Azure tags directly from the resources, plus accepted smart tags, and attributes cost on the Reports page's Tags tab. Each key and value pair receives the full cost of every resource that carries it (there is no splitting), each row shows whether the tag came from the cloud or a smart tag, and the dashboard's Tag Coverage widget shows tagged against untagged spend. Filling gaps without retagging by hand is covered in <a href="https://zop.dev/learn/how-to/configure-auto-tagging-rules">smart tags policies</a>.
