使用多个策略拒绝操作为单个资源组启用多个标记

Enabling Multiple tagging to single Resource group with multiple policy Deny Action

定义 1:

"if": {
      "not": {
        "field": "tags['Project Identifier']",
        "match": "..."
      }

定义 2:

"if": {
      "not": {
        "field": "tags['Date']",
        "match": "##-##-####"
      }

这两个定义的效果都是拒绝,我无法将这两个策略应用到一个资源组

我认为您可以将它们合并到一个策略文件中,如下所示:

"if": {
    "AnyOf": [
        your_rule_1,
        your_rule_2
    ]
}

这将拒绝资源,除非两个规则都不匹配

参考:https://docs.microsoft.com/en-us/azure/governance/policy/concepts/definition-structure#logical-operators