A tool to easily manage resource tags in Azure.
Tagging Azure resources is a good way to understand how they are used, and who is responsible for them. My Azure environment didn't use tags, so I developed this script to assign them.
The workflow I use with this script allows anyone to have input into the process without needing access to Azure, or even PowerShell.
-
Login to Azure PowerShell. I use LoginAzure.ps1 to make this easier.
-
Get a CSV of all resources and their tags:
Get-AzureRMResourceTag | Export-CSV -NoTypeInformation tags.csv
-
Share the CSV with your team using Office 365, network share or whatever.
-
Open the CSV with Excel and fill in the tags you want to set.
- You can add extra tags by adding a column. Make sure you prepend the tag prefix (
TAG_
by default) to the tag name in the column heading.
- You can add extra tags by adding a column. Make sure you prepend the tag prefix (
-
Import the CSV and set tags on resources:
Import-CSV tags.csv | Set-AzureRMResourceTag