Skip to content

Files

Latest commit

137907d · May 27, 2022

History

History
96 lines (59 loc) · 5.85 KB

quick-create-lab-template.md

File metadata and controls

96 lines (59 loc) · 5.85 KB
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

Quickstart: Create a lab using an ARM template

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":::

Prerequisites

To complete this quick start, make sure that you have:

Review the 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:

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.

Deploy the template

  1. 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":::

  2. Optionally, change the name of the lab.

  3. Select the resource group the lab plan you're going to use.

  4. Enter the required values for the template:

    1. adminUser. The name of the user that will be added as an administrator for the lab VM.

    2. adminPassword. The password for the administrator user for the lab VM.

    3. 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.":::

  5. Select Review + create.

  6. 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.

Review deployed resources

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.

Clean up resources

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.

Next steps

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