{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-virtual-machines/json-schema/microsoft-azure-virtual-machines-image-schema.json",
  "title": "Image",
  "description": "The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-virtual-machines-images-api-openapi.yml#/components/schemas/Image",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/ImageProperties",
      "description": "Describes the properties of an Image.",
      "x-ms-client-flatten": true
    },
    "extendedLocation": {
      "$ref": "#/$defs/ExtendedLocation",
      "description": "The extended location of the Image."
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/TrackedResource"
    }
  ],
  "$defs": {
    "CachingTypes": {
      "type": "string",
      "description": "Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage**",
      "enum": [
        "None",
        "ReadOnly",
        "ReadWrite"
      ],
      "x-ms-enum": {
        "name": "CachingTypes",
        "modelAsString": false
      }
    },
    "Common.OperatingSystemStateTypes": {
      "type": "string",
      "description": "The OS State. For managed images, use Generalized.",
      "enum": [
        "Generalized",
        "Specialized"
      ],
      "x-ms-enum": {
        "name": "OperatingSystemStateTypes",
        "modelAsString": false,
        "values": [
          {
            "name": "Generalized",
            "value": "Generalized",
            "description": "Generalized image. Needs to be provisioned during deployment time."
          },
          {
            "name": "Specialized",
            "value": "Specialized",
            "description": "Specialized image. Contains already provisioned OS Disk."
          }
        ]
      }
    },
    "Common.OperatingSystemTypes": {
      "type": "string",
      "description": "This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** **Linux.**",
      "enum": [
        "Windows",
        "Linux"
      ],
      "x-ms-enum": {
        "name": "OperatingSystemTypes",
        "modelAsString": false
      }
    },
    "DiskEncryptionSetParameters": {
      "type": "object",
      "description": "Describes the parameter of customer managed disk encryption set resource id that can be specified for disk. **Note:** The disk encryption set resource id can only be specified for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details.",
      "allOf": [
        {
          "$ref": "#/$defs/SubResource"
        }
      ]
    },
    "ExtendedLocation": {
      "type": "object",
      "description": "The complex type of the extended location.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the extended location."
        },
        "type": {
          "$ref": "#/$defs/ExtendedLocationType",
          "description": "The type of the extended location."
        }
      }
    },
    "HyperVGenerationTypes": {
      "type": "string",
      "description": "Specifies the HyperVGeneration Type",
      "enum": [
        "V1",
        "V2"
      ],
      "x-ms-enum": {
        "name": "HyperVGenerationTypes",
        "modelAsString": true,
        "values": [
          {
            "name": "V1",
            "value": "V1"
          },
          {
            "name": "V2",
            "value": "V2"
          }
        ]
      }
    },
    "ImageDataDisk": {
      "type": "object",
      "description": "Describes a data disk.",
      "properties": {
        "lun": {
          "type": "integer",
          "format": "int32",
          "description": "Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM."
        }
      },
      "required": [
        "lun"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/ImageDisk"
        }
      ]
    },
    "ImageDisk": {
      "type": "object",
      "description": "Describes a image disk.",
      "properties": {
        "snapshot": {
          "$ref": "#/$defs/SubResource",
          "description": "The snapshot."
        },
        "managedDisk": {
          "$ref": "#/$defs/SubResource",
          "description": "The managedDisk."
        },
        "blobUri": {
          "type": "string",
          "description": "The Virtual Hard Disk."
        },
        "caching": {
          "$ref": "#/$defs/CachingTypes",
          "description": "Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.**"
        },
        "diskSizeGB": {
          "type": "integer",
          "format": "int32",
          "description": "Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. This value cannot be larger than 1023 GB."
        },
        "storageAccountType": {
          "$ref": "#/$defs/StorageAccountTypes",
          "description": "Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk."
        },
        "diskEncryptionSet": {
          "$ref": "#/$defs/DiskEncryptionSetParameters",
          "description": "Specifies the customer managed disk encryption set resource id for the managed image disk."
        }
      }
    },
    "ImageOSDisk": {
      "type": "object",
      "description": "Describes an Operating System disk.",
      "properties": {
        "osType": {
          "$ref": "#/$defs/Common.OperatingSystemTypes",
          "description": "This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image. Possible values are: **Windows,** **Linux.**"
        },
        "osState": {
          "$ref": "#/$defs/Common.OperatingSystemStateTypes",
          "description": "The OS State. For managed images, use Generalized."
        }
      },
      "required": [
        "osType",
        "osState"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/ImageDisk"
        }
      ]
    },
    "ImageProperties": {
      "type": "object",
      "description": "Describes the properties of an Image.",
      "properties": {
        "sourceVirtualMachine": {
          "$ref": "#/$defs/SubResource",
          "description": "The source virtual machine from which Image is created."
        },
        "storageProfile": {
          "$ref": "#/$defs/ImageStorageProfile",
          "description": "Specifies the storage settings for the virtual machine disks."
        },
        "provisioningState": {
          "type": "string",
          "description": "The provisioning state.",
          "readOnly": true
        },
        "hyperVGeneration": {
          "$ref": "#/$defs/HyperVGenerationTypes",
          "description": "Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed resource."
        }
      }
    },
    "ImageStorageProfile": {
      "type": "object",
      "description": "Describes a storage profile.",
      "properties": {
        "osDisk": {
          "$ref": "#/$defs/ImageOSDisk",
          "description": "Specifies information about the operating system disk used by the virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview)."
        },
        "dataDisks": {
          "type": "array",
          "description": "Specifies the parameters that are used to add a data disk to a virtual machine. <br><br> For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview).",
          "items": {
            "$ref": "#/$defs/ImageDataDisk"
          },
          "x-ms-identifiers": [
            "lun"
          ]
        },
        "zoneResilient": {
          "type": "boolean",
          "description": "Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS)."
        }
      }
    },
    "StorageAccountTypes": {
      "type": "string",
      "description": "Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when you create the scale set. NOTE: UltraSSD_LRS can only be used with data disks. It cannot be used with OS Disk. Standard_LRS uses Standard HDD. StandardSSD_LRS uses Standard SSD. Premium_LRS uses Premium SSD. UltraSSD_LRS uses Ultra disk. Premium_ZRS uses Premium SSD zone redundant storage. StandardSSD_ZRS uses Standard SSD zone redundant storage. For more information regarding disks supported for Windows Virtual Machines, refer to https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to https://docs.microsoft.com/azure/virtual-machines/linux/disks-types",
      "enum": [
        "Standard_LRS",
        "Premium_LRS",
        "StandardSSD_LRS",
        "UltraSSD_LRS",
        "Premium_ZRS",
        "StandardSSD_ZRS",
        "PremiumV2_LRS"
      ],
      "x-ms-enum": {
        "name": "StorageAccountTypes",
        "modelAsString": true,
        "values": [
          {
            "name": "Standard_LRS",
            "value": "Standard_LRS"
          },
          {
            "name": "Premium_LRS",
            "value": "Premium_LRS"
          },
          {
            "name": "StandardSSD_LRS",
            "value": "StandardSSD_LRS"
          },
          {
            "name": "UltraSSD_LRS",
            "value": "UltraSSD_LRS"
          },
          {
            "name": "Premium_ZRS",
            "value": "Premium_ZRS"
          },
          {
            "name": "StandardSSD_ZRS",
            "value": "StandardSSD_ZRS"
          },
          {
            "name": "PremiumV2_LRS",
            "value": "PremiumV2_LRS"
          }
        ]
      }
    },
    "SubResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Resource Id"
        }
      }
    },
    "TrackedResource": {
      "type": "object",
      "title": "Tracked Resource",
      "description": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'",
      "properties": {
        "tags": {
          "type": "object",
          "description": "Resource tags.",
          "additionalProperties": {
            "type": "string"
          },
          "x-ms-mutability": [
            "read",
            "create",
            "update"
          ]
        },
        "location": {
          "type": "string",
          "description": "The geo-location where the resource lives",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        }
      },
      "required": [
        "location"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/Resource"
        }
      ]
    }
  }
}