title | description | services | ms.topic | ms.custom | ms.date |
---|---|---|---|---|---|
Azure Lab Services Quickstart - Create a lab by using Azure Resource Manager template (ARM template) |
In this quickstart, you'll learn how to create an Azure Lab Services lab by using Azure Resource Manager template (ARM template). |
azure-resource-manager |
quickstart |
subject-armqs |
05/10/2022 |
This quickstart shows you, as the educator or admin, how to use an Azure Resource Manager (ARM) template to create a lab. This quickstart shows you how to create a lab with Windows 11 Pro image. Once a lab is created, an educator configures the template, adds lab users, and publishes the lab. For an overview of Azure Lab Services, see An introduction to Azure Lab Services.
[!INCLUDE About Azure Resource Manager]
If your environment meets the prerequisites and you're familiar with using ARM templates, select the Deploy to Azure button. The template will open in the Azure portal.
:::image type="content" source="../media/template-deployments/deploy-to-azure.svg" alt-text="Screenshot of the Deploy to Azure button to deploy resources with a template." link="https://portal.azure.com/#create/Microsoft.Template/uri/https%3a%2f%2fraw.githubusercontent.com%2fAzure%2fazure-quickstart-templates%2fmaster%2fquickstarts%2fmicrosoft.labservices%2flab-using-lab-plan%2fazuredeploy.json":::
To complete this quick start, make sure that you have:
- Azure subscription. If you don’t have one, create a free account before you begin.
- Lab plan. If you haven't create a lab plan, see Quickstart: Create a lab plan using an ARM template.
The template used in this quickstart is from Azure Quickstart Templates.
:::code language="json" source="~/quickstart-templates/quickstarts/microsoft.labservices/lab-using-lab-plan/azuredeploy.json":::
One Azure resource is defined in the template:
- Microsoft.LabServices/labs: resource type description.
More Azure Lab Services template samples can be found in Azure Quickstart Templates. For more information how to create a lab without a lab plan using automation, see Create Azure LabServices lab template.
-
Select the following link to sign in to Azure and open a template. The template creates a lab.
:::image type="content" source="../media/template-deployments/deploy-to-azure.svg" alt-text="Screenshot of the Deploy to Azure button to deploy resources with a template." link="https://portal.azure.com/#create/Microsoft.Template/uri/https%3a%2f%2fraw.githubusercontent.com%2fAzure%2fazure-quickstart-templates%2fmaster%2fquickstarts%2fmicrosoft.labservices%2flab-using-lab-plan%2fazuredeploy.json":::
-
Optionally, change the name of the lab.
-
Select the resource group the lab plan you're going to use.
-
Enter the required values for the template:
-
adminUser. The name of the user that will be added as an administrator for the lab VM.
-
adminPassword. The password for the administrator user for the lab VM.
-
labPlanId. The resource ID for the lab plan to be used. The Id is listed in the Properties page of the lab plan resource in Azure.
:::image type="content" source="./media/quick-create-lab-template/lab-plan-properties-id.png" alt-text="Screenshot of properties page for lab plan in Azure Lab Services with I D property highlighted.":::
-
-
Select Review + create.
-
Select Create.
The Azure portal is used here to deploy the template. You can also use Azure PowerShell, Azure CLI, or the REST API. To learn other deployment methods, see Deploy resources with ARM templates.
You can either use the Azure portal to check the lab, or use the Azure PowerShell script to list the lab resource created.
To use Azure PowerShell, first verify the Az.LabServices (preview) module is installed. Then use the Get-AzLabServicesLab cmdlet.
Import-Module Az.LabServices
$lab = Read-Host -Prompt "Enter your lab name"
Get-AzLabServicesLab -Name $lab
Write-Host "Press [ENTER] to continue..."
To verify educators can use the lab, navigate to the Azure Lab Services website: https://labs.azure.com. For more information about managing labs, see View all labs.
When no longer needed, delete the resource group, which deletes the lab and other resources in the same group.
$resourceGroupName = Read-Host -Prompt "Enter the Resource Group name"
Remove-AzResourceGroup -Name $resourceGroupName
Write-Host "Press [ENTER] to continue..."
Alternately, an educator may delete a lab from the Azure Lab Services website: https://labs.azure.com. For more information about deleting labs, see Delete a lab.
For a step-by-step tutorial that guides you through the process of creating a template, see:
[!div class="nextstepaction"] Tutorial: Create and deploy your first ARM template