如何在 Azure 订阅中显示资源和资源组的缺失标签

huangapple go评论74阅读模式
英文:

How to display missing tags for resources and resource groups in azure subscription

问题

我想知道在Azure资源图探索器中是否有一个简单的查询,可以显示Azure订阅中资源和资源组的缺失标签。

我注意到在我的一些资源和资源组上,标签为Temporary。这是否意味着它们由于策略强制要求标签输入而自动分配了Temporary,而没有设置具体的标签?

谢谢

我尝试运行一些模板Azure资源图探索器脚本,但没有给我想要的结果。

英文:

I wonder if there is a simple query, perhaps that I could run in the Azure Resource Graph Explorer, that shows missing tags for resources and resource groups in an azure subscription.

I notice that on some of my resources and resource groups, the tags=Temporary. Does this mean they get automatically assigned Temporary due to the policy forcing a tag entry, where no specific tag is set?

Thanks

I tried running some template Azure Resource Graph explorer scripts, but none gave me what I wanted.

答案1

得分: 0

如何在Azure订阅中显示资源和资源组的缺失标签。

您可以使用以下查询来显示Azure订阅中资源和资源组的缺失标签。

查询:

Resources
| where subscriptionId == 'xxxx'
| where isnull(tags)
| project name, location, resourceGroup,type

输出:
如何在 Azure 订阅中显示资源和资源组的缺失标签

我注意到在我的一些资源和资源组上,标签为_Temporary_。这是否意味着它们由于策略强制要求输入标签而自动分配了_Temporary_,而没有设置特定的标签?

关于您看到的**tags=Temporary**,可能是某些资源或资源组由于策略或程序的原因,在未提供定义的标签时自动分配了此值作为默认值。

然而,确切的行为可能取决于您的组织的策略和配置。

参考:

标记资源的策略定义 - Azure资源管理器 | Microsoft Learn

英文:

> How to display missing tags for resources and resource groups in Azure subscription.

You can use the below query to display the missing tags for resource and resource groups in the Azure subscription.

Query:

Resources
| where subscriptionId == 'xxxx'
| where isnull(tags)
| project name, location, resourceGroup,type

Output:
如何在 Azure 订阅中显示资源和资源组的缺失标签

> I notice that on some of my resources and resource groups, the tags=Temporary. Does this mean they get automatically assigned Temporary due to the policy forcing a tag entry, where no specific tag is set?

In relation to the tags=Temporary you're seeing, it's possible that certain resources or resource groups have this value assigned as a result of a policy or procedure that automatically assigns default values when no defined tags are provided.

However, the exact behaviour can depend on your organization's policies and configurations.

Reference:

Policy definitions for tagging resources - Azure Resource Manager | Microsoft Learn

huangapple
  • 本文由 发表于 2023年8月8日 20:55:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/76859787.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定