gpt4 book ai didi

json - 内置 Azure 策略定义

转载 作者:行者123 更新时间:2023-12-03 02:38:58 27 4
gpt4 key购买 nike

曾经有一个名为“需要指定标签”的内置 Azure 策略定义,但现在已不存在。是否有原因将其删除而没有替换?有人有这个旧策略定义的 JSON 代码吗?

非常感谢。

最佳答案

您是否正在寻找此政策:

{
"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"
}

这些政策作为“需要标签”的内置政策出现。

enter image description here

关于json - 内置 Azure 策略定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62155186/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com