【发布时间】:2021-03-25 08:48:55
【问题描述】:
我正在尝试根据 Azure 策略的标记(标记名称为“测试”且标记值为“是”)何时阻止资源创建/迁移到特定区域之外的其他区域。到现在为止我得到了这个,但是当我分配它时,当新资源具有特定标签时,仍然可以在其他位置创建资源。此外,Azure 告诉我 if “需要一个来源并且存在”。有什么想法有什么问题吗?
{
"mode": "Indexed",
"policyRule": {
"if": {
"AllOf": [
{
"field": "tags['test']",
"exists": "true"
},
{
"value": "tags['test']",
"equals": "yes"
},
{
"field": "location",
"notIn": [
"France Central",
"France South",
"North Europe",
"West Europe"
]
}
]
},
"then": {
"effect": "deny"
}
},
"parameters": {}
}
谢谢!
【问题讨论】: