Images - Get
Gets an image.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}?api-version=2024-07-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}?$expand={$expand}&api-version=2024-07-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
image
|
path | True |
string |
The name of the image. |
resource
|
path | True |
string |
The name of the resource group. |
subscription
|
path | True |
string |
Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
api-version
|
query | True |
string |
Client Api Version. |
$expand
|
query |
string |
The expand expression to apply on the operation. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK |
|
Other Status Codes |
Error response describing why the operation failed. |
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
Get information about a virtual machine image.
Sample request
Sample response
{
"id": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage",
"name": "myImage",
"type": "Microsoft.Compute/images",
"location": "West US",
"properties": {
"storageProfile": {
"osDisk": {
"osType": "Windows",
"blobUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd",
"snapshot": {
"id": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"
},
"managedDisk": {
"id": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk1"
},
"osState": "Generalized",
"storageAccountType": "Standard_LRS",
"diskSizeGB": 20
},
"dataDisks": [
{
"lun": 1,
"blobUri": "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd",
"snapshot": {
"id": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"
},
"managedDisk": {
"id": "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"
},
"storageAccountType": "Standard_LRS"
}
],
"zoneResilient": true
},
"provisioningState": "created"
}
}
Definitions
Name | Description |
---|---|
Api |
Api error. |
Api |
Api error base. |
Caching |
Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard storage. ReadOnly for Premium storage. |
Cloud |
An error response from the Compute service. |
Disk |
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. |
Extended |
The complex type of the extended location. |
Extended |
The type of the extended location. |
Hyper |
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. |
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. |
Image |
Describes a data disk. |
Image |
Describes an Operating System disk. |
Image |
Describes a storage profile. |
Inner |
Inner error details. |
Operating |
The OS State. For managed images, use Generalized. |
Operating |
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. |
Storage |
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. |
Sub |
ApiError
Api error.
Name | Type | Description |
---|---|---|
code |
string |
The error code. |
details |
The Api error details |
|
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.
Name | Type | Description |
---|---|---|
None |
string |
|
ReadOnly |
string |
|
ReadWrite |
string |
CloudError
An error response from the Compute service.
Name | Type | Description |
---|---|---|
error |
Api error. |
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 |
The type of the extended location. |
ExtendedLocationTypes
The type of the extended location.
Name | Type | Description |
---|---|---|
EdgeZone |
string |
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.
Name | Type | Description |
---|---|---|
V1 |
string |
|
V2 |
string |
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 |
The extended location of the Image. |
|
id |
string |
Resource Id |
location |
string |
Resource location |
name |
string |
Resource name |
properties.hyperVGeneration |
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 |
The source virtual machine from which Image is created. |
|
properties.storageProfile |
Specifies the storage settings for the virtual machine disks. |
|
tags |
object |
Resource tags |
type |
string |
Resource type |
ImageDataDisk
Describes a data disk.
Name | Type | Description |
---|---|---|
blobUri |
string |
The Virtual Hard Disk. |
caching |
Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard storage. ReadOnly for Premium storage. |
|
diskEncryptionSet |
Specifies the customer managed disk encryption set resource id for the managed image disk. |
|
diskSizeGB |
integer |
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 |
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 |
The managedDisk. |
|
snapshot |
The snapshot. |
|
storageAccountType |
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 |
Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard storage. ReadOnly for Premium storage. |
|
diskEncryptionSet |
Specifies the customer managed disk encryption set resource id for the managed image disk. |
|
diskSizeGB |
integer |
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 |
The managedDisk. |
|
osState |
The OS State. For managed images, use Generalized. |
|
osType |
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 |
The snapshot. |
|
storageAccountType |
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 |
Specifies the parameters that are used to add a data disk to a virtual machine. |
|
osDisk |
Specifies information about the operating system disk used by the virtual machine. |
|
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.
Name | Type | Description |
---|---|---|
Generalized |
string |
Generalized image. Needs to be provisioned during deployment time. |
Specialized |
string |
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 a custom image. Possible values are: Windows, Linux.
Name | Type | Description |
---|---|---|
Linux |
string |
|
Windows |
string |
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.
Name | Type | Description |
---|---|---|
PremiumV2_LRS |
string |
|
Premium_LRS |
string |
|
Premium_ZRS |
string |
|
StandardSSD_LRS |
string |
|
StandardSSD_ZRS |
string |
|
Standard_LRS |
string |
|
UltraSSD_LRS |
string |
SubResource
Name | Type | Description |
---|---|---|
id |
string |
Resource Id |