Skip to main content

artifacts

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

Overview

Nameartifacts
TypeResource
Idazure.dev_test_labs.artifacts

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe identifier of the resource.
namestringThe name of the resource.
createdDatestring (date-time)The artifact's creation date.
descriptionstringThe artifact's description.
filePathstringThe file path to the artifact.
iconstringThe URI to the artifact icon.
locationstringThe location of the resource.
parametersobjectThe artifact's parameters.
publisherstringThe artifact's publisher.
tagsobjectThe tags of the resource.
targetOsTypestringThe artifact's target OS.
titlestringThe artifact's title.
typestringThe type of the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, lab_name, artifact_source_name, name, subscription_id$expandGet artifact.
listselectresource_group_name, lab_name, artifact_source_name, subscription_id$expand, $filter, $top, $orderbyList artifacts in a given artifact source.
generate_arm_templateexecresource_group_name, lab_name, artifact_source_name, name, subscription_idGenerates an ARM template for the given artifact, uploads the required files to a storage account, and validates the generated artifact.

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
artifact_source_namestringThe name of the artifact source. Required.
lab_namestringThe name of the lab. Required.
namestringThe name of the artifact. Required.
resource_group_namestringThe name of the resource group. Required.
subscription_idstring
$expandstringSpecify the $expand query. Example: 'properties($select=title)'. 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 artifact.

SELECT
id,
name,
createdDate,
description,
filePath,
icon,
location,
parameters,
publisher,
tags,
targetOsType,
title,
type
FROM azure.dev_test_labs.artifacts
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND lab_name = '{{ lab_name }}' -- required
AND artifact_source_name = '{{ artifact_source_name }}' -- required
AND name = '{{ name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;

Lifecycle Methods

Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates the generated artifact.

EXEC azure.dev_test_labs.artifacts.generate_arm_template 
@resource_group_name='{{ resource_group_name }}' --required,
@lab_name='{{ lab_name }}' --required,
@artifact_source_name='{{ artifact_source_name }}' --required,
@name='{{ name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"virtualMachineName": "{{ virtualMachineName }}",
"parameters": "{{ parameters }}",
"location": "{{ location }}",
"fileUploadOptions": "{{ fileUploadOptions }}"
}'
;