我是Azure的新手,我正在致力于使用策略来加强治理。我把这个策略定义放在一起:
{
"mode": "All",
"policyRule": {
"if": {
"not": {
"field": "kind",
"in": "[parameters('allowedSKUs')]"
}
},
"then": {
"effect": "deny"
}
},
"parameters": {
"allowedSKUs": {
"type": "Array",
"metadata": {
"displayName": "Allowed Storage SKU",
"description": "The list of allowed skus for resources.",
"strongType": "storageSkus"
}
}
}
}我希望能够强制执行在分配的订阅中创建的所有应用程序服务计划的"F1“价格层,但它似乎只有在分配此策略时才能使”存储选项“可用。如何使用Azure策略定义强制执行此操作。
发布于 2021-04-12 02:36:23
检查这一条:
{
"mode": "Indexed",
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Web/serverfarms"
},
{
"not": {
"field": "Microsoft.Web/serverfarms/sku.name",
"in": "[parameters('listOfAllowedSKUs')]"
}
}
]
},
"then": {
"effect": "Deny"
}
},
"parameters": {
"listOfAllowedSKUs": {
"type": "Array",
"metadata": {
"displayName": "Allowed SKUs",
"description": "The list of SKUs that can be specified"
},
"defaultValue": ["F1"]
}
}
}我找不到一个强类型的应用程序SKU。
https://stackoverflow.com/questions/67029808
复制相似问题