Share via


Images - Create Or Update

Create or update an image.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}?api-version=2024-11-01

URI Parameters

Name In Required Type Description
imageName
path True

string

The name of the image.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

minLength: 1

The ID of the target subscription.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Required Type Description
location True

string

The geo-location where the resource lives

extendedLocation

ExtendedLocation

The extended location of the Image.

properties.hyperVGeneration

HyperVGenerationTypes

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.

properties.sourceVirtualMachine

SubResource

The source virtual machine from which Image is created.

properties.storageProfile

ImageStorageProfile

Specifies the storage settings for the virtual machine disks.

tags

object

Resource tags.

Responses

Name Type Description
200 OK

Image

Resource 'Image' update operation succeeded

201 Created

Image

Resource 'Image' create operation succeeded

Headers

  • Location: string
  • Retry-After: integer
Other Status Codes

CloudError

An unexpected error response.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Create a virtual machine image from a blob with DiskEncryptionSet resource.
Create a virtual machine image from a blob.
Create a virtual machine image from a managed disk with DiskEncryptionSet resource.
Create a virtual machine image from a managed disk.
Create a virtual machine image from a snapshot with DiskEncryptionSet resource.
Create a virtual machine image from a snapshot.
Create a virtual machine image from an existing virtual machine.
Create a virtual machine image that includes a data disk from a blob.
Create a virtual machine image that includes a data disk from a managed disk.
Create a virtual machine image that includes a data disk from a snapshot.

Create a virtual machine image from a blob with DiskEncryptionSet resource.

Sample request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage?api-version=2024-11-01

{
  "location": "West US",
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "blobUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
        "diskEncryptionSet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
        },
        "osState": "Generalized"
      }
    }
  }
}

Sample response

{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "osState": "Generalized",
        "blobUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
        "diskEncryptionSet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
        },
        "caching": "ReadWrite"
      },
      "dataDisks": []
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}
{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "osState": "Generalized",
        "blobUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
        "diskEncryptionSet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
        },
        "caching": "ReadWrite"
      },
      "dataDisks": []
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}

Create a virtual machine image from a blob.

Sample request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage?api-version=2024-11-01

{
  "location": "West US",
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "blobUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
        "osState": "Generalized"
      },
      "zoneResilient": true
    }
  }
}

Sample response

{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "osState": "Generalized",
        "blobUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
        "caching": "ReadWrite"
      },
      "dataDisks": [],
      "zoneResilient": true
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}
{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "osState": "Generalized",
        "blobUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
        "caching": "ReadWrite"
      },
      "dataDisks": [],
      "zoneResilient": true
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}

Create a virtual machine image from a managed disk with DiskEncryptionSet resource.

Sample request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage?api-version=2024-11-01

{
  "location": "West US",
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "snapshot": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"
        },
        "diskEncryptionSet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
        },
        "osState": "Generalized"
      }
    }
  }
}

Sample response

{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "snapshot": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"
        },
        "diskEncryptionSet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
        },
        "osState": "Generalized",
        "caching": "ReadWrite"
      },
      "dataDisks": []
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}
{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "snapshot": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"
        },
        "diskEncryptionSet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
        },
        "osState": "Generalized",
        "caching": "ReadWrite"
      },
      "dataDisks": []
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}

Create a virtual machine image from a managed disk.

Sample request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage?api-version=2024-11-01

{
  "location": "West US",
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "managedDisk": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"
        },
        "osState": "Generalized"
      },
      "zoneResilient": true
    }
  }
}

Sample response

{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "managedDisk": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"
        },
        "osState": "Generalized",
        "caching": "ReadWrite"
      },
      "dataDisks": [],
      "zoneResilient": true
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}
{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "managedDisk": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"
        },
        "osState": "Generalized",
        "caching": "ReadWrite"
      },
      "dataDisks": [],
      "zoneResilient": true
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}

Create a virtual machine image from a snapshot with DiskEncryptionSet resource.

Sample request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage?api-version=2024-11-01

{
  "location": "West US",
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "managedDisk": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"
        },
        "diskEncryptionSet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
        },
        "osState": "Generalized"
      }
    }
  }
}

Sample response

{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "managedDisk": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"
        },
        "diskEncryptionSet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
        },
        "osState": "Generalized",
        "caching": "ReadWrite"
      },
      "dataDisks": []
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}
{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "managedDisk": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"
        },
        "diskEncryptionSet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
        },
        "osState": "Generalized",
        "caching": "ReadWrite"
      },
      "dataDisks": []
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}

Create a virtual machine image from a snapshot.

Sample request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage?api-version=2024-11-01

{
  "location": "West US",
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "snapshot": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"
        },
        "osState": "Generalized"
      },
      "zoneResilient": false
    }
  }
}

Sample response

{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "snapshot": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"
        },
        "osState": "Generalized",
        "caching": "ReadWrite"
      },
      "dataDisks": [],
      "zoneResilient": false
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}
{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "snapshot": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"
        },
        "osState": "Generalized",
        "caching": "ReadWrite"
      },
      "dataDisks": [],
      "zoneResilient": false
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}

Create a virtual machine image from an existing virtual machine.

Sample request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage?api-version=2024-11-01

{
  "location": "West US",
  "properties": {
    "sourceVirtualMachine": {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"
    }
  }
}

Sample response

{
  "properties": {
    "sourceVirtualMachine": {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"
    },
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "osState": "Generalized",
        "managedDisk": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myVM_OsDisk_1_6dc293b7d811433196903acf92665022"
        },
        "caching": "ReadWrite"
      },
      "dataDisks": [],
      "zoneResilient": false
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}
{
  "properties": {
    "sourceVirtualMachine": {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"
    },
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "osState": "Generalized",
        "managedDisk": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myVM_OsDisk_1_6dc293b7d811433196903acf92665022"
        },
        "caching": "ReadWrite"
      },
      "dataDisks": [],
      "zoneResilient": false
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}

Create a virtual machine image that includes a data disk from a blob.

Sample request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage?api-version=2024-11-01

{
  "location": "West US",
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "blobUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
        "osState": "Generalized"
      },
      "dataDisks": [
        {
          "lun": 1,
          "blobUri": "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"
        }
      ],
      "zoneResilient": false
    }
  }
}

Sample response

{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "osState": "Generalized",
        "blobUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
        "caching": "ReadWrite"
      },
      "dataDisks": [
        {
          "lun": 1,
          "blobUri": "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"
        }
      ],
      "zoneResilient": false
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}
{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "osState": "Generalized",
        "blobUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
        "caching": "ReadWrite"
      },
      "dataDisks": [
        {
          "lun": 1,
          "blobUri": "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"
        }
      ],
      "zoneResilient": false
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}

Create a virtual machine image that includes a data disk from a managed disk.

Sample request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage?api-version=2024-11-01

{
  "location": "West US",
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "managedDisk": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"
        },
        "osState": "Generalized"
      },
      "dataDisks": [
        {
          "lun": 1,
          "managedDisk": {
            "id": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"
          }
        }
      ],
      "zoneResilient": false
    }
  }
}

Sample response

{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "managedDisk": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"
        },
        "osState": "Generalized",
        "caching": "ReadWrite"
      },
      "dataDisks": [
        {
          "lun": 1,
          "managedDisk": {
            "id": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"
          }
        }
      ],
      "zoneResilient": false
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}
{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "managedDisk": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"
        },
        "osState": "Generalized",
        "caching": "ReadWrite"
      },
      "dataDisks": [
        {
          "lun": 1,
          "managedDisk": {
            "id": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"
          }
        }
      ],
      "zoneResilient": false
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}

Create a virtual machine image that includes a data disk from a snapshot.

Sample request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage?api-version=2024-11-01

{
  "location": "West US",
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "snapshot": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"
        },
        "osState": "Generalized"
      },
      "dataDisks": [
        {
          "lun": 1,
          "snapshot": {
            "id": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"
          }
        }
      ],
      "zoneResilient": true
    }
  }
}

Sample response

{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "snapshot": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"
        },
        "osState": "Generalized",
        "caching": "ReadWrite"
      },
      "dataDisks": [
        {
          "lun": 1,
          "snapshot": {
            "id": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"
          }
        }
      ],
      "zoneResilient": true
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}
{
  "properties": {
    "storageProfile": {
      "osDisk": {
        "osType": "Linux",
        "snapshot": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"
        },
        "osState": "Generalized",
        "caching": "ReadWrite"
      },
      "dataDisks": [
        {
          "lun": 1,
          "snapshot": {
            "id": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"
          }
        }
      ],
      "zoneResilient": true
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/images",
  "location": "westus",
  "id": "/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage",
  "name": "myImage"
}

Definitions

Name Description
ApiError

Api error.

ApiErrorBase

Api error base.

CachingTypes

Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard storage. ReadOnly for Premium storage

CloudError

An error response from the Compute service.

createdByType

The type of identity that created the resource.

DiskEncryptionSetParameters

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.

ExtendedLocation

The complex type of the extended location.

ExtendedLocationTypes

The type of the extended location.

HyperVGenerationTypes

Specifies the HyperVGeneration Type

Image

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.

ImageDataDisk

Describes a data disk.

ImageOSDisk

Describes an Operating System disk.

ImageStorageProfile

Describes a storage profile.

InnerError

Inner error details.

OperatingSystemStateTypes

The OS State. For managed images, use Generalized.

OperatingSystemTypes

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.

StorageAccountTypes

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

SubResource
systemData

Metadata pertaining to creation and last modification of the resource.

ApiError

Api error.

Name Type Description
code

string

The error code.

details

ApiErrorBase[]

The Api error details

innererror

InnerError

The Api inner error

message

string

The error message.

target

string

The target of the particular error.

ApiErrorBase

Api error base.

Name Type Description
code

string

The error code.

message

string

The error message.

target

string

The target of the particular error.

CachingTypes

Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard storage. ReadOnly for Premium storage

Value Description
None
ReadOnly
ReadWrite

CloudError

An error response from the Compute service.

Name Type Description
error

ApiError

Api error.

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

DiskEncryptionSetParameters

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.

Name Type Description
id

string

Resource Id

ExtendedLocation

The complex type of the extended location.

Name Type Description
name

string

The name of the extended location.

type

ExtendedLocationTypes

The type of the extended location.

ExtendedLocationTypes

The type of the extended location.

Value Description
EdgeZone

HyperVGenerationTypes

Specifies the HyperVGeneration Type

Value Description
V1
V2

Image

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.

Name Type Description
extendedLocation

ExtendedLocation

The extended location of the Image.

id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

location

string

The geo-location where the resource lives

name

string

The name of the resource

properties.hyperVGeneration

HyperVGenerationTypes

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.

properties.provisioningState

string

The provisioning state.

properties.sourceVirtualMachine

SubResource

The source virtual machine from which Image is created.

properties.storageProfile

ImageStorageProfile

Specifies the storage settings for the virtual machine disks.

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

tags

object

Resource tags.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

ImageDataDisk

Describes a data disk.

Name Type Description
blobUri

string

The Virtual Hard Disk.

caching

CachingTypes

Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard storage. ReadOnly for Premium storage.

diskEncryptionSet

DiskEncryptionSetParameters

Specifies the customer managed disk encryption set resource id for the managed image disk.

diskSizeGB

integer (int32)

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.

lun

integer (int32)

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.

managedDisk

SubResource

The managedDisk.

snapshot

SubResource

The snapshot.

storageAccountType

StorageAccountTypes

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.

ImageOSDisk

Describes an Operating System disk.

Name Type Description
blobUri

string

The Virtual Hard Disk.

caching

CachingTypes

Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard storage. ReadOnly for Premium storage.

diskEncryptionSet

DiskEncryptionSetParameters

Specifies the customer managed disk encryption set resource id for the managed image disk.

diskSizeGB

integer (int32)

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.

managedDisk

SubResource

The managedDisk.

osState

OperatingSystemStateTypes

The OS State. For managed images, use Generalized.

osType

OperatingSystemTypes

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.

snapshot

SubResource

The snapshot.

storageAccountType

StorageAccountTypes

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.

ImageStorageProfile

Describes a storage profile.

Name Type Description
dataDisks

ImageDataDisk[]

Specifies the parameters that are used to add a data disk to a virtual machine.

For more information about disks, see About disks and VHDs for Azure virtual machines.

osDisk

ImageOSDisk

Specifies information about the operating system disk used by the virtual machine.

For more information about disks, see About disks and VHDs for Azure virtual machines.

zoneResilient

boolean

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).

InnerError

Inner error details.

Name Type Description
errordetail

string

The internal error message or exception dump.

exceptiontype

string

The exception type.

OperatingSystemStateTypes

The OS State. For managed images, use Generalized.

Value Description
Generalized

Generalized image. Needs to be provisioned during deployment time.

Specialized

Specialized image. Contains already provisioned OS Disk.

OperatingSystemTypes

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.

Value Description
Windows
Linux

StorageAccountTypes

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

Value Description
Standard_LRS
Premium_LRS
StandardSSD_LRS
UltraSSD_LRS
Premium_ZRS
StandardSSD_ZRS
PremiumV2_LRS

SubResource

Name Type Description
id

string

Resource Id

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.