Skip to content

Files

Latest commit

b592b59 · May 24, 2022

History

History
92 lines (58 loc) · 2.82 KB

quick-create-lab-bicep.md

File metadata and controls

92 lines (58 loc) · 2.82 KB
title description ms.topic ms.date ms.custom
Azure Lab Services Quickstart - Create a lab using Bicep
In this quickstart, you learn how to create an Azure Lab Services lab using Bicep
quickstart
05/23/2022
template-quickstart

Quickstart: Create a lab using a Bicep file

In this quickstart, you, as the educator, create a lab using a Bicep file. For detailed overview of Azure Lab Services, see An introduction to Azure Lab Services.

[!INCLUDE About Bicep]

Prerequisites

If you don't have an Azure subscription, create a free account before you begin.

Review the Bicep file

The Bicep file used in this quickstart is from Azure Quickstart Templates.

:::code language="bicep" source="~/quickstart-templates/quickstarts/microsoft.labservices/lab/main.bicep":::

Deploy the Bicep file

  1. Save the Bicep file as main.bicep to your local computer.

  2. Deploy the Bicep file using either Azure CLI or Azure PowerShell.

    az group create --name exampleRG --location eastus
    az deployment group create --resource-group exampleRG --template-file main.bicep --parameters adminUsername=<admin-username>
    
    New-AzResourceGroup -Name exampleRG -Location eastus
    New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep -adminUsername "<admin-username>"
    

Note

Replace <admin-username> with a unique username. You'll also be prompted to enter adminPassword. The minimum password length is 12 characters.

When the deployment finishes, you should see a messaged indicating the deployment succeeded.

Review deployed resources

Use the Azure portal, Azure CLI, or Azure PowerShell to list the deployed resources in the resource group.

az resource list --resource-group exampleRG
Get-AzResource -ResourceGroupName exampleRG

Clean up resources

When no longer needed, use the Azure portal, Azure CLI, or Azure PowerShell to delete the VM and all of the resources in the resource group.

az group delete --name exampleRG
Remove-AzResourceGroup -Name exampleRG

Next steps

In this quickstart, you deployed a simple virtual machine using a Bicep file. To learn more about Azure virtual machines, continue to the tutorial for Linux VMs.

[!div class="nextstepaction"] Configure a template VM