Tutorial: Create and publish a lab in Azure Lab Services
Note
This article references features available since the August 2022 Update, when lab plans replaced lab accounts. For more information, see What's New in the August 2022 Update.
In this tutorial, you use Azure Lab Services to set up a lab with virtual machines that are used by students in the classroom. You use the Azure Lab Services website to create a lab from a virtual machine image and configure a schedule for automatically starting and stopping the lab VMs. Finally, you add and invite users to the lab to let them access the lab VMs.
In this article, you learn how to:
- Create a lab
- Publish a lab
- Add users to the lab
- Set schedule for the lab
- Send invitation email to students
Prerequisites
- A lab plan. To create a lab plan, see Tutorial: Create a lab plan with Azure Lab Services.
- Permission to create a lab. You must be a member of one of these Azure Active Directory roles in the lab plan: Owner, Lab Creator, or Contributor. For more information, see Azure Lab Services built-in roles. The user account that created the lab plan already has the required permissions to create a lab.
Here's the typical workflow when using Azure Lab Services:
- The person that created the lab plan adds other users to the Lab Creator role. For example, the administrator (who created the lab plan) assigns educators to the Lab Creator role on the lab plan or resource group so that they can create labs for their classes. The administrator can also assign educators the Lab Creator role on the resource group that contains one or more lab plans. To assign the Lab Creator role to someone, see Add a user to the Lab Creator role.
- Then, the educators create labs with VMs for their classes and send registration links to students in the class. If the administrator assigned the Lab Creator role at the resource group, the educator can choose from all lab plans in that resource group when creating new labs.
- Students use the registration link that they receive from educators to register to the lab. Once they're registered, they can use VMs in the labs to do the class work and homework. If Canvas or Teams integration with Azure Lab Services is used, this step is skipped by the students.
Create a lab
As a lab creator, you can create a lab for your class by using the Azure Lab Services website.
Navigate to the Azure Lab Services website (https://labs.azure.com).
Select Sign in and enter your credentials. Azure Lab Services supports organizational accounts and Microsoft accounts.
Select New lab.
In the New Lab page, do the following actions:
Specify a name, virtual machine image, size, and region for your lab, and select Next. For more information about naming restrictions, see Microsoft.LabServices resource name rules.
Possibly, you'll need to choose a lab plan. If more than one lab plan is in the resource group, you'll see a dropdown to choose a lab plan. If there's only one lab plan in the resource group, this option will be hidden.
Important
Talk to your admin, if you don't see the virtual machine image you need. They may have to specify Marketplace images or specify custom images available to lab creators. If using custom images, the admin must also verify the custom image is replicated to the same region as the lab plan.
Note
Prices shown are for example only. For current pricing information, see Azure Lab Services pricing.
On the Virtual machine credentials page, specify default administrator credentials for all VMs in the lab. Specify the name and the password for the administrator. By default all the student VMs will have the same password as the one specified here.
Important
Make a note of user name and password. They won't be shown again.
This step is optional for the tutorial. Select Give lab user a non-admin account on their virtual machines to give the student non-administrator account rather the default administrator account.
Important
Make a note of non-admin user name and password. They won't be shown again.
If you would like students to set their own password the first time they sign into their VM, uncheck Use same password for all virtual machines. Note, students will have to wait for the password set function to complete before the connect button is available for their VM if Use same password for all virtual machines is unchecked. Select Next.
On the Lab policies page, leave the default selections and select Next.
On the Template virtual machine settings window, leave the selection on Create a template virtual machine if you need to make modifications to the template used to create all the student VMs. If you don't need to make any modifications to the image chosen earlier, choose Use a virtual machine image without customization. Select Finish.
You should see the following screen that shows the status of the template VM creation.
If Use a virtual machine image without customization was selected on the Template virtual machine settings window when creating the lab, skip this step. On the Template page, optionally do the following steps:
Connect to the template VM by selecting Start. If it's a Linux template VM, you choose whether you want to connect using SSH or RDP (if RDP is enabled).
Install and configure software required for your class on the template VM.
Stop the template VM.
Note
Template VMs incur cost when running, so ensure that the template VM is shutdown when you don’t need it to be running.
If you chose to create a Linux template VM, more setup is required to use a GUI remote desktop. For more information, see Enable graphical remote desktop for Linux virtual machines in Azure Lab Services.
Publish a lab
In this step, you publish the lab. When you publish the template VM, Azure Lab Services creates VMs in the lab by using the template. All virtual machines have the same configuration as the template.
On the Template page, select Publish on the toolbar.
Warning
Publishing is an irreversible action! It can't be undone.
On the Publish template page, select Publish. Select OK when warned that publishing is a permanent action.
Wait until the publishing finishes. You can track the publishing status on the Template page.
On the Virtual machine pool page, confirm that the virtual machines are flagged as Unassigned and are in a Stopped state.
Unassigned VMs aren't assigned to students yet. For more information about managing the virtual machine pool, see Manage a VM pool in Lab Services.
Note
When an educator turns on a student VM, quota for the student isn't affected. Quota for a user specifies the number of lab hours available to a student outside of the scheduled class time. For more information on quotas, see Set quotas for users.
Set a schedule for the lab
You can create a scheduled event for the lab so that VMs in the lab are automatically started and stopped at specific times. For example, you might create a scheduled event that matches the class hours. You can create one-time events or recurring events. For more information about creating and managing schedules for a class, see Create and manage schedule for labs.
The user quota (default: 10 hours) you specified earlier is the extra time assigned to each student outside this scheduled time.
To create a scheduled event for a lab:
Switch to the Schedules page, and select Add scheduled event on the toolbar.
If the lab hasn't finished publishing, Add scheduled event will be disabled.
On the Add scheduled event page, do the following steps:
- Confirm that Standard is selected the Event type.
- Select the start date for the class.
- Select the start time at which you want the VMs to be started.
- Select the stop time at which the VMs are to be shut down.
- Select the time zone for the start and stop times you specified.
On the same Add scheduled event page, select the current schedule in the Repeat section.
On the Repeat dialog box, do the following steps:
Confirm that every week is set for the Repeat field.
Select the days on which you want the schedule to take effect. In the following example, Monday-Friday is selected.
Select an end date for the schedule.
Select Save.
On the Add scheduled event page, for Notes (optional), enter any description or notes for the schedule.
On the Add scheduled event page, select Save.
In the calendar view, confirm that the scheduled event is present.
Add users to the lab
Now that you've created and configured the lab, you can add lab users. Azure Lab Services supports multiple ways to add users to a lab:
- Manually by entering an email address
- Upload a CSV file with student information
- Sync to an Azure Active Directory group
By default, access to a lab is restricted, which means that only listed users can register with the lab. You can turn off restricted access, which allows students to register with the lab as long as they have the registration link. Configure restricted access by using the Restrict access setting on the Users page.
Manually add users to the lab by providing their email address:
Select the Users page.
Select Add users manually.
Select Add by email address (default), enter the students' email addresses on separate lines or on a single line separated by semicolons.
Select Save.
The list displays the email addresses and statuses of the current users, whether they're registered with the lab or not.
Note
After a student registers for the lab uing the registration link, the user list also displays their name. The name that's shown in the list is constructed by using the first and last names of the student's information from Azure Active Directory or their Microsoft Account. For more information about supported account types, see Student accounts.
Send invitation emails to users
After adding users to the lab, you can send email invitations to let them register for the lab:
Switch to the Users view if you aren't on the page already, and select Invite all on the toolbar.
On the Send invitation by email page, enter an optional message, and then select Send.
The email automatically includes the registration link. You can also get this registration link by selecting ... (ellipsis) > Registration link on the toolbar.
You can track the status of the invitation in the Users list.
The status should change to Sending and then to Sent on <date>.
For more information about managing usage of student VMs, see How to configure student usage.
Troubleshooting
Lab creation fails with You are not authorized to access this resource
When you create a new lab plan, it might take a few minutes for the permissions to propagate to the lab level. You can assign the Lab Creator role at the resource group level to prevent this behavior:
- In the Azure portal, go to the resource group that contains the lab plan.
- Select Access control (IAM) from the left navigation.
- Select Add > Add role assignment.
- Assign the Lab Creator role to the user account.
Next steps
In this tutorial, you created a lab for your class in Azure. To learn how a student can access a VM in the lab using the registration link, advance to the next tutorial.
Feedback
Submit and view feedback for