Skip to content

Instantly share code, notes, and snippets.

@machv
Created January 4, 2021 10:01
Show Gist options
  • Select an option

  • Save machv/2a23c486e2f1ea7c840b94f545b8a5bf to your computer and use it in GitHub Desktop.

Select an option

Save machv/2a23c486e2f1ea7c840b94f545b8a5bf to your computer and use it in GitHub Desktop.
{
"properties": {
"displayName": "Enabled DDoS protection",
"policyType": "Custom",
"mode": "All",
"metadata": {
"category": "Network"
},
"parameters": {},
"policyRule": {
"if": {
"allOf": [{
"field": "type",
"equals": "Microsoft.Network/virtualNetworks"
}]
},
"then": {
"effect": "AuditIfNotExists",
"details": {
"type": "Microsoft.Network/virtualNetworks",
"name": "[field('name')]",
"existenceCondition": {
"allOf": [{
"field": "Microsoft.Network/virtualNetworks/enableDdosProtection",
"equals": "true"
},
{
"field": "Microsoft.Network/virtualNetworks/ddosProtectionPlan",
"notEquals": ""
}
]
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment