Skip to content

Commit 9b30365

Browse files
committed
more edits
1 parent 1d6bbee commit 9b30365

File tree

6 files changed

+24
-51
lines changed

6 files changed

+24
-51
lines changed

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

Lines changed: 24 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Create and manage ARM VM templates
2+
title: Create and manage ARM templates for VMs
33
description: Learn how to view, edit, store, and access Azure Resource Manager (ARM) virtual machine (VM) templates, and how lab admins can add template repositories to labs.
44
ms.topic: how-to
55
ms.author: rosemalcolm
@@ -10,7 +10,7 @@ ms.custom: UpdateFrequency2
1010
#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.
1111
---
1212

13-
# Create and manage ARM VM templates in DevTest Labs
13+
# Create and manage ARM templates for VMs in DevTest Labs
1414

1515
This article describes how DevTest Labs users can:
1616

@@ -22,7 +22,7 @@ This article describes how DevTest Labs users can:
2222

2323
ARM templates for VM creation use the [Microsoft.DevTestLab/labs/virtualmachines](/azure/templates/microsoft.devtestlab/2018-09-15/labs/virtualmachines?pivots=deployment-language-arm-template) resource type. Each lab VM created with this resource type appears as a separate item in the lab's **My virtual machines** list.
2424

25-
Lab users can create their own ARM templates, modify existing ARM templates to meet their needs, or access preconfigured templates from their own or others' private repositories or the public [DevTest Labs GitHub repository](https://github.com/Azure/azure-devtestlab) to use in creating VMs.
25+
Lab users can create their own ARM templates, modify existing ARM templates to meet their needs, or access preconfigured templates from private repositories or the public [DevTest Labs GitHub repository](https://github.com/Azure/azure-devtestlab) to use in creating VMs.
2626

2727
## Prerequisites
2828

@@ -49,42 +49,17 @@ 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 can edit the `parameters` in your template file. You can create and edit a separate file called *azuredeploy.parameters.json* to update only the parameters without having to edit the main template file.
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*.
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 specify the **Expiration date** on the **Advanced settings** tab.
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).
5555

56-
You can add an `expirationDate` property to your ARM template `parameters` section or file. 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).
57-
58-
The following example `parameters` section includes an `expirationDate` parameter.
56+
The following example shows an `expirationDate` parameter.
5957

6058
```json
6159
"parameters": {
62-
"newVMName": {
63-
"type": "string",
64-
"defaultValue": "vm01"
65-
},
66-
"labName": {
67-
"type": "string",
68-
"defaultValue": "Contoso1"
69-
},
70-
"size": {
71-
"type": "string",
72-
"defaultValue": "Standard_D2s_v3"
73-
},
74-
"userName": {
75-
"type": "string",
76-
"defaultValue": "labuser"
77-
},
78-
"hibernationEnabled": {
79-
"type": "bool"
80-
},
8160
"expirationDate": {
8261
"type": "string",
8362
"defaultValue": "2025-03-15T07:00:00.000Z"
84-
},
85-
"password": {
86-
"type": "securestring",
87-
"defaultValue": "[[[user/VmPassword]]"
8863
}
8964
}
9065
```
@@ -113,14 +88,7 @@ Use the following file structure to store an ARM template in a source control re
11388

11489
- Name the main template file *azuredeploy.json*.
11590
- Name any standalone parameter customization file *azuredeploy.parameters.json*.
116-
- Optionally, define metadata that specifies the template display name and description in a file named *metadata.json*, as follows:
117-
118-
```json
119-
{
120-
"itemDisplayName": "<template name>",
121-
"description": "<template description>"
122-
}
123-
```
91+
- Optionally, define metadata such as template display name and description in a file named *metadata.json*.
12492

12593
The following screenshot shows a typical ARM template folder structure in a repository.
12694

@@ -130,34 +98,39 @@ The following screenshot shows a typical ARM template folder structure in a repo
13098

13199
To see and access the template repositories available to your lab:
132100

133-
1. On the lab's **Overview** page, select **Configuration and policies** from the left navigation.
101+
1. On the lab's **Overview** page in the Azure portal, select **Configuration and policies** from the left navigation.
134102
1. On the **Configuration and policies** page, select **Repositories** under **External resources** in the left navigation.
135103

136104
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).
137105

138-
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 the templates.
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.
139107

140108
1. On the **Repositories** page, select **Add** in the top menu bar.
141109

142110
:::image type="content" source="media/devtest-lab-use-arm-template/public-repo.png" alt-text="Screenshot that shows the Repositories configuration screen.":::
143111

144-
1. In the **Repositories** pane, enter the following information:
112+
1. On the **Repository** screen, enter the following information:
113+
114+
- **Name**: Repository name.
115+
- **Git clone URL**: The Git HTTPS clone URL from GitHub or Azure Repos.
116+
- **Branch** (optional): The branch that has the ARM template definitions.
117+
- **Azure Resource Manager template folder path**: The folder path, relative to the Git clone URI, for the ARM template definitions.
145118

146-
- **Name**: Enter the repository name.
147-
- **Git clone URL**: Enter the Git HTTPS clone URL from GitHub or Azure Repos.
148-
- **Branch** (optional): Enter the branch that has your ARM template definitions.
149-
- **Personal access token**: Enter the personal access token to securely access your repository.
150-
- To get a token from Azure Repos, at upper right select **User settings** > **Personal access tokens**.
151-
- To get a token from GitHub, under your profile, select **Settings** > **Developer settings** > **Personal access tokens**.
152-
- **Folder paths**: Enter the folder for the ARM template definitions, relative to the Git clone URI.
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).
153126

154127
1. Select **Save**.
155128

156-
:::image type="content" source="media/devtest-lab-use-arm-template/repo-values.png" alt-text="Screenshot that shows settings for adding a new template repository to a lab.":::
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.":::
157130

158131
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).
159132

160-
## Deploy VMs by using ARM templates
133+
## Use ARM templates to deploy VMs
161134

162135
To create and deploy Azure VMs by using ARM templates, you can use any of the following methods:
163136

365 Bytes
Loading
5.85 KB
Loading
36.7 KB
Loading
-951 Bytes
Loading
33.8 KB
Loading

0 commit comments

Comments
 (0)