Skip to content

Commit b71abcb

Browse files
authored
Merge pull request #309031 from v-thepet/dtl1
Freshness Edit: DevTest Labs 1
2 parents 8566075 + 8c0b992 commit b71abcb

1 file changed

Lines changed: 55 additions & 36 deletions

File tree

articles/devtest-labs/create-lab-windows-vm-bicep.md

Lines changed: 55 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ ms.author: rosemalcolm
55
author: RoseHJM
66
ms.topic: quickstart
77
ms.custom: subject-armqs, mode-arm, devx-track-bicep, UpdateFrequency2
8-
ms.date: 09/30/2023
8+
ms.date: 12/15/2025
9+
#customer intent: As a DevTest Labs administrator, I want to learn about how to use a Bicep template so I can use Bicep to quickly and easily create labs with VMs.
910
---
1011

1112
# Quickstart: Use Bicep to create a lab in DevTest Labs
1213

1314
This quickstart uses Bicep to create a lab in Azure DevTest Labs that has one Windows Server 2019 Datacenter virtual machine (VM) in it.
1415

15-
In this quickstart, you take the following actions:
16+
[!INCLUDE [About Bicep](~/reusable-content/ce-skilling/azure/includes/resource-manager-quickstart-bicep-introduction.md)]
17+
18+
In this quickstart, you:
1619

1720
> [!div class="checklist"]
1821
> * Review the Bicep file.
@@ -22,13 +25,22 @@ In this quickstart, you take the following actions:
2225
2326
## Prerequisites
2427

25-
If you don't have an Azure subscription, [create a free account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn) before you begin.
28+
- An Azure subscription where you have permissions to create and manage resources. If you don't have one, [create a free account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
2629

27-
## Review the Bicep file
30+
# [Azure CLI](#tab/CLI)
2831

29-
[!INCLUDE [About Bicep](~/reusable-content/ce-skilling/azure/includes/resource-manager-quickstart-bicep-introduction.md)]
32+
- [Azure CLI installed](/cli/azure/install-azure-cli-windows)
33+
34+
# [Azure PowerShell](#tab/PowerShell)
3035

31-
The Bicep file defines the following resource types:
36+
- [Azure PowerShell installed](/powershell/scripting/install/install-powershell-on-windows)
37+
- [Bicep installed](/azure/azure-resource-manager/bicep/install#windows)
38+
39+
---
40+
41+
## Review the Bicep file
42+
43+
Review the Bicep file. The file uses the following resource types to take the following actions:
3244

3345
- [Microsoft.DevTestLab/labs](/azure/templates/microsoft.devtestlab/labs) creates the lab.
3446
- [Microsoft.DevTestLab/labs/virtualnetworks](/azure/templates/microsoft.devtestlab/labs/virtualnetworks) creates a virtual network.
@@ -38,72 +50,79 @@ The Bicep file defines the following resource types:
3850

3951
## Deploy the Bicep file
4052

41-
1. Save the Bicep file as **main.bicep** to your local computer.
42-
1. Deploy the Bicep file using either Azure CLI or Azure PowerShell.
53+
1. Save the Bicep file as *main.bicep* to your local computer.
54+
1. Run the following commands using either Azure CLI or Azure PowerShell from the folder where you saved the Bicep file. In the commands, replace the following placeholders:
55+
- `<location>`: Azure region you want to use.
56+
- `<lab-name>`: Name for the new lab.
57+
- `<vm-name>`: Name for the new VM.
58+
- `<user-name>`: Username of a local account to create on the new VM. You're prompted to enter a password for the local account. Be sure not to use any [disallowed usernames or passwords](/rest/api/compute/virtual-machines/create-or-update?tabs=HTTP#osprofile).
4359

44-
# [CLI](#tab/CLI)
60+
# [Azure CLI](#tab/CLI)
4561

46-
```azurecli
47-
az group create --name exampleRG --location eastus
48-
az deployment group create --resource-group exampleRG --template-file main.bicep --parameters labName=<lab-name> vmName=<vm-name> userName=<user-name>
49-
```
62+
```azurecli
63+
az group create --name exampleRG --location <location>
64+
az deployment group create --resource-group exampleRG --template-file main.bicep --parameters labName=<lab-name> vmName=<vm-name> userName=<user-name>
65+
```
5066

51-
# [PowerShell](#tab/PowerShell)
67+
# [Azure PowerShell](#tab/PowerShell)
5268

53-
```azurepowershell
54-
New-AzResourceGroup -Name exampleRG -Location eastus
55-
New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep -labName "<lab-name>" -vmName "<vm-name>" -userName "<user-name>"
56-
```
69+
```azurepowershell
70+
New-AzResourceGroup -Name exampleRG -Location <location>
71+
New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep -labName "<lab-name>" -vmName "<vm-name>" -userName "<user-name>"
72+
```
5773

58-
---
74+
---
5975

60-
> [!NOTE]
61-
> Replace **\<lab-name\>** with the name of the new lab instance. Replace **\<vm-name\>** with the name of the new VM. Replace **\<user-name\>** with username of the local account that will be created on the new VM. You'll also be prompted to enter a password for the local account.
76+
The deployment also creates a resource group for the VM named `<lab-name>`-`<vm-name>`-`<numerical-string>`. This resource group contains VM resources like the IP address, network interface, and disk.
6277

63-
When the deployment finishes, you should see a message indicating the deployment succeeded.
78+
When the deployment completes, the output shows data about the resources and the deployment.
6479

6580
## Validate the deployment
6681

67-
Use the Azure portal, Azure CLI, or Azure PowerShell to list the deployed resources in the resource group.
82+
Use Azure CLI or Azure PowerShell to list the deployed resources in the resource group. You can also use the Azure portal.
6883

69-
# [CLI](#tab/CLI)
84+
# [Azure CLI](#tab/CLI)
7085

71-
```azurecli-interactive
86+
```azurecli
7287
az resource list --resource-group exampleRG
7388
```
7489

75-
# [PowerShell](#tab/PowerShell)
90+
# [Azure PowerShell](#tab/PowerShell)
7691

77-
```azurepowershell-interactive
92+
```azurepowershell
7893
Get-AzResource -ResourceGroupName exampleRG
7994
```
8095

8196
---
8297

83-
> [!NOTE]
84-
> The deployment also creates a resource group for the VM. The resource group contains VM resources like the IP address, network interface, and disk. The resource group appears in your subscription's **Resource groups** list with the name **\<lab name>-\<vm name>-\<numerical string>**.
85-
8698
## Clean up resources
8799

88-
When no longer needed, use the Azure portal, Azure CLI, or Azure PowerShell to delete the resource group and all of its resources.
100+
You can use Azure CLI or Azure PowerShell to delete the resource group and all of its resources when you don't need them anymore. You can also use the Azure portal.
101+
102+
If you want to manually delete the lab's resource group, you must delete the lab first. You can't delete a resource group that has a lab in it.
89103

90104
# [CLI](#tab/CLI)
91105

92-
```azurecli-interactive
106+
```azurecli
93107
az group delete --name exampleRG
94108
```
95109

96110
# [PowerShell](#tab/PowerShell)
97111

98-
```azurepowershell-interactive
112+
```azurepowershell
99113
Remove-AzResourceGroup -Name exampleRG
100114
```
101115

102116
---
103117

104-
## Next steps
118+
## Next step
105119

106-
In this quickstart, you created a lab that has a Windows VM. To learn how to connect to and manage lab VMs, see the next tutorial:
120+
To connect to lab VMs, see the next tutorial.
107121

108122
> [!div class="nextstepaction"]
109-
> [Tutorial: Work with lab VMs](tutorial-use-custom-lab.md)
123+
> [Access, claim, and connect to a DevTest Labs VM](tutorial-use-custom-lab.md)
124+
125+
## Related content
126+
127+
- [Tutorial: Create a lab and VM and add a user in DevTest Labs](tutorial-create-custom-lab.md)
128+
- [Azure DevTest Labs scenarios](devtest-lab-guidance-get-started.md)

0 commit comments

Comments
 (0)