how do I change name of a tag

Fredrik Johansson 21 Reputation points
2023-09-26T08:40:53.75+00:00

I need help in how to change name on a tag applied to many resources. Just need to change the actual name of the tag and so it is updated on all resources and no other tags are deleted. The value will be the same so just look to in a quick way change the tagname. We named a tag region but need to change it to country for example.

Thank you in advance

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
3,612 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SwathiDhanwada-MSFT 18,996 Reputation points Moderator
    2023-09-26T09:17:23.1533333+00:00

    Fredrik Johansson Welcome to Microsoft Q & A Community Forum. You can selectively update the set of tags on a subscription or resource with "Replace" Operation. Below is sample command for your reference.

    $replacedTags = @{"key1"="value1"; "key3"="value3";}
    Update-AzTag -ResourceId /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -Tag $replacedTags -Operation Replace
    
    Id         : {Id}
    Name       : {Name}
    Type       : {Type}
    Properties :
                 Name     Value
                 =======  =========
                 key1     value1
                 key3     value3
    

    For more information, refer this document : https://learn.microsoft.com/en-us/powershell/module/az.resources/update-aztag?view=azps-10.3.0


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.