Skip to content

Commit 0c8f76d

Browse files
authored
Merge pull request #259709 from RoseHJM/mdb-update-arm-qs
MDB - Updates to ARM template qs
2 parents d01ac5e + 36defc5 commit 0c8f76d

File tree

3 files changed

+49
-47
lines changed

3 files changed

+49
-47
lines changed
34 KB
Loading

articles/dev-box/quickstart-configure-dev-box-arm-template.md

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.topic: quickstart-arm
77
ms.custom: subject-armqs, devx-track-arm-template
88
author: RoseHJM
99
ms.author: rosemalcolm
10-
ms.date: 09/20/2023
10+
ms.date: 11/28/2023
1111
#Customer intent: As an enterprise admin, I want to understand how to create and configure dev box components with an ARM template so that I can provide dev box projects for my users.
1212
---
1313

@@ -17,22 +17,27 @@ This quickstart describes how to use an Azure Resource Manager (ARM) template to
1717

1818
[!INCLUDE [About Azure Resource Manager](../../includes/resource-manager-quickstart-introduction.md)]
1919

20+
This [Dev Box with customized image](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.devcenter/devbox-with-customized-image) template deploys a simple Dev Box environment that you can use for testing and exploring the service.
21+
22+
It creates the following Dev Box resources: dev center, project, network connection, dev box definition, and dev box pool. Once the template is deployed, you can go to the [developer portal](https://aka.ms/devbox-portal) to [create your dev box](quickstart-create-dev-box.md).
23+
2024
If your environment meets the prerequisites and you're familiar with using ARM templates, select the
2125
**Deploy to Azure** button. The template opens in the Azure portal.
2226

23-
:::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.devcenter%2Fdevbox-with-builtin-image%2Fazuredeploy.json":::
27+
:::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.devcenter%2Fdevbox-with-customized-image%2Fazuredeploy.json":::
2428

2529
## Prerequisites
2630

2731
- If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
2832
- Owner or Contributor role on an Azure subscription or resource group.
2933
- Microsoft Entra AD. Your organization must use Microsoft Entra AD for identity and access management.
34+
- Microsoft Intune subscription. Your organization must use Microsoft Intune for device management.
3035

3136
## Review the template
3237

33-
The template used in this QuickStart is from [Azure Quickstart Templates](/samples/azure/azure-quickstart-templates/devbox-with-builtin-image/)
38+
The template used in this QuickStart is from [Azure Quickstart Templates](/samples/azure/azure-quickstart-templates/devbox-with-customized-image/).
3439

35-
:::code language="json" source="~/quickstart-templates/quickstarts/microsoft.devcenter/devbox-with-builtin-image/azuredeploy.json":::
40+
The template for this article is too long to show here. To view the template, see [azuredeploy.json](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.devcenter/devbox-with-customized-image/azuredeploy.json)
3641

3742
Multiple Azure resources are defined in the template:
3843

@@ -42,40 +47,29 @@ Multiple Azure resources are defined in the template:
4247
- [Microsoft.DevCenter/projects](/azure/templates/microsoft.devcenter/projects): create a project.
4348
- [Microsoft.DevCenter/networkConnections](/azure/templates/microsoft.devcenter/networkConnections): create a network connection.
4449
- [Microsoft.DevCenter/devcenters/devboxdefinitions](/azure/templates/microsoft.devcenter/devcenters/devboxdefinitions): create a dev box definition.
50+
- [Microsoft.DevCenter/devcenters/galleries](/azure/templates/microsoft.devcenter/devcenters/galleries): create an Azure Compute Gallery.
4551
- [Microsoft.DevCenter/projects/pools](/azure/templates/microsoft.devcenter/projects/pools): create a dev box pool.
4652

47-
### Find more templates
48-
49-
To find more templates that are related to Microsoft Dev Box, see [Azure Quickstart Templates](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.devcenter).
50-
51-
For example, the [Dev Box with customized image](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.devcenter/devbox-with-customized-image) template creates the following Dev Box resources: dev center, project, network connection, dev box definition, and dev box pool. You can then go to the [developer portal](https://aka.ms/devbox-portal) to [create your dev box](quickstart-create-dev-box.md).
52-
53-
Next, you can use a template to [add other customized images for Base, Java, .NET and Data](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.devcenter/devbox-with-customized-image#add-other-customized-image-for-base-java-net-and-data). These images have the following software and tools installed:
54-
55-
56-
|Image type |Software and tools |
57-
|---------|---------|
58-
|Base |Git, Azure CLI, VS Code, VS Code Extension for GitHub Copilot |
59-
|Java |Git, Azure CLI, VS Code, Maven, OpenJdk11, VS Code Extension for Java Pack |
60-
|.NET |Git, Azure CLI, VS Code,.NET SDK, Visual Studio |
61-
|Data |Git, Azure CLI, VS Code,Python 3, VS Code Extension for Python and Jupyter |
62-
6353
## Deploy the template
6454

6555
1. Select **Open Cloudshell** from the following code block to open Azure Cloud Shell, and then follow the instructions to sign in to Azure.
6656

6757
```azurepowershell-interactive
68-
$vnetAddressPrefixes = Read-Host -Prompt "Enter a vnet address prefixes like 10.0.0.0/16"
69-
$subnetAddressPrefixes = Read-Host -Prompt "Enter a vnet address prefixes like 10.0.0.0/24"
70-
$location = Read-Host -Prompt "Enter the location (e.g. eastus)"
71-
72-
$resourceGroupName = "rg-devbox-test"
73-
$templateUri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.devcenter/devbox-with-builtin-image/azuredeploy.json"
74-
New-AzResourceGroup -Name $resourceGroupName -Location $location
75-
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateUri $templateUri -vnetAddressPrefixes $vnetAddressPrefixes -subnetAddressPrefixes $subnetAddressPrefixes -location $location
76-
77-
Write-Host "After all the resources are provisioned, go to https://devportal.microsoft.com/ to create a Dev Box. You can also refer to this guide: [Quickstart: Create a dev box - Microsoft Dev Box | Microsoft Learn](https://learn.microsoft.com/azure/dev-box/quickstart-create-dev-box)."
78-
Write-Host "Press [ENTER] to continue."
58+
$userPrincipalName = Read-Host "Please enter user principal name e.g. [email protected]"
59+
$resourceGroupName = Read-Host "Please enter resource group name e.g. rg-devbox-dev"
60+
$location = Read-Host "Please enter region name e.g. eastus"
61+
$templateUri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.devcenter/devbox-with-customized-image/azuredeploy.json"
62+
$userPrincipalId=(Get-AzADUser -UserPrincipalName $userPrincipalName).Id
63+
if($userPrincipalId){
64+
Write-Host "Start provisioning..."
65+
az group create -l $location -n $resourceGroupName
66+
az group deployment create -g $resourceGroupName --template-uri $templateUri --parameters userPrincipalId=$userPrincipalId
67+
}else {
68+
Write-Host "User Principal Name cannot be found."
69+
}
70+
71+
Write-Host "Provisioning Completed."
72+
7973
```
8074

8175
Wait until you see the prompt from the console.
@@ -84,40 +78,48 @@ Next, you can use a template to [add other customized images for Base, Java, .NE
8478
3. Right-click the shell console pane and then select **Paste**.
8579
4. Enter the values.
8680

87-
It takes about 10 minutes to deploy the template. When completed, the output is similar to:
88-
89-
:::image type="content" source="media/quickstart-configure-dev-box-arm-template/dev-box-template-output.png" alt-text="Screenshot showing the output of the template.":::
81+
It takes about 30 minutes to deploy the template.
9082

9183
Azure PowerShell is used to deploy the template. You can also use the Azure portal and Azure CLI. To learn other deployment methods, see [Deploy templates](../azure-resource-manager/templates/deploy-portal.md).
9284

93-
#### Depending on your configuration, you may want to change the following parameters:
85+
### Required parameters:
9486

95-
- *Resource group name:* The default resource group name is “rg-devbox-test”; you can change it by editing `$resourceGroupName = "rg-devbox-test` in the template.
87+
- *User Principal ID*: The user principal ID of the user or group that is granted the *Devcenter Dev Box User* role.
88+
- *User Principal Type*: The type of user principal. Valid values are *User* or *Group*.
89+
- *Location*: The location where the resources are deployed. Choose a location close to the dev boxes users to reduce latency.
9690

97-
- *Subnet:* If you have an existing subnet, you can use the parameter `-existingSubnetId` to pass the existing subnet ID. The template doesn't create a new Virtual network and subnet if you specify an existing one.
91+
Alternatively, you can provide access to a dev box project in the Azure portal, see [Provide user-level access to projects for developers](how-to-dev-box-user.md).
9892

99-
- *Dev Box User role:* To grant the role [*DevCenter Dev Box User*](how-to-dev-box-user.md) to your user at Dev box project level, pass the principal ID to the `-principalId` parameter.
100-
- **User:** You can find the principal ID listed as the object ID on the user Overview page.
101-
:::image type="content" source="media/quickstart-configure-dev-box-arm-template/user-object-id.png" alt-text="Screenshot showing the user overview page with object ID highlighted.":::
102-
- **Group:** You can find the principal ID listed as the object ID on the group Overview page.
103-
:::image type="content" source="media/quickstart-configure-dev-box-arm-template/group-object-id.png" alt-text="Screenshot showing the group overview page with object ID highlighted.":::
93+
### Virtual network security considerations
94+
95+
Planning for a Microsoft Dev Box deployment covers many areas, including securing the virtual network (VNet). For more information, see [Azure network security overview](../security/fundamentals/network-overview.md).
10496

105-
Alternatively, you can provide access to a dev box project in the Azure portal, see [Provide user-level access to projects for developers](how-to-dev-box-user.md)
106-
10797
## Review deployed resources
10898

10999
1. Sign in to the [Azure portal](https://portal.azure.com).
110100
2. Select **Resource groups** from the left pane.
111101
3. Select the resource group that you created in the previous section.
112102

113-
:::image type="content" source="media/quickstart-configure-dev-box-arm-template/dev-box-template-resources.png" alt-text="Screenshot showing the newly created dev box resource group and the resources it contains in the Azure portal.":::
114-
115-
1. Select the Dev Center. Its default name is dc-*resource-token*.
103+
:::image type="content" source="media/quickstart-configure-dev-box-arm-template/dev-box-template-resources.png" alt-text="Screenshot showing the newly created dev box resource group and the resources it contains in the Azure portal." lightbox="media/quickstart-configure-dev-box-arm-template/dev-box-template-resources.png":::
116104

117105
## Clean up resources
118106

119107
When you no longer need them, delete the resource group: Go to the Azure portal, select the resource group that contains these resources, and then select Delete.
120108

109+
## Find more templates
110+
111+
To find more templates that are related to Microsoft Dev Box, see [Azure Quickstart Templates](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.devcenter).
112+
113+
For example, you can use a template to [add other customized images for Base, Java, .NET and Data](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.devcenter/devbox-with-customized-image#add-other-customized-image-for-base-java-net-and-data). These images have the following software and tools installed:
114+
115+
116+
|Image type |Software and tools |
117+
|---------|---------|
118+
|Base |Git, Azure CLI, VS Code, VS Code Extension for GitHub Copilot |
119+
|Java |Git, Azure CLI, VS Code, Maven, OpenJdk11, VS Code Extension for Java Pack |
120+
|.NET |Git, Azure CLI, VS Code,.NET SDK, Visual Studio |
121+
|Data |Git, Azure CLI, VS Code,Python 3, VS Code Extension for Python and Jupyter |
122+
121123
## Next steps
122124

123125
- [Quickstart: Create a dev box](quickstart-create-dev-box.md)

0 commit comments

Comments
 (0)