Tutorial: Create and publish a lab
In this tutorial, you set up a lab with virtual machines that are used by students in the classroom by doing the following actions:
- Create a lab
- Publish a lab
- Add users to the lab
- Set schedule for the lab
- Send invitation email to students
- 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 roles in the lab plan: Owner, Lab Creator, or Contributor. For more information, see Azure Lab Services built-in roles. The user account used to create a lab plan will already have 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
In this step, you create a lab for your class in Azure Lab Services portal.
Navigate to Lab Services web portal: 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 window, 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.
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.
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.
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.
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.
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.
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.
You see the status of publishing the template on page.
Wait until the publishing is complete.
Select Virtual machine pool on the left menu or select Virtual machines tile on the dashboard page to see the list of available machines. Confirm that you see virtual machines that are in Unassigned state. These VMs aren't assigned to students yet. They should be in Stopped state. For more information about managing the virtual machine pool, see Manage a VM pool in Lab Services.
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
Create a scheduled event for the lab so that VMs in the lab are automatically started and stopped at specific times. The user quota (default: 10 hours) you specified earlier is the extra time assigned to each student outside this scheduled time.
Switch to the Schedules page, and select Add scheduled event on the toolbar. Add scheduled event will be disabled if the lab is actively being published.
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.
Navigate to the start date in the calendar to verify that the schedule is set.
For more information about creating and managing schedules for a class, see Create and manage schedule for labs.
Add users to the lab
In this section, you add students to the lab. Students can be added to a lab several ways including manually by entering an email address, uploading a CSV file with student information, or syncing to an Azure AD group.
By default, the Restrict access option, found on the Users page, is turned on for a lab. Only listed users can register with the lab by using the registration link you send. You can turn off restricted access, which allows students to register with the lab as long as they have the registration link.
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.
The list displays the email addresses and statuses of the current users, whether they're registered with the lab or not.
After the students are registered with the lab, the list displays their names. The name that's shown in the list is constructed by using the first and last names of the student's information from Azure AD or their Microsoft Account. For more information on supported account types, see Student accounts.
Send invitation emails to users
- 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 get this registration link by selecting ... (ellipsis) on the toolbar, and Registration link.
- You see the status of 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.
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.
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.
Submit and view feedback for