Skip to main content

virtual_machine_image_templates

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

Overview

Namevirtual_machine_image_templates
TypeResource
Idazure.image_builder.virtual_machine_image_templates

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.
artifactIdstringThe resource id of the artifact.
artifactUristringThe location URI of the artifact.
provisioningStatestringProvisioning state of the resource. Known values are: "Creating", "Updating", "Succeeded", "Failed", "Deleting", and "Canceled". (Creating, Updating, Succeeded, Failed, Deleting, Canceled)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
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
get_run_outputselectresource_group_name, image_template_name, run_output_name, subscription_idGet the specified run output for the specified image template resource.
getselectresource_group_name, image_template_name, subscription_idGet information about a virtual machine image template.
list_by_resource_groupselectresource_group_name, subscription_idGets information about the VM image templates associated with the specified resource group.
listselectsubscription_idGets information about the VM image templates associated with the subscription.
create_or_updateinsertresource_group_name, image_template_name, subscription_id, location, identityCreate or update a virtual machine image template.
updateupdateresource_group_name, image_template_name, subscription_idUpdate the tags for this Virtual Machine Image Template.
create_or_updatereplaceresource_group_name, image_template_name, subscription_id, location, identityCreate or update a virtual machine image template.
deletedeleteresource_group_name, image_template_name, subscription_idDelete a virtual machine image template.
list_run_outputsexecresource_group_name, image_template_name, subscription_idList all run outputs for the specified Image Template resource.
runexecresource_group_name, image_template_name, subscription_idCreate artifacts from a existing image template.
cancelexecresource_group_name, image_template_name, subscription_idCancel the long running image build based on the image template.

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_template_namestringThe name of the image Template. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
run_output_namestringThe name of the run output. Required.
subscription_idstring

SELECT examples

Get the specified run output for the specified image template resource.

SELECT
id,
name,
artifactId,
artifactUri,
provisioningState,
systemData,
type
FROM azure.image_builder.virtual_machine_image_templates
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND image_template_name = '{{ image_template_name }}' -- required
AND run_output_name = '{{ run_output_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or update a virtual machine image template.

INSERT INTO azure.image_builder.virtual_machine_image_templates (
tags,
location,
properties,
identity,
resource_group_name,
image_template_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ identity }}' /* required */,
'{{ resource_group_name }}',
'{{ image_template_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
identity,
location,
properties,
systemData,
tags,
type
;

UPDATE examples

Update the tags for this Virtual Machine Image Template.

UPDATE azure.image_builder.virtual_machine_image_templates
SET
identity = '{{ identity }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND image_template_name = '{{ image_template_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
identity,
location,
properties,
systemData,
tags,
type;

REPLACE examples

Create or update a virtual machine image template.

REPLACE azure.image_builder.virtual_machine_image_templates
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
identity = '{{ identity }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND image_template_name = '{{ image_template_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
AND identity = '{{ identity }}' --required
RETURNING
id,
name,
identity,
location,
properties,
systemData,
tags,
type;

DELETE examples

Delete a virtual machine image template.

DELETE FROM azure.image_builder.virtual_machine_image_templates
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND image_template_name = '{{ image_template_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

List all run outputs for the specified Image Template resource.

EXEC azure.image_builder.virtual_machine_image_templates.list_run_outputs 
@resource_group_name='{{ resource_group_name }}' --required,
@image_template_name='{{ image_template_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;