Skip to main content

labs

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

Overview

Namelabs
TypeResource
Idazure.dev_test_labs.labs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe identifier of the resource.
namestringThe name of the resource.
announcementobjectThe properties of any lab announcement associated with this lab.
artifactsStorageAccountstringThe lab's artifact storage account.
createdDatestring (date-time)The creation date of the lab.
defaultPremiumStorageAccountstringThe lab's default premium storage account.
defaultStorageAccountstringThe lab's default storage account.
environmentPermissionstringThe access rights to be granted to the user when provisioning an environment. Known values are: "Reader" and "Contributor".
extendedPropertiesobjectExtended properties of the lab used for experimental features.
labStorageTypestringType of storage used by the lab. It can be either Premium or Standard. Default is Premium. Known values are: "Standard", "Premium", and "StandardSSD".
loadBalancerIdstringThe load balancer used to for lab VMs that use shared IP address.
locationstringThe location of the resource.
mandatoryArtifactsResourceIdsLinuxarrayThe ordered list of artifact resource IDs that should be applied on all Linux VM creations by default, prior to the artifacts specified by the user.
mandatoryArtifactsResourceIdsWindowsarrayThe ordered list of artifact resource IDs that should be applied on all Windows VM creations by default, prior to the artifacts specified by the user.
networkSecurityGroupIdstringThe Network Security Group attached to the lab VMs Network interfaces to restrict open ports.
premiumDataDiskStorageAccountstringThe lab's premium data disk storage account.
premiumDataDisksstringThe setting to enable usage of premium data disks. When its value is 'Enabled', creation of standard or premium data disks is allowed. When its value is 'Disabled', only creation of standard data disks is allowed. Known values are: "Disabled" and "Enabled".
provisioningStatestringThe provisioning status of the resource.
publicIpIdstringThe public IP address for the lab's load balancer.
supportobjectThe properties of any lab support message associated with this lab.
tagsobjectThe tags of the resource.
typestringThe type of the resource.
uniqueIdentifierstringThe unique immutable identifier of a resource (Guid).
vaultNamestringThe lab's Key vault.
vmCreationResourceGroupstringThe resource group in which all new lab virtual machines will be created. To let DevTest Labs manage resource group creation, set this value to null.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, name, subscription_id$expandGet lab.
list_by_resource_groupselectresource_group_name, subscription_id$expand, $filter, $top, $orderbyList labs in a resource group.
list_by_subscriptionselectsubscription_id$expand, $filter, $top, $orderbyList labs in a subscription.
create_or_updateinsertresource_group_name, name, subscription_idCreate or replace an existing lab. This operation can take a while to complete.
updateupdateresource_group_name, name, subscription_idAllows modifying tags of labs. All other properties will be ignored.
create_or_updatereplaceresource_group_name, name, subscription_idCreate or replace an existing lab. This operation can take a while to complete.
deletedeleteresource_group_name, name, subscription_idDelete lab. This operation can take a while to complete.
list_vhdsexecresource_group_name, name, subscription_idList disk images available for custom image creation.
claim_any_vmexecresource_group_name, name, subscription_idClaim a random claimable virtual machine in the lab. This operation can take a while to complete.
create_environmentexecresource_group_name, name, subscription_idCreate virtual machines in a lab. This operation can take a while to complete.
export_resource_usageexecresource_group_name, name, subscription_idExports the lab resource usage into a storage account This operation can take a while to complete.
generate_upload_uriexecresource_group_name, name, subscription_idGenerate a URI for uploading custom disk images to a Lab.
import_virtual_machineexecresource_group_name, name, subscription_idImport a virtual machine into a different lab. 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
namestringThe name of the lab. Required.
resource_group_namestringThe name of the resource group. Required.
subscription_idstring
$expandstringSpecify the $expand query. Example: 'properties($select=defaultStorageAccount)'. 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 lab.

SELECT
id,
name,
announcement,
artifactsStorageAccount,
createdDate,
defaultPremiumStorageAccount,
defaultStorageAccount,
environmentPermission,
extendedProperties,
labStorageType,
loadBalancerId,
location,
mandatoryArtifactsResourceIdsLinux,
mandatoryArtifactsResourceIdsWindows,
networkSecurityGroupId,
premiumDataDiskStorageAccount,
premiumDataDisks,
provisioningState,
publicIpId,
support,
tags,
type,
uniqueIdentifier,
vaultName,
vmCreationResourceGroup
FROM azure.dev_test_labs.labs
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND name = '{{ name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;

INSERT examples

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

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

UPDATE examples

Allows modifying tags of labs. All other properties will be ignored.

UPDATE azure.dev_test_labs.labs
SET
-- No updatable properties
WHERE
resource_group_name = '{{ resource_group_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 lab. This operation can take a while to complete.

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

DELETE examples

Delete lab. This operation can take a while to complete.

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

Lifecycle Methods

List disk images available for custom image creation.

EXEC azure.dev_test_labs.labs.list_vhds 
@resource_group_name='{{ resource_group_name }}' --required,
@name='{{ name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;