Skip to content

Commit 9e7c5c5

Browse files
committed
changes
1 parent 9b30365 commit 9e7c5c5

File tree

4 files changed

+34
-22
lines changed

4 files changed

+34
-22
lines changed

articles/devtest-labs/devtest-lab-use-resource-manager-template.md

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: RoseHJM
77
ms.date: 03/10/2025
88
ms.custom: UpdateFrequency2
99

10-
#customer intent: As a lab user, I want to know how to create, manage, and access ARM templates, so I can use the templates to create VMs.
10+
#customer intent: As a lab user, I want to know how to create, manage, and access ARM templates for creating Azure VMs, so I can use the templates to create more VMs.
1111
---
1212

1313
# Create and manage ARM templates for VMs in DevTest Labs
@@ -16,7 +16,7 @@ This article describes how DevTest Labs users can:
1616

1717
- View, edit, and save Azure Resource Manager (ARM) templates for creating Azure VMs.
1818
- Store the ARM templates in source control repositories.
19-
- Connect the ARM template repositories to Azure DevTest Labs so other lab users can access the templates.
19+
- Access the ARM template repositories in Azure DevTest Labs to use the templates.
2020

2121
[!INCLUDE [About Azure Resource Manager](~/reusable-content/ce-skilling/azure/includes/resource-manager-quickstart-introduction.md)]
2222

@@ -49,11 +49,9 @@ For more information on creating lab VMs, see [Create lab virtual machines in Az
4949
<a name="set-vm-expiration-date"></a>
5050
## Edit ARM templates for VMs
5151

52-
When you reuse the ARM template to create more VMs, you might want to update the parameters and values in your template file. To update only the template `parameters` section without having to edit the main template file, you can create and edit a separate file called *azuredeploy.parameters.json*.
52+
When you reuse the ARM template to create more VMs, you can update the parameters and values in your template file. To update only the template `parameters` section without having to edit the main template file, you can create and edit a separate file called *azuredeploy.parameters.json*.
5353

54-
For example, in training, demo, and trial scenarios, you can automatically delete VMs after a certain date so they don't keep incurring costs. When you create a lab VM in the Azure portal, you can specify the **Expiration date** on the **Advanced settings** tab. You can also add an `expirationDate` parameter to an ARM template. For an example template, see [Create a new VM in a lab with a specified expiration date](https://github.com/Azure/azure-devtestlab/tree/master/samples/DevTestLabs/QuickStartTemplates/101-dtl-create-vm-username-pwd-customimage-with-expiration).
55-
56-
The following example shows an `expirationDate` parameter.
54+
For example, in training, demo, and trial scenarios, you can automatically delete VMs after a certain date so they don't keep incurring costs. When you create a lab VM in the Azure portal, you can specify the **Expiration date** on the **Advanced settings** tab. You can also add an `expirationDate` parameter or change the value in an ARM template.
5755

5856
```json
5957
"parameters": {
@@ -64,12 +62,14 @@ The following example shows an `expirationDate` parameter.
6462
}
6563
```
6664

65+
For an example template, see [Create a new VM in a lab with a specified expiration date](https://github.com/Azure/azure-devtestlab/tree/master/samples/DevTestLabs/QuickStartTemplates/101-dtl-create-vm-username-pwd-customimage-with-expiration).
66+
6767
>[!TIP]
6868
>To create a URI value for automatically managing *nested templates*, you can add the `_artifactsLocation` and `_artifactsLocationSasToken` parameters to your `parameters` section or file. For more information about nested templates, see [Deploy nested Azure Resource Manager templates for testing environments](deploy-nested-template-environments.md).
6969
7070
### Create multiple VMs at once
7171

72-
In the Azure portal, you can create more than one instance of a VM at a time by specifying **Number of instances** on the **Advanced Settings** tab of the VM creation screen. In the ARM template, the `copy` parameter in the `resources` section determines the number of instances to create.
72+
In the Azure portal, you can create more than one instance of a VM at a time by specifying **Number of instances** on the **Advanced Settings** tab of the VM creation screen. In an ARM template, you can add or edit the `copy` parameter in the `resources` section to specify the number of instances to create.
7373

7474
```json
7575
"copy": {
@@ -94,39 +94,51 @@ The following screenshot shows a typical ARM template folder structure in a repo
9494

9595
:::image type="content" source="media/devtest-lab-use-arm-template/repo-structure.png" alt-text="Screenshot that shows key ARM template files in a repository.":::
9696

97-
## Add template repositories to labs
97+
## Access template repositories for labs
9898

9999
To see and access the template repositories available to your lab:
100100

101101
1. On the lab's **Overview** page in the Azure portal, select **Configuration and policies** from the left navigation.
102102
1. On the **Configuration and policies** page, select **Repositories** under **External resources** in the left navigation.
103+
1. Copy the **Git Clone URL**s and connect to the repos to access the templates.
104+
105+
:::image type="content" source="media/devtest-lab-use-arm-template/public-repo.png" alt-text="Screenshot that shows the Repositories configuration screen." lightbox="media/devtest-lab-use-arm-template/public-repo.png":::
103106

104107
The **Public Artifact Repo** and **Public Environment Repo** at the [DevTest Labs public GitHub repository](https://github.com/Azure/azure-devtestlab) are available for all labs. If these repos aren't enabled for your lab, a lab owner or contributor can enable them by selecting the checkboxes next to **Public Artifact Repo** and **Public Environment Repo**, and then selecting **Enable** on the top menu bar. For more information, see [Enable and configure public environments](devtest-lab-create-environment-from-arm.md#configure-public-environment-settings).
105108

106-
If you're a lab owner or contributor, you can add a private ARM template repository to the lab so all lab users can access its templates.
109+
## Add template repositories to labs
107110

108-
1. On the **Repositories** page, select **Add** in the top menu bar.
111+
Lab owners or contributors can add ARM template repositories to their labs so all lab users can access the templates. To add a repo, select **Add** in the top menu bar of the **Repositories** page.
109112

110-
:::image type="content" source="media/devtest-lab-use-arm-template/public-repo.png" alt-text="Screenshot that shows the Repositories configuration screen.":::
113+
# [GitHub repo](#tab/GitHubRepo/)
111114

112115
1. On the **Repository** screen, enter the following information:
113-
114116
- **Name**: Repository name.
115-
- **Git clone URL**: The Git HTTPS clone URL from GitHub or Azure Repos.
117+
- **Git clone URL**: The Git HTTPS clone URL from GitHub.
116118
- **Branch** (optional): The branch that has the ARM template definitions.
117119
- **Azure Resource Manager template folder path**: The folder path, relative to the Git clone URI, for the ARM template definitions.
120+
- **Authentication type**: The authentication method to securely access the repository, **Personal access token** or **GitHub App**.
121+
- To get a personal access token, select your profile in GitHub and then select **Settings** > **Developer settings** > **Personal access tokens**.
122+
- To use the GitHub app, select **Sign in with GitHub** and sign in if necessary. You must have the [Microsoft DevCenter GitHub App](https://github.com/apps/microsoft-devcenter) installed.
123+
1. Select **Save**.
118124

119-
1. For **Authentication type**, specify the authentication method to securely access the repository.
120-
- For GitHub repos, select **Personal access token** or **GitHub App** authentication.
121-
- To get a personal access token from GitHub, select your profile and then select **Settings** > **Developer settings** > **Personal access tokens**.
122-
- To use the GitHub app, you must have the [Microsoft DevCenter GitHub App](https://github.com/apps/microsoft-devcenter) installed. If necessary, select **Sign in with GitHub** and sign in to GitHub.
123-
- For Azure Repos repos, select **Personal access token** or **Managed Identity** authentication.
124-
- To get a personal access token from Azure Repos, select **User settings** at upper right and then select **Personal access tokens**.
125-
- To use managed identity, add the lab's system-assigned managed identity to the Azure DevOps organization as a user. For more information, see [Add an artifact repo](add-artifact-repository.md?tabs=DevOpsRepoMSI#add-an-artifact-repo).
125+
:::image type="content" source="media/devtest-lab-use-arm-template/repo-values-gh.png" alt-text="Screenshot that shows GitHub settings for adding a new template repository to a lab.":::
126126

127+
# [Azure Repos repo](#tab/DevOpsRepo/)
128+
129+
1. On the **Repository** screen, enter the following information:
130+
- **Name**: Repository name.
131+
- **Git clone URL**: The Git HTTPS clone URL from Azure Repos.
132+
- **Branch** (optional): The branch that has the ARM template definitions.
133+
- **Azure Resource Manager template folder path**: The folder path, relative to the Git clone URI, for the ARM template definitions.
134+
- **Authentication type**: The authentication method to securely access the repository, **Personal access token** or **Managed Identity**.
135+
- To get a personal access token, select **User settings** at upper right in Azure DevOps and then select **Personal access tokens**.
136+
- To use managed identity, add the lab's system-assigned managed identity to the Azure DevOps organization as a user. For more information, see [Add an artifact repo](add-artifact-repository.md?tabs=DevOpsRepoMSI#add-an-artifact-repo).
127137
1. Select **Save**.
128138

129-
:::image type="content" source="media/devtest-lab-use-arm-template/repo-values-gh.png" alt-text="Screenshot that shows settings for adding a new template repository to a lab.":::
139+
:::image type="content" source="media/devtest-lab-use-arm-template/repo-values.png" alt-text="Screenshot that shows Azure Repos settings for adding a new template repository to a lab.":::
140+
141+
---
130142

131143
The repository now appears in the **Repositories** list for the lab. Lab users can use the repository templates to [create multi-VM DevTest Labs environments](devtest-lab-create-environment-from-arm.md). Lab administrators can use the templates to [automate lab deployment and management tasks](devtest-lab-use-arm-and-powershell-for-lab-resources.md#arm-template-automation).
132144

@@ -149,4 +161,4 @@ For more information about deployment, see [Template deployment process](/azure/
149161
- [Best practices for creating ARM templates](/azure/azure-resource-manager/templates/best-practices)
150162
- [Add a Git repository to store custom artifacts and ARM templates](devtest-lab-add-artifact-repo.md)
151163
- [Use ARM templates to create DevTest Labs environments](devtest-lab-create-environment-from-arm.md)
152-
- [ARM quickstart templates for DevTest Labs automation](https://github.com/Azure/azure-quickstart-templates)
164+
- [Quickstart ARM templates for DevTest Labs automation](https://github.com/Azure/azure-quickstart-templates)
30.3 KB
Loading
13.7 KB
Loading
-9 Bytes
Loading

0 commit comments

Comments
 (0)