Skip to main content

labs

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

Overview

Namelabs
TypeResource
Idazure.lab_services.labs

Fields

NameDatatypeDescription
descriptiontextfield from the properties object
auto_shutdown_profiletextfield from the properties object
connection_profiletextfield from the properties object
labNametextfield from the properties object
lab_plan_idtextfield from the properties object
locationtextThe geo-location where the resource lives
network_profiletextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
resource_operation_errortextfield from the properties object
roster_profiletextfield from the properties object
security_profiletextfield from the properties object
statetextfield from the properties object
subscriptionIdtextfield from the properties object
system_datatextfield from the properties object
tagstextResource tags.
titletextfield from the properties object
virtual_machine_profiletextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTlabName, resourceGroupName, subscriptionIdReturns the properties of a lab resource.
list_by_resource_groupSELECTresourceGroupName, subscriptionIdReturns a list of all labs in a resource group.
list_by_subscriptionSELECTsubscriptionIdReturns a list of all labs for a subscription.
create_or_updateINSERTlabName, resourceGroupName, subscriptionId, data__propertiesOperation to create or update a lab resource.
deleteDELETElabName, resourceGroupName, subscriptionIdOperation to delete a lab resource.
updateUPDATElabName, resourceGroupName, subscriptionIdOperation to update a lab resource.
publishEXEClabName, resourceGroupName, subscriptionIdPublish or re-publish a lab. This will create or update all lab resources, such as virtual machines.
sync_groupEXEClabName, resourceGroupName, subscriptionIdAction used to manually kick off an AAD group sync job.

SELECT examples

Returns a list of all labs for a subscription.

SELECT
description,
auto_shutdown_profile,
connection_profile,
labName,
lab_plan_id,
location,
network_profile,
provisioning_state,
resourceGroupName,
resource_operation_error,
roster_profile,
security_profile,
state,
subscriptionId,
system_data,
tags,
title,
virtual_machine_profile
FROM azure.lab_services.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.lab_services.labs (
labName,
resourceGroupName,
subscriptionId,
data__properties,
tags,
location,
properties
)
SELECT
'{{ labName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ data__properties }}',
'{{ tags }}',
'{{ location }}',
'{{ properties }}'
;

UPDATE example

Updates a labs resource.

/*+ update */
UPDATE azure.lab_services.labs
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
labName = '{{ labName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified labs resource.

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