Skip to main content

images

Creates, updates, deletes, gets or lists an images resource.

Overview

Nameimages
TypeResource
Idazure.compute.images

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
extendedLocationobjectThe extended location of the Image.
hyperVGenerationstringSpecifies 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. Known values are: "V1" and "V2". (V1, V2)
locationstringThe geo-location where the resource lives. Required.
provisioningStatestringThe provisioning state.
sourceVirtualMachineobjectSubResource.
storageProfileobjectSpecifies the storage settings for the virtual machine disks.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, image_name, subscription_id$expandGets an image.
list_by_resource_groupselectresource_group_name, subscription_idGets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images.
listselectsubscription_idGets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images.
create_or_updateinsertresource_group_name, image_name, subscription_id, locationCreate or update an image.
updateupdateresource_group_name, image_name, subscription_idUpdate an image.
create_or_updatereplaceresource_group_name, image_name, subscription_id, locationCreate or update an image.
deletedeleteresource_group_name, image_name, subscription_idDeletes an Image.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
image_namestringThe name of the image. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
$expandstringThe expand expression to apply on the operation. Default value is None.

SELECT examples

Gets an image.

SELECT
id,
name,
extendedLocation,
hyperVGeneration,
location,
provisioningState,
sourceVirtualMachine,
storageProfile,
systemData,
tags,
type
FROM azure.compute.images
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND image_name = '{{ image_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;

INSERT examples

Create or update an image.

INSERT INTO azure.compute.images (
tags,
location,
properties,
extendedLocation,
resource_group_name,
image_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ extendedLocation }}',
'{{ resource_group_name }}',
'{{ image_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
extendedLocation,
location,
properties,
systemData,
tags,
type
;

UPDATE examples

Update an image.

UPDATE azure.compute.images
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND image_name = '{{ image_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
extendedLocation,
location,
properties,
systemData,
tags,
type;

REPLACE examples

Create or update an image.

REPLACE azure.compute.images
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
extendedLocation = '{{ extendedLocation }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND image_name = '{{ image_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
extendedLocation,
location,
properties,
systemData,
tags,
type;

DELETE examples

Deletes an Image.

DELETE FROM azure.compute.images
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND image_name = '{{ image_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;