Change Azure resource tag values
Easily check tag values of Azure resources uses PowerShell
John Savill
January 28, 2017
1 Min Read
Q. How can I easily check the value of a specific tag for an Azure RM resource?
A. Tags are key-value pairs and can be accessed via the key name which means its very easy to view a value for a specific tag, e.g.
$resource.Tags[""]
for example:
$vm.Tags["dept"]
You could also enumerate them all, e.g.
foreach ($tagName in $resource.Tags.Keys)
{
Write-Output "${tagName}, $($resource.Tags[$tagName])"
}
About the Author
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
You May Also Like