In this Azure article, we will discuss the syntax and the usage of the New-AzTag PowerShell command that can help you to add tags to existing Azure resources with a few examples of how to use this command.
Table of Contents
New-AzTag
New-AzTag is a very good PowerShell command that can help you quickly create a predefined Azure tag.
Syntax of New-AzTag
Below is the Syntax of the New-AzTag PowerShell command.
New-AzTag
[-Name] <String>New-AzTag
[-ResourceId] <String>Examples
Let’s discuss a few examples of how to use the New-AzTag PowerShell command.
Example-1
You can execute the below PowerShell command with a specified name.
New-AzTag -Name "ALessons"After executing the above command, the tag named “ALessons” was created successfully. I got the below output.
PS C:\windows\system32> New-AzTag -Name "ALessons"
Name ValuesTable Count Values
---- ----------- ----- ------
ALessons 0 {} You can see the same output here as below

Example-2
You can execute the below PowerShell command to create a predefined Azure tag with a specified value.
New-AzTag -Name "Emp" -Value "info"After executing the above PowerShell command, I got the below-expected output.
PS C:\windows\system32> New-AzTag -Name "Emp" -Value "info"
Name ValuesTable Count Values
---- ----------- ----- ------
Emp ... 0 {info}
Check out the same output as below

Check out: Update-AzTag
Conclusion
In this Azure PowerShell article, we discussed the syntax and usage of the New-AzTag PowerShell command and certain examples of how to use this command. Thanks for reading this article !!!

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
