Azure Dev Test Virtual Network

This page shows how to write Terraform and Azure Resource Manager for Dev Test Virtual Network and write them securely.

azurerm_dev_test_virtual_network (Terraform)

The Virtual Network in Dev Test can be configured in Terraform with the resource name azurerm_dev_test_virtual_network. The following sections describe 4 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L7
resource "azurerm_dev_test_virtual_network" "this" {
  description         = var.description
  lab_name            = var.lab_name
  name                = var.name
  resource_group_name = var.resource_group_name
  tags                = var.tags
main.tf#L7
resource "azurerm_dev_test_virtual_network" "this" {
  description         = var.description
  lab_name            = var.lab_name
  name                = var.name
  resource_group_name = var.resource_group_name
  tags                = var.tags
network.tf#L2
resource "azurerm_dev_test_virtual_network" "lab" {
  name                = var.lab_virtual_network_name
  lab_name            = azurerm_dev_test_lab.lab.name
  resource_group_name = azurerm_resource_group.lab.name

  subnet {
main.tf#L38
resource "azurerm_dev_test_virtual_network" "main" {
  name                = format("%s-network", var.dev_test_lab_settings.name)
  resource_group_name = local.resource_group_name
  lab_name            = azurerm_dev_test_lab.main.name
  description         = var.dev_test_lab_settings.description
  subnet {

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Virtual Network within a DevTest Lab.

Microsoft.DevTestLab/labs/virtualnetworks (Azure Resource Manager)

The labs/virtualnetworks in Microsoft.DevTestLab can be configured in Azure Resource Manager with the resource name Microsoft.DevTestLab/labs/virtualnetworks. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

10-subnet-override.json
{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "devTestLabsName": {
template.json
{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "labs_coursapi_name": {

Parameters

  • apiVersion required - string
  • location optional - string

    The location of the resource.

  • name required - string

    The name of the virtual network.

  • properties required
      • allowedSubnets optional array
          • allowPublicIp optional - string

            The permission policy of the subnet for allowing public IP addresses (i.e. Allow, Deny)).

          • labSubnetName optional - string

            The name of the subnet as seen in the lab.

          • resourceId optional - string

            The resource ID of the subnet.

      • description optional - string

        The description of the virtual network.

      • externalProviderResourceId optional - string

        The Microsoft.Network resource identifier of the virtual network.

      • subnetOverrides optional array
          • labSubnetName optional - string

            The name given to the subnet within the lab.

          • resourceId optional - string

            The resource ID of the subnet.

          • sharedPublicIpAddressConfiguration optional
              • allowedPorts optional array
                  • backendPort optional - integer

                    Backend port of the target virtual machine.

                  • transportProtocol optional - string

                    Protocol type of the port.

          • useInVmCreationPermission optional - string

            Indicates whether this subnet can be used during virtual machine creation (i.e. Allow, Deny).

          • usePublicIpAddressPermission optional - string

            Indicates whether public IP addresses can be assigned to virtual machines on this subnet (i.e. Allow, Deny).

          • virtualNetworkPoolName optional - string

            The virtual network pool associated with this subnet.

  • tags optional - string

    The tags of the resource.

  • type required - string

Frequently asked questions

What is Azure Dev Test Virtual Network?

Azure Dev Test Virtual Network 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 Virtual Network?

For Terraform, the kevinhead/azurerm, niveklabs/azurerm and faroukfriha/azure-as-code source code examples are useful. See the Terraform Example section for further details.

For Azure Resource Manager, the 0x6797/azure-rm-templates and mikenelson-io/DevTestLabs source code examples are useful. See the Azure Resource Manager Example section for further details.