We can also use Azure CLI to create or apply Azure tags. Let’s discuss how to use the az resource tag Azure CLI command.
Table of Contents
az resource tag
This Azure CLI command can help you tag a resource in Azure.
Syntax of az resource tag
az resource tag --tags
[--ids]
[--name]
[--resource-group]
[--resource-type]Az resource tag Examples
Example-1
You can use the below script to add virtual machine with the key ‘vmlist’ and value ‘vm1’.
az resource tag --tags vmlist=newvms -g MYVMrsg -n TSINFOVM --resource-type "Microsoft.Compute/virtualMachines"After executing the above command, I got the expected output, as shown in the screenshot below.

Example-2:
Use the below Azure CLI scripts to overwrite the tags on a resource
az resource tag --tags 'TSinfo=HR' 'Technology=Android' -g newresgroup -n DemoStorage --resource-type "Microsoft.Storage/storageAccounts"You may also like following the articles below
Conclusion
This article discussed how to use the az resource tag Azure CLI command.

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.
