Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

Tutorial: Create a lab and VM and add a user in DevTest Labs

Feedback

In this article

This tutorial shows Azure DevTest Labs administrators how to use the Azure portal to:

  • Create a lab in DevTest Labs.
  • Add an Azure virtual machine (VM) to the lab.
  • Add a user to the DevTest Labs User role.
  • Delete the lab resources when no longer needed.

If you're a developer, tester, or trainee, seeAccess a lab in Azure DevTest Labs to learn how to claim and connect to lab VMs.

Prerequisites

Create a lab

To create a lab, follow these steps. For more information, seeQuickstart: Create a lab in the Azure portal.

  1. In theAzure portal, search for and selectDevTest Labs.

    Screenshot of searching for DevTest Labs in the portal.

  2. On theDevTest Labs page, selectCreate. TheCreate DevTest Lab page appears.

  3. On theBasic Settings tab, provide the following information:

    • Subscription: Change the subscription if you want to use a different subscription for the lab.
    • Resource group: Select an existing resource group from the dropdown list, or selectCreate new to create a new resource group so it's easy to delete later.
    • Lab name: Enter a name for the lab.
    • Location: Change the location if you want to use a different Azure region for the lab.
    • Artifacts storage account access: You can select whether the lab uses a user-assigned managed identity or a shared key to access the lab storage account. To use a user-assigned managed identity, select it from the dropdown list. Otherwise, keep the option set toStorage account Shared Key.
    • Public environments: LeaveOn for access to theDevTest Labs public environment repository, or set toOff to disable access. For more information, seeEnable public environments when you create a lab.

    Screenshot of the Basic Settings tab of the lab creation form.

  4. Optionally, select theAuto-shutdown,Networking, andTags tabs at the top of the page, and customize those settings. You can also apply or change most of these settings after lab creation.

  5. After you complete all settings, selectReview + create.

  6. OnceSucceeded appears on theReview + create page, review the settings and then selectCreate.

    Tip

    SelectDownload a template for automation at the bottom of the page to view and download the lab configuration as an Azure Resource Manager (ARM) template. You can use the ARM template to create more labs. For more information, seeQuickstart: Use ARM templates to create labs in Azure DevTest Labs.

  7. After the lab creation process finishes, selectGo to resource from the deployment notification.

    Screenshot of the DevTest Labs deployment notification.

Add a VM to the lab

To add a VM to the lab, follow these steps. For more information, seeCreate lab virtual machines in Azure DevTest Labs.

  1. On the new lab'sOverview page, selectAdd on the toolbar.

    Screenshot of a lab Overview page with Add highlighted.

  2. On theChoose a base page, search for and select aWindows Server 2019 Datacenter base for the VM. Some of the following options might be different if you use a different image.

  3. On theBasic Settings tab of theCreate lab resource screen, provide the following information:

    • Virtual machine name: Keep the autogenerated name, or enter another unique VM name.
    • User name: Keep the autogenerated user name, or enter another user name to grant administrator privileges on the VM.
    • Use a saved secret: You can select this checkbox to use a secret from Azure Key Vault instead of a password to access the VM. For more information, seeStore secrets in a key vault. For this tutorial, deselect the checkbox.
    • Password: Enter a VM password between 8 and 123 characters long.
    • Save as default password: Select the checkbox to save the password in the Key Vault associated with the lab.
    • Virtual machine size: Keep the default value for the base, or selectChange Size to select a different size.
    • Allow hibernation: You can select this checkbox to enable hibernation for this VM. For this tutorial, keep the checkbox deselected.

      Note

      If you enable hibernation, you must also select eitherPublic orPrivate forIP Address in theAdvanced settings, because hibernation forShared IPs isn't currently supported.

    • OS disk type: You can select a disk type from the dropdown list. For this tutorial, keep the default value.
    • Artifacts: You can selectAdd or Remove Artifacts to select and configure artifacts to add to the VM. For more information, seeAdd artifacts.

    Screenshot of the Basic Settings tab for creating a VM.

  4. Optionally, select theAdvanced Settings tab to change any of the following settings:

    • Virtual network: Keep the default, or select a network from the dropdown list. For more information, seeAdd a virtual network.
    • Subnet: If necessary, select a different subnet from the dropdown list.
    • IP address: Leave atShared, or selectPublic orPrivate. For more information, seeUnderstand shared IP addresses.
    • Expiration date: Leave atWill not expire, orset an expiration date and time for the VM.
    • Make this machine claimable: The default ofNo keeps the VM creator as the owner of the VM. For this tutorial, selectYes to allow any lab user to claim the VM after creation. For more information, seeCreate and manage claimable VMs.
    • Number of instances: To create more than one VM with this configuration, enter the number of VMs to create.
    • View ARM template: Select this button to view and save the VM configuration as an Azure Resource Manager (ARM) template. You can use the ARM template todeploy new VMs.

    Screenshot of the Advanced Settings tab of lab resource creation page.

  5. You can also select theTags tab to apply tags to the VM. After you configure all settings, selectCreate at the bottom of the screen.

    During VM deployment, you can select theNotifications icon at the top of the screen to see progress. Creating a VM takes a while.

After the VM is created, selectClaimable virtual machines underMy Lab in the left navigation of the labOverview page to see the VM listed on theClaimable virtual machines page. SelectRefresh if the VM doesn't appear. To take ownership of a VM in the claimable list, seeUse a claimable VM.

Screenshot of the lab Claimable virtual machines page.

Add a user to the DevTest Labs User role

To add users to a lab, you must be aUser Access Administrator orOwner of the subscription the lab is in. For more information, seeAdd lab owners, contributors, and users in Azure DevTest Labs.

  1. On the lab'sOverview page in the Azure portal, underSettings, selectConfiguration and policies.

  2. On theConfiguration and policies page, selectAccess control (IAM) from the left navigation.

  3. SelectAdd >Add role assignment.

    Screenshot of the Access control (IAM) page with the role assignment menu open.

  4. On theRole tab of theAdd role assignment page, select theDevTest Labs User role, and then selectNext.

    Screenshot of the role assignment page with the Role tab selected.

  5. On theMembers tab, selectSelect members.

  6. On theSelect members screen, select the user or users to assign to theDevTest Labs User role, and then selectSelect.

  7. SelectReview + assign and then selectReview + assign again to assign the role.

Share a link to the lab

To share a link to the lab with your users, go to the lab home page in theAzure portal and copy the URL from your browser. Share the copied link with your lab users.

Lab users must have a Microsoft account, but they don't need an Azure account. If a lab user isn't a member of your Active Directory, they might see an error message when they try to access the shared link. If that happens, ask the user to first select their name in the upper-right corner of the Azure portal. They can then select the directory where the lab exists from theDirectory section of the menu.

Clean up resources

You can use this lab for the next tutorial,Access a lab in Azure DevTest Labs, or for other uses. When you're done using the lab, delete it and its resources to avoid further charges.

  1. On the labOverview page, selectDelete from the top menu.

    Screenshot of the lab Delete button.

  2. On theAre you sure you want to delete it page, enter the lab name, and then selectDelete.

    During the deletion process, you can selectNotifications at the top of your screen to view progress. Deleting a lab can take a while.

Deleting the lab removes all of the lab resources from the resource group. If you created the resource group for the lab, you can now delete the resource group. You can't delete a resource group that has a lab in it.

Deleting the resource group that contained the lab deletes all resources in the resource group. To delete the resource group:

  1. Select the resource group that contained the lab from your subscription'sResource groups list.
  2. At the top of the page, selectDelete resource group.
  3. On theDelete a resource group screen, enter the resource group name, and then selectDelete.

Related content

To learn how to access the lab and VMs as a lab user, go on to the next tutorial:


Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?