Tutorial: Set up a lab in DevTest Labs using the Azure portal

In this tutorial, you create a lab by using the Azure portal. A lab admin sets up a lab in an organization, creates Azure virtual machines (VMs) in the lab, and configures policies. Lab users (for example: developer and testers) claim VMs in the lab, connect to them, and use them.

In this tutorial, you learn how to:

  • Create a lab
  • Add an Azure virtual machine (VM) to the lab
  • Add a user and assign it to the DevTest Labs User role

If you don't have an Azure subscription, create a free account before you begin.

Create a lab

These steps illustrate how to use the Azure portal to create a lab in Azure DevTest Labs.

  1. Sign in to the Azure portal.

  2. Enter DevTest Labs in the search text box, and then select DevTest Labs from the results.

    Screenshot of portal search for DevTest Labs.

  3. On the DevTest Labs page, select + Create.

  4. On the Create Devtest Lab page, under the Basic Settings tab, provide the following information:

    Property Description
    Subscription From the drop-down list, select the Azure subscription to be used for the lab.
    Resource group From the drop-down list, select your existing resource group, or select Create new.
    Lab name Enter a name for the lab.
    Location From the drop-down list, select a location that's used for the lab.
    Public environments Leave the default value of On. Public environment repository contains a list of curated Azure Resource Manager templates that enable lab users to create PaaS resources within Labs.

    Screenshot of Basic Settings tab for Create DevTest Labs.

  5. Select Review + create to validate the configuration, and then select Create. For this tutorial, the default values for the other tabs are sufficient.

  6. After the creation process finishes, from the deployment notification, select Go to resource.

    Screenshot of DevTest Labs deployment notification.

  7. The lab's Overview page looks similar to the following image:

    Screenshot of DevTest Labs overview page.

Add a VM to the lab

  1. On the DevTest Lab page, select + Add on the toolbar.

    Screenshot of DevTest Labs overview page and add button.

  2. On the Choose a base page, select a marketplace image for the VM. This guide use Windows Server 2019 Datacenter. Certain options may differ if you use a different image.

  3. 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_D4_v3.
    OS disk type Keep the default value or select a different option from the drop-down list.
    Artifacts Not used for this tutorial.

    Screenshot of virtual machine basic settings page.

  4. 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. When Shared is selected, Azure DevTest Labs automatically enables RDP for Windows VMs and SSH for Linux VMs. If you select Public, RDP and SSH are enabled without any changes from DevTest Labs.
    Expiration date Leave as is for no expiration date, or select the calendar icon to set an expiration date.
    Make this machine claimable Leave as is at No. 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.
    Number of instances Leave as-is at 1. 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.

    Virtual machine advanced settings page.

  5. Return to the Basic Settings tab and then select Create.

  6. You're returned to the DevTest Lab page. Under My Lab, select Claimable virtual machines.

    Screenshot of lab VM creation status page.

  7. After a few minutes, select Refresh if your virtual machines don't appear. Installation 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 12 minutes.

Add a user to the DevTest Labs User role

  1. Navigate to the resource group that contains the lab you created. You must be User Access Administrator or Owner.

  2. In the left menu, select Access control (IAM).

  3. Select + Add > Add role assignment.

    Access control (IAM) page with Add role assignment menu open.

  4. On the Role tab, select the DevTest Labs User role.

    Add role assignment page with Role tab selected.

  5. On the Members tab, select the user you want to assign the role to.

  6. On the Review + assign tab, select Review + assign to assign the role.

Clean up resources

Delete resources to avoid charges for running the lab and VM on Azure. If you plan to go through the next tutorial to access the VM in the lab, you can clean up the resources after you finish that tutorial. Otherwise, follow these steps:

  1. Return to the home page for the lab you created.

  2. From the top menu, select Delete.

    Screenshot of lab delete button.

  3. On the Are you sure you want to delete it page, enter the lab name in the text box and then select Delete.

  4. During the deletion, you can select Notifications at the top of your screen to view progress. Deleting the lab takes a while. Continue to the next step once the lab is deleted.

  5. If you created the lab in an existing resource group, then all of the lab resources have been removed. If you created a new resource group for this tutorial, it's now empty and can be deleted. It wouldn't have been possible to have deleted the resource group earlier while the lab was still in it.

Next steps

In this tutorial, you: created a lab, added a VM, and then gave a user access to the lab. To learn about how to access the lab as a lab user, advance to the next tutorial: