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

Azure Policy definition

Allowed virtual machine size SKUs

Name Allowed virtual machine size SKUs
Azure Portal
Id cccc23c7-8427-4f53-ad12-b6a63eb452b3
Version 1.0.1
details on versioning
Category Compute
Microsoft docs
Description This policy enables you to specify a set of virtual machine size SKUs that your organization can deploy.
Mode Indexed
Type BuiltIn
Preview FALSE
Deprecated FALSE
Effect Fixed: Deny
Used RBAC Role none
History
Date/Time (UTC ymd) (i) Change type Change detail
2020-05-09 14:57:51 change Previous DisplayName: Allowed virtual machine SKUs
Used in Initiatives none
JSON
{
  "displayName": "Allowed virtual machine size SKUs",
  "policyType": "BuiltIn",
  "mode": "Indexed",
  "description": "This policy enables you to specify a set of virtual machine size SKUs that your organization can deploy.",
  "metadata": {
    "version": "1.0.1",
    "category": "Compute"
  },
  "parameters": {
    "listOfAllowedSKUs": {
      "type": "Array",
      "metadata": {
        "description": "The list of size SKUs that can be specified for virtual machines.",
        "displayName": "Allowed Size SKUs",
        "strongType": "VMSKUs"
      }
    }
  },
  "policyRule": {
    "if": {
      "allOf": [
        {
          "field": "type",
          "equals": "Microsoft.Compute/virtualMachines"
        },
        {
          "not": {
            "field": "Microsoft.Compute/virtualMachines/sku.name",
            "in": "[parameters('listOfAllowedSKUs')]"
          }
        }
      ]
    },
    "then": {
      "effect": "Deny"
    }
  }
}