last sync: 2021-Sep-24 16:09:49 UTC

Azure Policy definition

Require automatic OS image patching on Virtual Machine Scale Sets

Name Require automatic OS image patching on Virtual Machine Scale Sets
Azure Portal
Id 465f0161-0087-490a-9ad9-ad6217f4f43a
Version 1.0.0
details on versioning
Category Compute
Microsoft docs
Description This policy enforces enabling automatic OS image patching on Virtual Machine Scale Sets to always keep Virtual Machines secure by safely applying latest security patches every month.
Mode All
Type BuiltIn
Preview FALSE
Deprecated FALSE
Effect Fixed: deny
Used RBAC Role none
History none
Used in Initiatives none
JSON
{
  "displayName": "Require automatic OS image patching on Virtual Machine Scale Sets",
  "policyType": "BuiltIn",
  "mode": "All",
  "description": "This policy enforces enabling automatic OS image patching on Virtual Machine Scale Sets to always keep Virtual Machines secure by safely applying latest security patches every month.",
  "metadata": {
    "version": "1.0.0",
    "category": "Compute"
  },
  "parameters": {},
  "policyRule": {
    "if": {
      "allOf": [
        {
          "field": "type",
          "equals": "Microsoft.Compute/virtualMachineScaleSets"
        },
        {
          "field": "Microsoft.Compute/VirtualMachineScaleSets/upgradePolicy.automaticOSUpgradePolicy.enableAutomaticOSUpgrade",
          "notEquals": "True"
        },
        {
          "field": "Microsoft.Compute/VirtualMachineScaleSets/upgradePolicy.automaticOSUpgrade",
          "notEquals": "True"
        }
      ]
    },
    "then": {
      "effect": "deny"
    }
  }
}