|
1 | 1 | ---
|
2 | 2 | title: Create environments from ARM templates
|
3 | 3 | titleSuffix: Azure DevTest Labs
|
4 |
| -description: Learn how to create multi-VM, platform-as-a-service (PaaS) environments in Azure DevTest Labs from ARM templates. |
| 4 | +description: Learn how to create multiple virtual machines in platform-as-a-service (PaaS) environments in Azure DevTest Labs by using ARM templates. |
5 | 5 | ms.topic: how-to
|
6 | 6 | ms.author: rosemalcolm
|
7 | 7 | author: RoseHJM
|
8 |
| -ms.date: 09/30/2023 |
| 8 | +ms.date: 06/10/2024 |
9 | 9 | ms.custom: engagement-fy23, devx-track-azurepowershell, UpdateFrequency2
|
| 10 | + |
| 11 | +#customer intent: As a developer, I want to use ARM templates in Azure DevTest Labs so that I can create virtual machines or PaaS resources. |
10 | 12 | ---
|
11 | 13 |
|
12 | 14 | # Create Azure DevTest Labs environments from ARM templates
|
13 | 15 |
|
14 |
| -In this article, you learn how to create Azure DevTest Labs environments from [Azure Resource Manager (ARM)](../azure-resource-manager/templates/syntax.md) templates. You can use DevTest Labs environments to easily and consistently provision labs with multiple virtual machines (VMs) or platform-as-a-service (PaaS) resources. For example, to create a lab for a multi-tier web application, or a SharePoint farm. |
| 16 | +In this article, you learn how to create Azure DevTest Labs environments from [Azure Resource Manager (ARM)](../azure-resource-manager/templates/syntax.md) templates. You can use DevTest Labs environments to easily and consistently provision labs with multiple virtual machines (VMs) or platform-as-a-service (PaaS) resources. You might use this approach to create a lab for a multi-tier web application or a SharePoint farm. |
| 17 | + |
| 18 | +Resources in a DevTest Labs environment share the same lifecycle and you can manage them together. You can track the cost of lab environments and PaaS resources in the same way you track costs for individual lab VMs. |
| 19 | + |
| 20 | +You can configure Azure DevTest Labs to use ARM templates from a public or private Git repository. The following diagram shows how to create an environment with DevTest Labs from an ARM template in a public or custom template template repository. The [template repositories for labs](#environment-template-repositories) section describes this process in detail. |
15 | 21 |
|
16 |
| -Resources in an environment share the same lifecycle, and you can manage them together. You can track the cost of lab environments and PaaS resources, just as you track costs for individual lab VMs. |
| 22 | +:::image type="content" source="./media/devtest-lab-create-environment-from-arm/devtest-labs-create-environment-with-arm.png" alt-text="Diagram that shows how to create an environment with DevTest Labs by using an ARM template in a template repository." border="false" lightbox="./media/devtest-lab-create-environment-from-arm/devtest-labs-create-environment-with-arm.png"::: |
17 | 23 |
|
18 |
| -You can configure Azure DevTest Labs to use ARM templates from a public or private Git repository. Learn more about [template repositories for labs](#environment-template-repositories). |
| 24 | +## Prerequisites |
19 | 25 |
|
20 |
| -:::image type="content" source="./media/devtest-lab-create-environment-from-arm/devtest-labs-create-environment-with-arm.png" alt-text="Diagram that shows how to create an environment with Azure DevTest Labs from an ARM template in a public or custom template repository." lightbox="./media/devtest-lab-create-environment-from-arm/devtest-labs-create-environment-with-arm.png"::: |
| 26 | +- Experience configuring lab environments in DevTest Labs. If you're new to working with labs, review the [configure environments for your lab](#configure-public-environment-settings-for-your-lab) section. It's helpful to understand how to configure template repositories, enable or disable public environments, and select templates to create labs. |
21 | 27 |
|
22 |
| -If you want to use an ARM template to create an Azure DevTest Labs resource, see the [Quickstart: use an ARM template to create a lab in DevTest Labs](./create-lab-windows-vm-template.md). |
| 28 | +### Limitations |
23 | 29 |
|
24 |
| -## Limitations |
| 30 | +There are a few limitations to keep in mind when you create labs from ARM templates in DevTest Labs: |
25 | 31 |
|
26 |
| -Consider these limitations when you create labs from ARM templates in DevTest Labs: |
| 32 | +- DevTest Labs doesn't support the [VM auto-shutdown](/azure/virtual-machines/auto-shutdown-vm) feature for PaaS resources created from ARM templates. |
27 | 33 |
|
28 |
| -- VM auto-shutdown doesn't apply to PaaS resources. |
| 34 | +- DevTest Labs doesn't evaluate all lab policies when you deploy ARM templates. The following policies aren't evaluated: |
| 35 | + - Number of VMs per lab user |
| 36 | + - Number of premium VMs per user |
| 37 | + - Number of premium desks per user |
29 | 38 |
|
30 |
| -- Not all lab policies are evaluated when you deploy ARM templates. Policies that aren't evaluated include: number of VMs per lab user, number of premium VMs per user, and number of premium desks per user. For example, your lab policy might limit users to only five VMs apiece. However, a user can deploy an ARM environment template that creates dozens of VMs. |
| 39 | + Suppose you have a lab policy that allows each user to create a maximum of five VMs. In DevTest Labs, each user can deploy an ARM environment template that creates dozens of VMs. |
31 | 40 |
|
32 | 41 | ## Create environments from templates
|
33 | 42 |
|
34 | 43 | You can create an environment from the Azure DevTest Labs public template repository or you can [add a private template repository](./devtest-lab-use-resource-manager-template.md#add-template-repositories-to-labs) to your lab.
|
35 | 44 |
|
36 |
| -Learn how to [configure environments for your lab](#configure-public-environment-settings-for-your-lab). For example, how to configure the template repositories, enable or disable public environments, and selecting specific templates for creating labs. |
37 |
| - |
38 | 45 | To create an environment from a template:
|
39 | 46 |
|
40 |
| -1. In the [Azure portal](https://portal.azure.com), select your lab resource. |
| 47 | +1. In the [Azure portal](https://portal.azure.com), go to your DevTest Labs resource. |
| 48 | + |
| 49 | +1. On the lab **Overview** page, expand the **My lab** section, and select **My environments**. |
| 50 | + |
| 51 | +1. Select **Add** on the toolbar. |
| 52 | + |
| 53 | +1. On the **Choose a base** page, select the ARM environment template to use. The available environment templates appear first in the list of bases: |
| 54 | + |
| 55 | + <!-- Need to update -- first image must show full portal experience in browser |
| 56 | + Current UI doesn't show Type column, which identifies items as "ARM templates" --> |
| 57 | + |
| 58 | + |
| 59 | + Add an extra step: |
| 60 | + |
| 61 | + - Select My environments from the left menu |
| 62 | + - Select Add as before, and now only the supported lab environments are listed for them to choose a base. |
| 63 | + |
| 64 | + The Type column still doesn't display, but there's no risk of them selecting an OS image. |
| 65 | + |
41 | 66 |
|
42 |
| -1. On the lab's **Overview** page, select **Add** from the top toolbar. |
43 | 67 |
|
44 |
| -1. On the **Choose a base** page, select the ARM environment template to use. The available environment templates appear first in the list of bases. |
| 68 | + :::image type="content" source="media/devtest-lab-create-environment-from-arm/public-environment-templates.png" alt-text="Screenshot that shows public environment templates." lightbox="media/devtest-lab-create-environment-from-arm/public-environment-templates.png"::: |
45 | 69 |
|
46 |
| - :::image type="content" source="media/devtest-lab-create-environment-from-arm/public-environment-templates.png" alt-text="Screenshot that shows public environment templates." lightbox="media/devtest-lab-create-environment-from-arm/public-environment-templates.png"::: |
| 70 | +1. On the **Add** screen, enter an **Environment name**, and configure the other fields. The number and type of fields is unique for each ARM template. |
47 | 71 |
|
48 |
| -1. On the **Add** screen, enter an **Environment name**, and fill the other input fields. |
| 72 | + Certain parameter values in the ARM template file result in blank input fields in the Azure portal **Add** screen. |
49 | 73 |
|
50 |
| - The number and type of input fields is defined in the ARM template. As necessary, enter values for input fields that the template *azuredeploy.parameters.json* file defines as blank or default. |
| 74 | + As necessary, enter values for any required fields that the *azuredeploy.parameters.json* template file shows blank by default. Required fields are indicated by a red asterisk (*). |
51 | 75 |
|
52 |
| - - For `secure string` parameters, you can use secrets from Azure Key Vault. To learn how to store secrets in a key vault and use them when creating lab resources, see [Store secrets in Azure Key Vault](devtest-lab-store-secrets-in-key-vault.md). |
| 76 | + - For _secure string_ parameters ike passwords, you can use secrets from Azure Key Vault. To learn how to store secrets in a key vault and use them when you create lab resources, see [Store secrets in Azure Key Vault](devtest-lab-store-secrets-in-key-vault.md). |
53 | 77 |
|
54 |
| - - In ARM template files, the `GEN-UNIQUE`, `GEN-UNIQUE-[N]`, `GEN-SSH-PUB-KEY`, and `GEN-PASSWORD` parameter values generate blank input fields for users to input values. |
| 78 | + - When Azure encounters the `GEN-UNIQUE`, `GEN-UNIQUE-[N]`, `GEN-SSH-PUB-KEY`, and `GEN-PASSWORD` parameter values in the ARM template file, blank fields i for users to input values. |
55 | 79 |
|
56 |
| - :::image type="content" source="./media/devtest-lab-create-environment-from-arm/add.png" alt-text="Screenshot that shows the Add pane for a SharePoint environment." lightbox="./media/devtest-lab-create-environment-from-arm/add.png"::: |
| 80 | + :::image type="content" source="./media/devtest-lab-create-environment-from-arm/add.png" alt-text="Screenshot that shows the Add pane for a SharePoint environment." lightbox="./media/devtest-lab-create-environment-from-arm/add.png"::: |
57 | 81 |
|
58 | 82 | 1. Select **Add** to create the environment.
|
59 | 83 |
|
@@ -256,7 +280,8 @@ To automate ARM environment template deployment with Azure PowerShell:
|
256 | 280 | ./deployenv.ps1 -SubscriptionId "000000000-0000-0000-0000-0000000000000" -LabName "mydevtestlab" -ResourceGroupName "mydevtestlabRG000000" -RepositoryName "myRepository" -TemplateName "ARM template folder name" -EnvironmentName "myNewEnvironment"
|
257 | 281 | ```
|
258 | 282 |
|
259 |
| -## Next steps |
| 283 | +## Related content |
260 | 284 |
|
261 |
| -- [Public ARM environment template repository](https://github.com/Azure/azure-devtestlab/tree/master/Environments) |
262 |
| -- [Azure quickstart template gallery](https://github.com/Azure/azure-quickstart-templates) |
| 285 | +- [Use ARM templates to create DevTest Labs virtual machines](./devtest-lab-use-resource-manager-template.md) |
| 286 | +- [Public ARM environment template repository on GitHub](https://github.com/Azure/azure-devtestlab/tree/master/Environments) |
| 287 | +- [Azure Quickstart template gallery on GitHub](https://github.com/Azure/azure-quickstart-templates) |
0 commit comments