gpt4 book ai didi

如果未启用虚拟机备份,Azure 拒绝自定义策略

转载 作者:行者123 更新时间:2023-12-03 03:47:05 25 4
gpt4 key购买 nike

我正在尝试创建自定义 azure 策略,如果有人创建虚拟机并且未启用备份,则部署应该失败。我已经尝试过以下代码,但不起作用。

{
"type": "Microsoft.Authorization/policyDefinitions",
"name": "enable backuo for-windows-vm",
"properties": {
"displayName": "enable backup for-windows-vm",
"description": "enable backup for-windows-vm",
"parameters": {},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.RecoveryServices/vaults/backupFabrics/backupProtectionIntent"
},
{
"field": "type",
"equals": "Microsoft.Compute"
},
{
"field": "Microsoft.RecoveryServices/Vaults",
"Notequals": "True"
}
]
},
"then": {
"effect": "deny"
}
}
}
}

最佳答案

This/this内置策略有助于实现您的要求。

enter image description here

关于如果未启用虚拟机备份,Azure 拒绝自定义策略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68680521/

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