【问题标题】:Built-In Azure policy definition [closed]内置 Azure 策略定义 [关闭]
【发布时间】:2020-06-02 15:12:33
【问题描述】:

曾经有一个名为“需要指定标记”的内置 Azure 策略定义不再存在。是否有理由将其删除而没有更换?有人有这个旧策略定义的 JSON 代码吗?

非常感谢。

【问题讨论】:

    标签: json azure azure-policy


    【解决方案1】:

    您是否在寻找此政策:

    {
      "properties": {
        "displayName": "Require a tag on resources",
        "policyType": "BuiltIn",
        "mode": "Indexed",
        "description": "Enforces existence of a tag. Does not apply to resource groups.",
        "metadata": {
          "version": "1.0.1",
          "category": "Tags"
        },
        "parameters": {
          "tagName": {
            "type": "String",
            "metadata": {
              "displayName": "Tag Name",
              "description": "Name of the tag, such as 'environment'"
            }
          }
        },
        "policyRule": {
          "if": {
            "field": "[concat('tags[', parameters('tagName'), ']')]",
            "exists": "false"
          },
          "then": {
            "effect": "deny"
          }
        }
      },
      "id": "/providers/Microsoft.Authorization/policyDefinitions/871b6d14-10aa-478d-b590-94f262ecfa99",
      "type": "Microsoft.Authorization/policyDefinitions",
      "name": "871b6d14-10aa-478d-b590-94f262ecfa99"
    }
    

    这些策略作为“需要标签”的内置策略存在。

    【讨论】:

    • 是的!这最终取代了已弃用的“需要特定标签”策略定义。谢谢。
    • 如果您觉得有用,请接受答案。谢谢!
    • 我没有看到那个选项。
    • 点击答案左侧的勾号按钮。点击接受。
    猜你喜欢
    • 2022-01-09
    • 1970-01-01
    • 1970-01-01
    • 2021-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-16
    相关资源
    最近更新 更多