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_id
optional computed - string -
default_premium_storage_account_id
optional computed - string -
default_storage_account_id
optional computed - string -
id
optional computed - string -
key_vault_id
optional computed - string -
location
required - string -
name
required - string -
premium_data_disk_storage_account_id
optional computed - string -
resource_group_name
required - string -
storage_type
optional - string -
tags
optional - map from string to string -
unique_identifier
optional computed - string -
timeouts
single 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
apiVersion
required - stringlocation
optional - stringThe location of the resource.
name
required - stringThe name of the lab.
properties
requiredannouncement
optionalenabled
optional - stringIs the lab announcement active/enabled at this time?.
expirationDate
optional - stringThe time at which the announcement expires (null for never)
expired
optional - booleanHas this announcement expired?
markdown
optional - stringThe markdown text (if any) that this lab displays in the UI. If left empty/null, nothing will be shown.
title
optional - stringThe plain text title for the lab announcement
environmentPermission
optional - stringThe access rights to be granted to the user when provisioning an environment.
extendedProperties
optional - stringExtended properties of the lab used for experimental features
labStorageType
optional - stringType of storage used by the lab. It can be either Premium or Standard. Default is Premium.
mandatoryArtifactsResourceIdsLinux
optional - 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.
mandatoryArtifactsResourceIdsWindows
optional - 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.
premiumDataDisks
optional - 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.
support
optionalenabled
optional - stringIs the lab support banner active/enabled at this time?.
markdown
optional - stringThe markdown text (if any) that this lab displays in the UI. If left empty/null, nothing will be shown.
tags
optional - stringThe tags of the resource.
type
required - 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.