我想定义一个 Azure 策略,其中只能在订阅级别对“美国西部”和美国东部进行部署。
我知道我正在尝试填充一系列位置,但我在某些地方出错了;
{
"policyRule": {
"if": {
"not": {
"field": "location",
"in": "[parameters('allowedLocations')]"
}
},
"then": {
"effect": "deny"
}
},
"parameters": {
"allowedLocations": {
"type": "Array",
"metadata": {
"description": "The list of allowed locations for resources.",
"displayName": "Allowed locations",
"strongType": "location",
"value": [ "West US", "East US" ],
}
}
}
}