Azure Dev Test Windows Virtual Machine
This page shows how to write Terraform and Azure Resource Manager for Dev Test Windows Virtual Machine and write them securely.
azurerm_dev_test_windows_virtual_machine (Terraform)
The Windows Virtual Machine in Dev Test can be configured in Terraform with the resource name azurerm_dev_test_windows_virtual_machine. The following sections describe 4 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_dev_test_windows_virtual_machine" "example" {
name = "example-vm01"
resource_group_name = “my-resources”
location = azurerm_resource_group.example.location
size = "Standard_DS2"
username = "exampleuser99"
resource "azurerm_dev_test_windows_virtual_machine" "this" {
allow_claim = var.allow_claim
disallow_public_ip_address = var.disallow_public_ip_address
lab_name = var.lab_name
lab_subnet_name = var.lab_subnet_name
lab_virtual_network_id = var.lab_virtual_network_id
resource "azurerm_dev_test_windows_virtual_machine" "this" {
allow_claim = var.allow_claim
disallow_public_ip_address = var.disallow_public_ip_address
lab_name = var.lab_name
lab_subnet_name = var.lab_subnet_name
lab_virtual_network_id = var.lab_virtual_network_id
resource "azurerm_dev_test_windows_virtual_machine" "main" {
for_each = var.windows_virtual_machine != null ? { for k, v in var.windows_virtual_machine : k => v if v != null } : {}
name = substr(each.key, 0, 15) # Charcter lengh for linux - 62 and windows - 15
lab_name = azurerm_dev_test_lab.main.name
resource_group_name = local.resource_group_name
location = local.location
Parameters
-
allow_claimoptional - bool -
disallow_public_ip_addressoptional - bool -
fqdnoptional computed - string -
idoptional computed - string -
lab_namerequired - string -
lab_subnet_namerequired - string -
lab_virtual_network_idrequired - string -
locationrequired - string -
namerequired - string -
notesoptional - string -
passwordrequired - string -
resource_group_namerequired - string -
sizerequired - string -
storage_typerequired - string -
tagsoptional - map from string to string -
unique_identifieroptional computed - string -
usernamerequired - string -
gallery_image_referencelist block -
inbound_nat_ruleset block-
backend_portrequired - number -
frontend_portoptional computed - number -
protocolrequired - string
-
-
timeoutssingle block
Explanation in Terraform Registry
Manages a Windows Virtual Machine within a Dev Test Lab.
Microsoft.DevTestLab/labs/virtualmachines (Azure Resource Manager)
The labs/virtualmachines in Microsoft.DevTestLab can be configured in Azure Resource Manager with the resource name Microsoft.DevTestLab/labs/virtualmachines. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"labs_lab1_name": {
Parameters
apiVersionrequired - stringlocationoptional - stringThe location of the resource.
namerequired - stringThe name of the virtual machine.
propertiesrequiredallowClaimoptional - booleanIndicates whether another user can take ownership of the virtual machine
artifactsoptional arrayartifactIdoptional - stringThe artifact's identifier.
artifactTitleoptional - stringThe artifact's title.
deploymentStatusMessageoptional - stringThe status message from the deployment.
installTimeoptional - stringThe time that the artifact starts to install on the virtual machine.
parametersoptional arraynameoptional - stringThe name of the artifact parameter.
valueoptional - stringThe value of the artifact parameter.
statusoptional - stringThe status of the artifact.
vmExtensionStatusMessageoptional - stringThe status message from the virtual machine extension.
createdDateoptional - stringThe creation date of the virtual machine.
customImageIdoptional - stringThe custom image identifier of the virtual machine.
dataDiskParametersoptional arrayattachNewDataDiskOptionsoptionaldiskNameoptional - stringThe name of the disk to be attached.
diskSizeGiBoptional - integerSize of the disk to be attached in Gibibytes.
diskTypeoptional - stringThe storage type for the disk (i.e. Standard, Premium).
existingLabDiskIdoptional - stringSpecifies the existing lab disk id to attach to virtual machine.
hostCachingoptional - stringCaching option for a data disk (i.e. None, ReadOnly, ReadWrite).
disallowPublicIpAddressoptional - booleanIndicates whether the virtual machine is to be created without a public IP address.
environmentIdoptional - stringThe resource ID of the environment that contains this virtual machine, if any.
expirationDateoptional - stringThe expiration date for VM.
galleryImageReferenceoptionalofferoptional - stringThe offer of the gallery image.
osTypeoptional - stringThe OS type of the gallery image.
publisheroptional - stringThe publisher of the gallery image.
skuoptional - stringThe SKU of the gallery image.
versionoptional - stringThe version of the gallery image.
isAuthenticationWithSshKeyoptional - booleanIndicates whether this virtual machine uses an SSH key for authentication.
labSubnetNameoptional - stringThe lab subnet name of the virtual machine.
labVirtualNetworkIdoptional - stringThe lab virtual network identifier of the virtual machine.
networkInterfaceoptionaldnsNameoptional - stringThe DNS name.
privateIpAddressoptional - stringThe private IP address.
publicIpAddressoptional - stringThe public IP address.
publicIpAddressIdoptional - stringThe resource ID of the public IP address.
rdpAuthorityoptional - stringThe RdpAuthority property is a server DNS host name or IP address followed by the service port number for RDP (Remote Desktop Protocol).
sharedPublicIpAddressConfigurationoptionalinboundNatRulesoptional arraybackendPortoptional - integerThe port to which the external traffic will be redirected.
frontendPortoptional - integerThe external endpoint port of the inbound connection. Possible values range between 1 and 65535, inclusive. If unspecified, a value will be allocated automatically.
transportProtocoloptional - stringThe transport protocol for the endpoint.
sshAuthorityoptional - stringThe SshAuthority property is a server DNS host name or IP address followed by the service port number for SSH.
subnetIdoptional - stringThe resource ID of the sub net.
virtualNetworkIdoptional - stringThe resource ID of the virtual network.
notesoptional - stringThe notes of the virtual machine.
ownerObjectIdoptional - stringThe object identifier of the owner of the virtual machine.
ownerUserPrincipalNameoptional - stringThe user principal name of the virtual machine owner.
passwordoptional - stringThe password of the virtual machine administrator.
planIdoptional - stringThe id of the plan associated with the virtual machine image
scheduleParametersoptional arraynameoptional - stringThe name of the virtual machine or environment
propertiesoptionaldailyRecurrenceoptionaltimeoptional - stringThe time of day the schedule will occur.
hourlyRecurrenceoptionalminuteoptional - integerMinutes of the hour the schedule will run.
notificationSettingsoptionalemailRecipientoptional - stringThe email recipient to send notifications to (can be a list of semi-colon separated email addresses).
notificationLocaleoptional - stringThe locale to use when sending a notification (fallback for unsupported languages is EN).
statusoptional - stringIf notifications are enabled for this schedule (i.e. Enabled, Disabled).
timeInMinutesoptional - integerTime in minutes before event at which notification will be sent.
webhookUrloptional - stringThe webhook URL to which the notification will be sent.
statusoptional - stringThe status of the schedule (i.e. Enabled, Disabled).
targetResourceIdoptional - stringThe resource ID to which the schedule belongs
taskTypeoptional - stringThe task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart).
timeZoneIdoptional - stringThe time zone ID (e.g. Pacific Standard time).
weeklyRecurrenceoptionaltimeoptional - stringThe time of the day the schedule will occur.
weekdaysoptional - arrayThe days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, etc.).
tagsoptional - stringThe tags of the resource.
sizeoptional - stringThe size of the virtual machine.
sshKeyoptional - stringThe SSH key of the virtual machine administrator.
storageTypeoptional - stringStorage type to use for virtual machine (i.e. Standard, Premium).
userNameoptional - stringThe user name of the virtual machine.
tagsoptional - stringThe tags of the resource.
typerequired - string
Frequently asked questions
What is Azure Dev Test Windows Virtual Machine?
Azure Dev Test Windows Virtual Machine 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 Windows Virtual Machine?
For Terraform, the ranibharti30/Assignments, niveklabs/azurerm and kevinhead/azurerm source code examples are useful. See the Terraform Example section for further details.
For Azure Resource Manager, the henrikmotzkus/AzureShortcuts source code example is useful. See the Azure Resource Manager Example section for further details.