Consolidating and editing Azure Tags in bulk with no data loss or outage?

EnterpriseArchitect 4,721 Reputation points
2020-10-23T13:01:29.627+00:00

How can I rectify the below Azure Tags that is miss-spelled or has some blank space or typo error?

Is there any script that can Edit and replace all the tag into the correct keyword https://learn.microsoft.com/en-us/powershell/module/az.resources/get-aztag?view=azps-4.8.0

from:

 Name		Count  
 Cost-Center	750  
 Cost-Centre	250  
 Cost Center	250  
 Cost Centre	500  

 

into:

  Name			Count  
  Cost Center	        1750  

 

Preferably in bulk so no need to manually inspect all objects and replacing it manually one by one.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,112 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,436 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. olufemia-MSFT 2,861 Reputation points
    2020-10-27T02:28:42.937+00:00

    Hi @EnterpriseArchitect , you could try wrapping the Update-AzTag in a PS script to do this in bulk.
    If I understand your scenario correctly, consider using Update-AzTag with merge and replace options - examples here for reference.
    Note: I am yet to test this but wanted to at least share the reference. Dont hesitate to ping if you have any followup questions.

    35254-mergereplace.png

    0 comments No comments