Skip to main content

labs

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

Overview

Namelabs
TypeResource
Idazure_extras.lab_services.labs

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.
autoShutdownProfileobjectThe resource auto shutdown configuration for the lab. This controls whether actions are taken on resources that are sitting idle.
connectionProfileobjectThe connection profile for the lab. This controls settings such as web access to lab resources or whether RDP or SSH ports are open.
descriptionstringThe description of the lab.
labPlanIdstringThe ID of the lab plan. Used during resource creation to provide defaults and acts as a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides organization..
locationstringThe geo-location where the resource lives. Required.
networkProfileobjectThe network profile for the lab, typically applied via a lab plan. This profile cannot be modified once a lab has been created.
provisioningStatestringCurrent provisioning state of the lab. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Locked".
rosterProfileobjectThe lab user list management profile.
securityProfileobjectThe lab security profile.
statestringThe lab state. Known values are: "Draft", "Publishing", "Scaling", "Syncing", and "Published".
systemDataobjectMetadata pertaining to creation and last modification of the lab.
tagsobjectResource tags.
titlestringThe title of the lab.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
virtualMachineProfileobjectThe profile used for creating lab virtual machines.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, lab_name, subscription_idGet a lab resource. Returns the properties of a lab resource.
list_by_resource_groupselectresource_group_name, subscription_idGet all labs for a subscription and resource group. Returns a list of all labs in a resource group.
list_by_subscriptionselectsubscription_id$filterGet all labs for a subscription. Returns a list of all labs for a subscription.
create_or_updateinsertresource_group_name, lab_name, subscription_id, locationCreate or update a lab resource. Operation to create or update a lab resource.
updateupdateresource_group_name, lab_name, subscription_idUpdate a lab resource. Operation to update a lab resource.
create_or_updatereplaceresource_group_name, lab_name, subscription_id, locationCreate or update a lab resource. Operation to create or update a lab resource.
deletedeleteresource_group_name, lab_name, subscription_idDeletes a lab resource. Operation to delete a lab resource.
publishexecresource_group_name, lab_name, subscription_idPublish or re-publish a lab. Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines.
sync_groupexecresource_group_name, lab_name, subscription_idManually sync the lab group. Action used to manually kick off an AAD group sync job.

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
lab_namestringThe name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
$filterstringThe filter to apply to the operation. Default value is None.

SELECT examples

Get a lab resource. Returns the properties of a lab resource.

SELECT
id,
name,
autoShutdownProfile,
connectionProfile,
description,
labPlanId,
location,
networkProfile,
provisioningState,
rosterProfile,
securityProfile,
state,
systemData,
tags,
title,
type,
virtualMachineProfile
FROM azure_extras.lab_services.labs
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND lab_name = '{{ lab_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or update a lab resource. Operation to create or update a lab resource.

INSERT INTO azure_extras.lab_services.labs (
tags,
location,
properties,
resource_group_name,
lab_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ resource_group_name }}',
'{{ lab_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;

UPDATE examples

Update a lab resource. Operation to update a lab resource.

UPDATE azure_extras.lab_services.labs
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;

REPLACE examples

Create or update a lab resource. Operation to create or update a lab resource.

REPLACE azure_extras.lab_services.labs
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;

DELETE examples

Deletes a lab resource. Operation to delete a lab resource.

DELETE FROM azure_extras.lab_services.labs
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Publish or re-publish a lab. Publish or re-publish a lab. This will create or update all lab resources, such as virtual machines.

EXEC azure_extras.lab_services.labs.publish 
@resource_group_name='{{ resource_group_name }}' --required,
@lab_name='{{ lab_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;