Skip to main content

labs

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

Overview

Namelabs
TypeResource
Idazure.dev_test_labs.labs

Fields

NameDatatypeDescription
idtextThe identifier of the resource.
nametextThe name of the resource.
announcementtextfield from the properties object
artifacts_storage_accounttextfield from the properties object
created_datetextfield from the properties object
default_premium_storage_accounttextfield from the properties object
default_storage_accounttextfield from the properties object
environment_permissiontextfield from the properties object
extended_propertiestextfield from the properties object
lab_storage_typetextfield from the properties object
load_balancer_idtextfield from the properties object
locationtextThe location of the resource.
mandatory_artifacts_resource_ids_linuxtextfield from the properties object
mandatory_artifacts_resource_ids_windowstextfield from the properties object
network_security_group_idtextfield from the properties object
premium_data_disk_storage_accounttextfield from the properties object
premium_data_diskstextfield from the properties object
provisioning_statetextfield from the properties object
public_ip_idtextfield from the properties object
resourceGroupNametextfield from the properties object
subscriptionIdtextfield from the properties object
supporttextfield from the properties object
tagstextThe tags of the resource.
typetextThe type of the resource.
unique_identifiertextfield from the properties object
vault_nametextfield from the properties object
vm_creation_resource_grouptextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTname, resourceGroupName, subscriptionIdGet lab.
list_by_resource_groupSELECTresourceGroupName, subscriptionIdList labs in a resource group.
list_by_subscriptionSELECTsubscriptionIdList labs in a subscription.
create_or_updateINSERTname, resourceGroupName, subscriptionIdCreate or replace an existing lab. This operation can take a while to complete.
deleteDELETEname, resourceGroupName, subscriptionIdDelete lab. This operation can take a while to complete.
updateUPDATEname, resourceGroupName, subscriptionIdAllows modifying tags of labs. All other properties will be ignored.
claim_any_vmEXECname, resourceGroupName, subscriptionIdClaim a random claimable virtual machine in the lab. This operation can take a while to complete.
export_resource_usageEXECname, resourceGroupName, subscriptionIdExports the lab resource usage into a storage account This operation can take a while to complete.
generate_upload_uriEXECname, resourceGroupName, subscriptionIdGenerate a URI for uploading custom disk images to a Lab.
import_virtual_machineEXECname, resourceGroupName, subscriptionIdImport a virtual machine into a different lab. This operation can take a while to complete.

SELECT examples

List labs in a subscription.

SELECT
id,
name,
announcement,
artifacts_storage_account,
created_date,
default_premium_storage_account,
default_storage_account,
environment_permission,
extended_properties,
lab_storage_type,
load_balancer_id,
location,
mandatory_artifacts_resource_ids_linux,
mandatory_artifacts_resource_ids_windows,
network_security_group_id,
premium_data_disk_storage_account,
premium_data_disks,
provisioning_state,
public_ip_id,
resourceGroupName,
subscriptionId,
support,
tags,
type,
unique_identifier,
vault_name,
vm_creation_resource_group
FROM azure.dev_test_labs.vw_labs
WHERE subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new labs resource.

/*+ create */
INSERT INTO azure.dev_test_labs.labs (
name,
resourceGroupName,
subscriptionId,
location,
tags,
properties
)
SELECT
'{{ name }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}'
;

UPDATE example

Updates a labs resource.

/*+ update */
UPDATE azure.dev_test_labs.labs
SET
tags = '{{ tags }}'
WHERE
name = '{{ name }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified labs resource.

/*+ delete */
DELETE FROM azure.dev_test_labs.labs
WHERE name = '{{ name }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';