labs
Creates, updates, deletes, gets or lists a labs resource.
Overview
| Name | labs |
| Type | Resource |
| Id | azure.dev_test_labs.labs |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_resource_group
- list_by_subscription
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier of the resource. |
name | string | The name of the resource. |
announcement | object | The properties of any lab announcement associated with this lab. |
artifactsStorageAccount | string | The lab's artifact storage account. |
createdDate | string (date-time) | The creation date of the lab. |
defaultPremiumStorageAccount | string | The lab's default premium storage account. |
defaultStorageAccount | string | The lab's default storage account. |
environmentPermission | string | The access rights to be granted to the user when provisioning an environment. Known values are: "Reader" and "Contributor". |
extendedProperties | object | Extended properties of the lab used for experimental features. |
labStorageType | string | Type of storage used by the lab. It can be either Premium or Standard. Default is Premium. Known values are: "Standard", "Premium", and "StandardSSD". |
loadBalancerId | string | The load balancer used to for lab VMs that use shared IP address. |
location | string | The location of the resource. |
mandatoryArtifactsResourceIdsLinux | array | The 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. |
mandatoryArtifactsResourceIdsWindows | array | The 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. |
networkSecurityGroupId | string | The Network Security Group attached to the lab VMs Network interfaces to restrict open ports. |
premiumDataDiskStorageAccount | string | The lab's premium data disk storage account. |
premiumDataDisks | string | The 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". |
provisioningState | string | The provisioning status of the resource. |
publicIpId | string | The public IP address for the lab's load balancer. |
support | object | The properties of any lab support message associated with this lab. |
tags | object | The tags of the resource. |
type | string | The type of the resource. |
uniqueIdentifier | string | The unique immutable identifier of a resource (Guid). |
vaultName | string | The lab's Key vault. |
vmCreationResourceGroup | string | The 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. |
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier of the resource. |
name | string | The name of the resource. |
announcement | object | The properties of any lab announcement associated with this lab. |
artifactsStorageAccount | string | The lab's artifact storage account. |
createdDate | string (date-time) | The creation date of the lab. |
defaultPremiumStorageAccount | string | The lab's default premium storage account. |
defaultStorageAccount | string | The lab's default storage account. |
environmentPermission | string | The access rights to be granted to the user when provisioning an environment. Known values are: "Reader" and "Contributor". |
extendedProperties | object | Extended properties of the lab used for experimental features. |
labStorageType | string | Type of storage used by the lab. It can be either Premium or Standard. Default is Premium. Known values are: "Standard", "Premium", and "StandardSSD". |
loadBalancerId | string | The load balancer used to for lab VMs that use shared IP address. |
location | string | The location of the resource. |
mandatoryArtifactsResourceIdsLinux | array | The 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. |
mandatoryArtifactsResourceIdsWindows | array | The 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. |
networkSecurityGroupId | string | The Network Security Group attached to the lab VMs Network interfaces to restrict open ports. |
premiumDataDiskStorageAccount | string | The lab's premium data disk storage account. |
premiumDataDisks | string | The 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". |
provisioningState | string | The provisioning status of the resource. |
publicIpId | string | The public IP address for the lab's load balancer. |
support | object | The properties of any lab support message associated with this lab. |
tags | object | The tags of the resource. |
type | string | The type of the resource. |
uniqueIdentifier | string | The unique immutable identifier of a resource (Guid). |
vaultName | string | The lab's Key vault. |
vmCreationResourceGroup | string | The 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. |
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier of the resource. |
name | string | The name of the resource. |
announcement | object | The properties of any lab announcement associated with this lab. |
artifactsStorageAccount | string | The lab's artifact storage account. |
createdDate | string (date-time) | The creation date of the lab. |
defaultPremiumStorageAccount | string | The lab's default premium storage account. |
defaultStorageAccount | string | The lab's default storage account. |
environmentPermission | string | The access rights to be granted to the user when provisioning an environment. Known values are: "Reader" and "Contributor". |
extendedProperties | object | Extended properties of the lab used for experimental features. |
labStorageType | string | Type of storage used by the lab. It can be either Premium or Standard. Default is Premium. Known values are: "Standard", "Premium", and "StandardSSD". |
loadBalancerId | string | The load balancer used to for lab VMs that use shared IP address. |
location | string | The location of the resource. |
mandatoryArtifactsResourceIdsLinux | array | The 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. |
mandatoryArtifactsResourceIdsWindows | array | The 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. |
networkSecurityGroupId | string | The Network Security Group attached to the lab VMs Network interfaces to restrict open ports. |
premiumDataDiskStorageAccount | string | The lab's premium data disk storage account. |
premiumDataDisks | string | The 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". |
provisioningState | string | The provisioning status of the resource. |
publicIpId | string | The public IP address for the lab's load balancer. |
support | object | The properties of any lab support message associated with this lab. |
tags | object | The tags of the resource. |
type | string | The type of the resource. |
uniqueIdentifier | string | The unique immutable identifier of a resource (Guid). |
vaultName | string | The lab's Key vault. |
vmCreationResourceGroup | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, name, subscription_id | $expand | Get lab. |
list_by_resource_group | select | resource_group_name, subscription_id | $expand, $filter, $top, $orderby | List labs in a resource group. |
list_by_subscription | select | subscription_id | $expand, $filter, $top, $orderby | List labs in a subscription. |
create_or_update | insert | resource_group_name, name, subscription_id | Create or replace an existing lab. This operation can take a while to complete. | |
update | update | resource_group_name, name, subscription_id | Allows modifying tags of labs. All other properties will be ignored. | |
create_or_update | replace | resource_group_name, name, subscription_id | Create or replace an existing lab. This operation can take a while to complete. | |
delete | delete | resource_group_name, name, subscription_id | Delete lab. This operation can take a while to complete. | |
list_vhds | exec | resource_group_name, name, subscription_id | List disk images available for custom image creation. | |
claim_any_vm | exec | resource_group_name, name, subscription_id | Claim a random claimable virtual machine in the lab. This operation can take a while to complete. | |
create_environment | exec | resource_group_name, name, subscription_id | Create virtual machines in a lab. This operation can take a while to complete. | |
export_resource_usage | exec | resource_group_name, name, subscription_id | Exports the lab resource usage into a storage account This operation can take a while to complete. | |
generate_upload_uri | exec | resource_group_name, name, subscription_id | Generate a URI for uploading custom disk images to a Lab. | |
import_virtual_machine | exec | resource_group_name, name, subscription_id | Import 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.
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the lab. Required. |
resource_group_name | string | The name of the resource group. Required. |
subscription_id | string | |
$expand | string | Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'. Default value is None. |
$filter | string | The filter to apply to the operation. Example: '$filter=contains(name,'myName'). Default value is None. |
$orderby | string | The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. Default value is None. |
$top | integer | The maximum number of resources to return from the operation. Example: '$top=10'. Default value is None. |
SELECT examples
- get
- list_by_resource_group
- list_by_subscription
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 }}'
;
List labs in a resource group.
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 subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $orderby = '{{ $orderby }}'
;
List labs in a subscription.
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 subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $orderby = '{{ $orderby }}'
;
INSERT examples
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: labs
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the labs resource.
- name: name
value: "{{ name }}"
description: Required parameter for the labs resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the labs resource.
- name: location
value: "{{ location }}"
description: |
The location of the resource.
- name: tags
value: "{{ tags }}"
description: |
The tags of the resource.
- name: properties
value:
labStorageType: "{{ labStorageType }}"
mandatoryArtifactsResourceIdsLinux:
- "{{ mandatoryArtifactsResourceIdsLinux }}"
mandatoryArtifactsResourceIdsWindows:
- "{{ mandatoryArtifactsResourceIdsWindows }}"
premiumDataDisks: "{{ premiumDataDisks }}"
environmentPermission: "{{ environmentPermission }}"
announcement:
title: "{{ title }}"
markdown: "{{ markdown }}"
enabled: "{{ enabled }}"
expirationDate: "{{ expirationDate }}"
expired: {{ expired }}
provisioningState: "{{ provisioningState }}"
uniqueIdentifier: "{{ uniqueIdentifier }}"
support:
enabled: "{{ enabled }}"
markdown: "{{ markdown }}"
extendedProperties: "{{ extendedProperties }}"
UPDATE examples
- update
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_update
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
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_vhds
- claim_any_vm
- create_environment
- export_resource_usage
- generate_upload_uri
- import_virtual_machine
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
;
Claim a random claimable virtual machine in the lab. This operation can take a while to complete.
EXEC azure.dev_test_labs.labs.claim_any_vm
@resource_group_name='{{ resource_group_name }}' --required,
@name='{{ name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Create virtual machines in a lab. This operation can take a while to complete.
EXEC azure.dev_test_labs.labs.create_environment
@resource_group_name='{{ resource_group_name }}' --required,
@name='{{ name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"name": "{{ name }}",
"location": "{{ location }}",
"tags": "{{ tags }}",
"properties": "{{ properties }}"
}'
;
Exports the lab resource usage into a storage account This operation can take a while to complete.
EXEC azure.dev_test_labs.labs.export_resource_usage
@resource_group_name='{{ resource_group_name }}' --required,
@name='{{ name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Generate a URI for uploading custom disk images to a Lab.
EXEC azure.dev_test_labs.labs.generate_upload_uri
@resource_group_name='{{ resource_group_name }}' --required,
@name='{{ name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Import a virtual machine into a different lab. This operation can take a while to complete.
EXEC azure.dev_test_labs.labs.import_virtual_machine
@resource_group_name='{{ resource_group_name }}' --required,
@name='{{ name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;