Skip to main content

custom_images

Creates, updates, deletes, gets or lists a custom_images resource.

Overview

Namecustom_images
TypeResource
Idazure.dev_test_labs.custom_images

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe identifier of the resource.
namestringThe name of the resource.
authorstringThe author of the custom image.
creationDatestring (date-time)The creation date of the custom image.
customImagePlanobjectStorage information about the plan related to this custom image.
dataDiskStorageInfoarrayStorage information about the data disks present in the custom image.
descriptionstringThe description of the custom image.
isPlanAuthorizedbooleanWhether or not the custom images underlying offer/plan has been enabled for programmatic deployment.
locationstringThe location of the resource.
managedImageIdstringThe Managed Image Id backing the custom image.
managedSnapshotIdstringThe Managed Snapshot Id backing the custom image.
provisioningStatestringThe provisioning status of the resource.
tagsobjectThe tags of the resource.
typestringThe type of the resource.
uniqueIdentifierstringThe unique immutable identifier of a resource (Guid).
vhdobjectThe VHD from which the image is to be created.
vmobjectThe virtual machine from which the image is to be created.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, lab_name, name, subscription_id$expandGet custom image.
listselectresource_group_name, lab_name, subscription_id$expand, $filter, $top, $orderbyList custom images in a given lab.
create_or_updateinsertresource_group_name, lab_name, name, subscription_idCreate or replace an existing custom image. This operation can take a while to complete.
updateupdateresource_group_name, lab_name, name, subscription_idAllows modifying tags of custom images. All other properties will be ignored.
create_or_updatereplaceresource_group_name, lab_name, name, subscription_idCreate or replace an existing custom image. This operation can take a while to complete.
deletedeleteresource_group_name, lab_name, name, subscription_idDelete custom image. This operation can take a while to complete.

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
lab_namestringThe name of the lab. Required.
namestringThe name of the custom image. Required.
resource_group_namestringThe name of the resource group. Required.
subscription_idstring
$expandstringSpecify the $expand query. Example: 'properties($select=vm)'. Default value is None.
$filterstringThe filter to apply to the operation. Example: '$filter=contains(name,'myName'). Default value is None.
$orderbystringThe ordering expression for the results, using OData notation. Example: '$orderby=name desc'. Default value is None.
$topintegerThe maximum number of resources to return from the operation. Example: '$top=10'. Default value is None.

SELECT examples

Get custom image.

SELECT
id,
name,
author,
creationDate,
customImagePlan,
dataDiskStorageInfo,
description,
isPlanAuthorized,
location,
managedImageId,
managedSnapshotId,
provisioningState,
tags,
type,
uniqueIdentifier,
vhd,
vm
FROM azure.dev_test_labs.custom_images
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND lab_name = '{{ lab_name }}' -- required
AND name = '{{ name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;

INSERT examples

Create or replace an existing custom image. This operation can take a while to complete.

INSERT INTO azure.dev_test_labs.custom_images (
location,
tags,
properties,
resource_group_name,
lab_name,
name,
subscription_id
)
SELECT
'{{ location }}',
'{{ tags }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ lab_name }}',
'{{ name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
tags,
type
;

UPDATE examples

Allows modifying tags of custom images. All other properties will be ignored.

UPDATE azure.dev_test_labs.custom_images
SET
-- No updatable properties
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
tags,
type;

REPLACE examples

Create or replace an existing custom image. This operation can take a while to complete.

REPLACE azure.dev_test_labs.custom_images
SET
location = '{{ location }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
tags,
type;

DELETE examples

Delete custom image. This operation can take a while to complete.

DELETE FROM azure.dev_test_labs.custom_images
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;