Files
code-snippets/docs/azure/identify-untagged-resources.md
Liam Pietralla aafcd9ad72
All checks were successful
Build, Test & Publish / Build (push) Successful in 1m9s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 2m42s
Build, Test & Publish / Deploy to Infrastructure (push) Successful in 41s
azure docs
2026-03-25 08:20:18 +11:00

1.0 KiB

Identify Untagged Resources

Tagging in Azure is essential for managing resouces, billing, ownership and more. As a general rule it's important to ensure that all resources are tagged.

To identify untagged resources we can use the Resource Graph Explorer in Azure. This allows us to query across all our resources and filter for those that do not have tags.

Query for Untagged Resources

  1. Navigate to the Azure Portal and open the Resource Graph Explorer.
  2. Use the following Kusto Query Language (KQL) query to find untagged resources:
resources
| where isnull(tags) or tostring(tags) == '[]'
| project name, type, resourceGroup, location

Recording management

Personally I like to tag all resources with a managed_by tag to indicate who or what is responsible for creating/updating the resource (e.g. manual or terraform or pulumi etc).

To identify resources that are not tagged with managed_by we can use the following query:

resources
| where tags !has 'managed_by'
| project name, type, resourceGroup, location