简体   繁体   English

如何在 azure 中创建和应用标记策略

[英]How to Create and Apply a Tagging Policy in azure

I want to create a policy that ensures all indexed resources are tagged.我想创建一个确保所有索引资源都被标记的策略。 This will help us with organization and tracking, and make it easier to log when things go wrong.这将有助于我们进行组织和跟踪,并在 go 发生错误时更容易记录。

In detail, how do you create a policy that ensures all indexed resources in your subscription have tags and deny deployment if they do not.具体来说,如何创建一个策略来确保订阅中的所有索引资源都有标签,如果没有标签,则拒绝部署。 I'd love to possibly do this from the CLI.我很想从 CLI 中做到这一点。

Any help, please任何帮助,请

I am not sure what you mean exactly by "all indexed" resources.我不确定“所有索引”资源的确切含义。 There are canned policies for tags here . 这里有标签的固定策略。 The first several policies 'modify' resources or resource groups to add tags to existing, the last few policies will deny the creation of a resource or RG if a tag is not present.前几个策略“修改”资源或资源组以将标签添加到现有的,如果标签不存在,最后几个策略将拒绝创建资源或 RG。 The links will take you directly to the policies in the Azure Portal.这些链接会将您直接带到 Azure 门户中的政策。

https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/tag-policies https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/tag-policies

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM