Azure Dev Test Lab
This page shows how to write Terraform and Azure Resource Manager for Dev Test Lab and write them securely.
azurerm_dev_test_lab (Terraform)
The Lab in Dev Test can be configured in Terraform with the resource name azurerm_dev_test_lab. The following sections describe 8 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_dev_test_lab" "default" {
name = var.name
resource_group_name = var.resource_group_name
location = var.location
storage_type = var.storage_type
tags = var.tags
resource "azurerm_dev_test_lab" "lab" {
location = azurerm_resource_group.rg.location
name = var.dev_test_lab_name
resource_group_name = azurerm_resource_group.rg.name
tags = module.tags.tags
}
resource "azurerm_dev_test_lab" "lab" {
name = var.lab_name
location = azurerm_resource_group.lab.location
resource_group_name = azurerm_resource_group.lab.name
resource "azurerm_dev_test_lab" "this" {
location = var.location
name = var.name
resource_group_name = var.resource_group_name
storage_type = var.storage_type
tags = var.tags
resource "azurerm_dev_test_lab" "this" {
location = var.location
name = var.name
resource_group_name = var.resource_group_name
storage_type = var.storage_type
tags = var.tags
resource "azurerm_dev_test_lab" "ds-dtl" {
name = "ds-devtestlab"
location = azurerm_resource_group.dtl-rg.location
resource_group_name = azurerm_resource_group.dtl-rg.name
resource "azurerm_dev_test_lab" "ds-dtl" {
name = "ds-devtestlab"
location = azurerm_resource_group.dtl-rg.location
resource_group_name = azurerm_resource_group.dtl-rg.name
resource "azurerm_dev_test_lab" "main" {
name = format("%s", var.dev_test_lab_settings.name)
resource_group_name = local.resource_group_name
location = local.location
storage_type = var.dev_test_lab_settings.storage_type
tags = merge({ "Name" = format("%s", var.dev_test_lab_settings.name) }, var.tags, )
Parameters
-
artifacts_storage_account_idoptional computed - string -
default_premium_storage_account_idoptional computed - string -
default_storage_account_idoptional computed - string -
idoptional computed - string -
key_vault_idoptional computed - string -
locationrequired - string -
namerequired - string -
premium_data_disk_storage_account_idoptional computed - string -
resource_group_namerequired - string -
storage_typeoptional - string -
tagsoptional - map from string to string -
unique_identifieroptional computed - string -
timeoutssingle block
Explanation in Terraform Registry
Manages a Dev Test Lab.
Microsoft.DevTestLab/labs (Azure Resource Manager)
The labs in Microsoft.DevTestLab can be configured in Azure Resource Manager with the resource name Microsoft.DevTestLab/labs. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
"type": "Microsoft.DevTestLab/labs",
"name": "[parameters('newLabName')]",
"location": "[resourceGroup().location]",
"properties": {
"labStorageType":"Standard"
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"labs_coursapi_name": {
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"labs_lab1_name": {
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"labs_lab1_name": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"devTestLabsName": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"admin": {
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"labs_coursapi_name": {
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"existingLabName": {
"type": "Microsoft.DevTestLab/labs",
"location": "[parameters('regionId')]",
"properties": {
"labStorageType": "Premium"
},
"resources": [
"type": "Microsoft.DevTestLab/labs",
"location": "[parameters('regionId')]",
"properties": {
"labStorageType": "Premium"
},
"resources": [
Parameters
apiVersionrequired - stringlocationoptional - stringThe location of the resource.
namerequired - stringThe name of the lab.
propertiesrequiredannouncementoptionalenabledoptional - stringIs the lab announcement active/enabled at this time?.
expirationDateoptional - stringThe time at which the announcement expires (null for never)
expiredoptional - booleanHas this announcement expired?
markdownoptional - stringThe markdown text (if any) that this lab displays in the UI. If left empty/null, nothing will be shown.
titleoptional - stringThe plain text title for the lab announcement
environmentPermissionoptional - stringThe access rights to be granted to the user when provisioning an environment.
extendedPropertiesoptional - stringExtended properties of the lab used for experimental features
labStorageTypeoptional - stringType of storage used by the lab. It can be either Premium or Standard. Default is Premium.
mandatoryArtifactsResourceIdsLinuxoptional - arrayThe 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.
mandatoryArtifactsResourceIdsWindowsoptional - arrayThe 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.
premiumDataDisksoptional - stringThe 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.
supportoptionalenabledoptional - stringIs the lab support banner active/enabled at this time?.
markdownoptional - stringThe markdown text (if any) that this lab displays in the UI. If left empty/null, nothing will be shown.
tagsoptional - stringThe tags of the resource.
typerequired - string
Frequently asked questions
What is Azure Dev Test Lab?
Azure Dev Test Lab is a resource for Dev Test of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Dev Test Lab?
For Terraform, the vijay-project/terra_action, cjthorpe/terraform-azure-code and faroukfriha/azure-as-code source code examples are useful. See the Terraform Example section for further details.
For Azure Resource Manager, the mikenelson-io/DevTestLabs, mikenelson-io/DevTestLabs and henrikmotzkus/AzureShortcuts source code examples are useful. See the Azure Resource Manager Example section for further details.