Create and add virtual machines to a lab in Azure DevTest Labs
This article walks you through on how to create and add Azure virtual machines (VMs) to a lab in your existing DevTest Labs using the Azure portal.
Create and add virtual machines
Sign in to the Azure portal.
Navigate to your lab in DevTest Labs.
On the Overview page, select + Add.
On the Choose a base page, select a marketplace image for the VM. This guide use Windows 11 Pro. Certain options may differ if you use a different image.
From the Basics Settings tab, provide the following information:
Property Description Virtual machine name The text box is pre-filled with a unique autogenerated name. The name corresponds to the user name within your email address followed by a unique three-digit number. Leave as-is, or enter a unique name of your choosing. User Name The text box is pre-filled with a unique autogenerated name. The name corresponds to the user name within your email address. Leave as-is, or enter a name of your choosing. The user is granted administrator privileges on the virtual machine. Use a saved secret For this walk-through, leave the box unchecked. You can save secrets in Azure Key Vault first and then use it here. For more information, see Store secrets in a key vault. If you prefer to use a saved secret, check the box and then select the secret from the Secret drop-down list. Password Enter a password between 8 and 123 characters long. Save as default password Select the checkbox to save the password in the Azure Key Vault associated with the lab. Virtual machine size Keep the default value or select Change Size to select different physical components. This walk-through uses Standard_B2. OS disk type Keep the default value or select a different option from the drop-down list. Artifacts Select Add or Remove Artifacts. Select and configure the artifacts that you want to add to the base image. Each lab includes artifacts from the Public DevTest Labs Artifact Repository and artifacts that you've created and added to your own Artifact Repository. For expanded instructions, see Add artifacts during installation, further below.
Select the Advanced Settings tab and provide the following information:
Property Description Virtual network Leave as-is or select a different network from the drop-down list. Subnet Selector Leave as-is or select a different subnet from the drop-down list. IP address For this walk-through, leave the default value Shared. Expiration date Leave as is for no expiration date, or select the calendar icon to set an expiration date. Make this machine claimable To make the VM claimable by a lab user, select Yes. Marking the machine as claimable means that it won't be assigned ownership at the time of creation. This walk-through selects Yes. Number of instances For this walk-through, enter 2. The number of virtual machine instances to be created. Automation Optional. Selecting View ARM Template will open the template in a new page. You can copy and save the template to create the same virtual machine later. Once saved, you can use the Azure Resource Manager template to deploy new VMs with Azure PowerShell.
Return to the Basic Settings tab and then select Create.
From the DevTest Lab page, under My Lab, select Claimable virtual machines.
After a few minutes, select Refresh if your virtual machines don't appear. Installations times will vary based on the selected hardware, base image, and artifact(s). The installation for the configurations used in this walk-through was approximately 25 minutes.
Add artifacts during installation
These steps are expanded instructions from the prior section. The steps begin after you've selected Add or Remove Artifacts from the Basic Settings tab. For more information on artifacts, see Learn how to author your own artifacts for use with DevTest Labs.
From the Add artifacts page, identify an artifact, and then select > (greater-than symbol). Then select OK.
Select another artifact: Install PowerShell Module. This artifact requires additional information, specifically, the name of a PowerShell module. Enter Az, and then select OK.
Continue adding artifacts as needed for your VM.
Select ... (ellipsis) from one of your selected artifacts and note the various options, including the ability to change the install order.
When you're done adding artifacts, select OK to return to the Basic Settings tab.
Add artifacts after installation
You can also add artifacts after the VM has been created.
From the DevTest Lab page, under My Lab, select All resources. All resources will list both claimed and unclaimed VMs.
Select your VM once the Status shows Available.
From your virtual machine page, select Start to start the VM.
A few moments after the page shows Running, then under Operations, select Artifacts.
Select Apply artifacts to open the Add artifacts page.
From here, the steps are basically the same as from Add artifacts during installation, above.
Next steps
- Once the VM has been created, you can connect to the VM by selecting Connect on the VM's pane.
- Learn how to create custom artifacts for your DevTest Labs VM.
- Explore the DevTest Labs Azure Resource Manager QuickStart template gallery.