Linux command
az-tag 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Add tags
az tag create --resource-id [resource-id] --tags [env=prod team=dev]
List all tags
az tag list
Show tags
az tag show --resource-id [resource-id]
Update tags
az tag update --resource-id [resource-id] --operation Merge --tags [newkey=newvalue]
Replace all tags
az tag update --resource-id [resource-id] --operation Replace --tags [key=value]
Delete specific tags
az tag update --resource-id [resource-id] --operation Delete --tags [keytoremove]
Delete a tag name
az tag delete --name [tagname]
说明
az tag manages Azure resource tags, which are metadata key-value pairs used for organizing and categorizing resources. Tags help with cost management, automation, and governance. Tags can be applied at subscription, resource group, or individual resource level. Resources do not inherit tags from their parent resource group.
参数
- --resource-id
- The resource ID to apply tags to.
- --tags
- Space-separated tags as key=value pairs.
- --operation
- Operation for update: Merge, Replace, or Delete.
- --name -n
- Tag name for subscription-level operations.
FAQ
What is the az-tag command used for?
az tag manages Azure resource tags, which are metadata key-value pairs used for organizing and categorizing resources. Tags help with cost management, automation, and governance. Tags can be applied at subscription, resource group, or individual resource level. Resources do not inherit tags from their parent resource group.
How do I run a basic az-tag example?
Run `az tag create --resource-id [resource-id] --tags [env=prod team=dev]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --resource-id do in az-tag?
The resource ID to apply tags to.