Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f8bfddc

Browse files
committedJan 5, 2022
changes
1 parent ebd1306 commit f8bfddc

12 files changed

+351
-444
lines changed
 

‎.openpublishing.redirection.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16109,7 +16109,12 @@
1610916109
},
1611016110
{
1611116111
"source_path_from_root": "/articles/lab-services/devtest-lab-add-artifact-repo.md",
16112-
"redirect_url": "/azure/devtest-labs/devtest-lab-add-artifact-repo",
16112+
"redirect_url": "/azure/devtest-labs/devtest-lab-add-artifact-repository",
16113+
"redirect_document_id": true
16114+
},
16115+
{
16116+
"source_path_from_root": "/articles/devtest-labs/devtest-lab-add-artifact-repo.md",
16117+
"redirect_url": "/azure/devtest-labs/devtest-lab-add-artifact-repository",
1611316118
"redirect_document_id": true
1611416119
},
1611516120
{

‎articles/devtest-labs/TOC.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,6 @@
197197
items:
198198
- name: Custom images vs. formulas
199199
href: devtest-lab-comparing-vm-base-image-types.md
200-
- name: Manage environment templates
201-
items:
202-
- name: Add a Git repository for artifacts and templates
203-
href: devtest-lab-add-artifact-repo.md
204200
- name: Manage custom images
205201
items:
206202
- name: Create custom image from a VM
@@ -288,6 +284,8 @@
288284
href: troubleshoot-vm-environment-creation-failures.md
289285
- name: Troubleshoot artifact failures
290286
href: devtest-lab-troubleshoot-artifact-failure.md
287+
- name: Troubleshoot issues when applying artifacts
288+
href: devtest-lab-troubleshoot-apply-artifacts.md
291289
- name: Monitor
292290
items:
293291
- name: View activity logs

‎articles/devtest-labs/add-artifact-repository.md

Lines changed: 198 additions & 206 deletions
Large diffs are not rendered by default.

‎articles/devtest-labs/add-artifact-vm.md

Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,55 @@
11
---
22
title: Add an artifact to a VM
3-
description: Learn how to add an artifact to a virtual machine in a lab in Azure DevTest Labs
3+
description: Learn how to add an artifact to a virtual machine in a lab in Azure DevTest Labs.
44
ms.topic: how-to
5-
ms.date: 06/26/2020
5+
ms.date: 01/04/2022
66
ms.custom: devx-track-azurepowershell
77
---
88

9-
# Add an artifact to a VM
10-
While creating a VM, you can add existing artifacts to it. These artifacts can be from either the [public DevTest Labs Git repository](https://github.com/Azure/azure-devtestlab/tree/master/Artifacts) or from your own Git repository. This article shows you how to add artifacts in the Azure portal, and by using Azure PowerShell.
9+
# Add artifacts to DevTest Labs VMs
1110

12-
Azure DevTest Labs *artifacts* let you specify *actions* that are performed when the VM is provisioned, such as running Windows PowerShell scripts, running Bash commands, and installing software. Artifact *parameters* let you customize the artifact for your particular scenario.
11+
You can add *artifacts* to Azure DevTest Labs virtual machines (VMs). DevTest Labs artifacts specify actions to perform when provisioning a VM, such as running Windows PowerShell scripts, running Bash commands, or installing software. You can use parameters to customize artifacts for your scenarios.
1312

14-
To learn about how to create custom artifacts, see the article: [Create custom artifacts](devtest-lab-artifact-author.md).
13+
DevTest Labs artifacts can come from the [public DevTest Labs Git repository](https://github.com/Azure/azure-devtestlab/tree/master/Artifacts) or from private Git repositories. To create your own custom artifacts and store them in a repository, see [Create custom artifacts](devtest-lab-artifact-author.md). To add your artifact repository to a lab so lab users can access the custom artifacts, see [Add an artifact repository to your lab in DevTest Labs](add-artifact-repository.md).
1514

16-
[!INCLUDE [updated-for-az](../../includes/updated-for-az.md)]
15+
This article describes how to add available artifacts to VMs in the Azure portal or by using Azure PowerShell.
16+
17+
## Add artifacts to VMs from the Azure portal
18+
19+
1. In the [Azure portal](https://go.microsoft.com/fwlink/p/?LinkID=525040), go to the lab that has the VM you want to add artifacts to.
20+
1. On the lab **Overview** page, under **My virtual machines**, select the VM you want to add artifacts to.
21+
1. On the VM page, select **Artifacts** in the top menu bar or left navigation.
22+
1. On the **Artifacts** page, select **Apply artifacts**.
23+
1. On the **Add artifacts** page, select the arrow next to each artifact you want to add to the VM.
24+
1. On each **Add artifact** pane, enter any required and optional parameter values, and then select **OK**.
25+
1. When you're done adding artifacts, select **Install**.
26+
27+
After the artifacts install, they appear on the VM's **Artifacts** page.
1728

18-
## Use Azure portal
19-
1. Sign in to the [Azure portal](https://go.microsoft.com/fwlink/p/?LinkID=525040).
20-
1. Select **All Services**, and then select **DevTest Labs** from the list.
21-
1. From the list of labs, select the lab containing the VM with which you want to work.
22-
1. Select **My virtual machines**.
23-
1. Select the desired VM.
24-
1. Select **Manage artifacts**.
25-
1. Select **Apply artifacts**.
26-
1. On the **Apply artifacts** pane, select the artifact you wish to add to the VM.
27-
1. On the **Add artifact** pane, enter the required parameter values and any optional parameters that you need.
28-
1. Select **Add** to add the artifact and return to the **Apply artifacts** pane.
29-
1. Continue adding artifacts as needed for your VM.
30-
1. Once you've added your artifacts, you can [change the order in which the artifacts are run](#change-the-order-in-which-artifacts-are-run). You can also go back to [view or modify an artifact](#view-or-modify-an-artifact).
31-
1. When you're done adding artifacts, select **Apply**
32-
33-
### Change the order in which artifacts are run
34-
By default, the actions of the artifacts are executed in the order in which they are added to the VM.
35-
The following steps illustrate how to change the order in which the artifacts are run.
29+
<!-- After you add artifacts, you can modify them or change the order they run in.
30+
31+
### View or modify artifacts
32+
33+
To view installed artifacts, select **Artifacts** from the top menu bar on the VM's **Overview** page.
34+
35+
To modify an artifact, select it from the list on the **Artifacts** page.
36+
1. On the **Add artifact** pane, make any needed changes, and select **OK** to close the **Add artifact** pane.
37+
38+
### Change the order to run artifacts
39+
40+
By default, artifact actions execute in the order you added them to the VM. To change the order in which the artifacts are run.
3641
3742
1. At the top of the **Apply artifacts** pane, select the link indicating the number of artifacts that have been added to the VM.
3843
3944
![Number of artifacts added to VM](./media/devtest-lab-add-vm-with-artifacts/devtestlab-add-artifacts-blade-selected-artifacts.png)
4045
1. On the **Selected artifacts** pane, drag and drop the artifacts into the desired order. If you have trouble dragging the artifact, make sure that you are dragging from the left side of the artifact.
41-
1. Select **OK** when done.
46+
1. Select **OK** when done. -->
4247

43-
### View or modify an artifact
44-
The following steps illustrate how to view or modify the parameters of an artifact:
48+
## Add artifacts to VMs by using Azure PowerShell
4549

46-
1. At the top of the **Apply artifacts** pane, select the link indicating the number of artifacts that have been added to the VM.
47-
48-
![Number of artifacts added to VM](./media/devtest-lab-add-vm-with-artifacts/devtestlab-add-artifacts-blade-selected-artifacts.png)
49-
1. On the **Selected artifacts** pane, select the artifact that you want to view or edit.
50-
1. On the **Add artifact** pane, make any needed changes, and select **OK** to close the **Add artifact** pane.
51-
1. Select **OK** to close the **Selected artifacts** pane.
50+
[!INCLUDE [updated-for-az](../../includes/updated-for-az.md)]
5251

53-
## Use PowerShell
54-
The following script applies the specified artifact to the specified VM. The [Invoke-AzResourceAction](/powershell/module/az.resources/invoke-azresourceaction) command is the one that performs the operation.
52+
The following PowerShell script applies an artifact to a VM by using the [Invoke-AzResourceAction](/powershell/module/az.resources/invoke-azresourceaction) cmdlet.
5553

5654
```powershell
5755
#Requires -Module Az.Resources
@@ -60,13 +58,13 @@ param
6058
(
6159
[Parameter(Mandatory=$true, HelpMessage="The ID of the subscription that contains the lab")]
6260
[string] $SubscriptionId,
63-
[Parameter(Mandatory=$true, HelpMessage="The name of the lab containing the virtual machine")]
61+
[Parameter(Mandatory=$true, HelpMessage="The name of the lab that has the VM")]
6462
[string] $DevTestLabName,
65-
[Parameter(Mandatory=$true, HelpMessage="The name of the virtual machine")]
63+
[Parameter(Mandatory=$true, HelpMessage="The name of the VM")]
6664
[string] $VirtualMachineName,
6765
[Parameter(Mandatory=$true, HelpMessage="The repository where the artifact is stored")]
6866
[string] $RepositoryName,
69-
[Parameter(Mandatory=$true, HelpMessage="The artifact to apply to the virtual machine")]
67+
[Parameter(Mandatory=$true, HelpMessage="The artifact to apply to the VM")]
7068
[string] $ArtifactName,
7169
[Parameter(ValueFromRemainingArguments=$true)]
7270
$Params
@@ -79,7 +77,7 @@ Set-AzContext -SubscriptionId $SubscriptionId | Out-Null
7977
$resourceGroupName = (Get-AzResource -ResourceType 'Microsoft.DevTestLab/labs' | Where-Object { $_.Name -eq $DevTestLabName}).ResourceGroupName
8078
if ($resourceGroupName -eq $null) { throw "Unable to find lab $DevTestLabName in subscription $SubscriptionId." }
8179
82-
# Get the internal repo name
80+
# Get the internal repository name
8381
$repository = Get-AzResource -ResourceGroupName $resourceGroupName `
8482
-ResourceType 'Microsoft.DevTestLab/labs/artifactsources' `
8583
-ResourceName $DevTestLabName `
@@ -99,7 +97,7 @@ $template = Get-AzResource -ResourceGroupName $resourceGroupName `
9997
10098
if ($template -eq $null) { throw "Unable to find template $ArtifactName in lab $DevTestLabName." }
10199
102-
# Find the virtual machine in Azure
100+
# Find the VM in Azure
103101
$FullVMId = "/subscriptions/$SubscriptionId/resourceGroups/$resourceGroupName`
104102
/providers/Microsoft.DevTestLab/labs/$DevTestLabName/virtualmachines/$virtualMachineName"
105103
@@ -110,10 +108,10 @@ $FullArtifactId = "/subscriptions/$SubscriptionId/resourceGroups/$resourceGroupN
110108
/providers/Microsoft.DevTestLab/labs/$DevTestLabName/artifactSources/$($repository.Name)`
111109
/artifacts/$($template.Name)"
112110
113-
# Handle the inputted parameters to pass through
111+
# Handle the input parameters to pass through
114112
$artifactParameters = @()
115113
116-
# Fill artifact parameter with the additional -param_ data and strip off the -param_
114+
# Fill the artifact parameter with the additional -param_ data and strip off the -param_
117115
$Params | ForEach-Object {
118116
if ($_ -match '^-param_(.*)') {
119117
$name = $_.TrimStart('^-param_')
@@ -123,7 +121,7 @@ $Params | ForEach-Object {
123121
}
124122
}
125123
126-
# Create structure for the artifact data to be passed to the action
124+
# Create a structure to pass the artifact data to the action
127125
128126
$prop = @{
129127
artifacts = @(
@@ -134,7 +132,7 @@ artifacts = @(
134132
)
135133
}
136134
137-
# Check the VM
135+
# Apply the artifact
138136
if ($virtualMachine -ne $null) {
139137
# Apply the artifact by name to the virtual machine
140138
$status = Invoke-AzResourceAction -Parameters $prop -ResourceId $virtualMachine.ResourceId -Action "applyArtifacts" -ApiVersion 2016-05-15 -Force
@@ -150,7 +148,6 @@ if ($virtualMachine -ne $null) {
150148
```
151149

152150
## Next steps
153-
See the following articles on artifacts:
154151

155152
- [Specify mandatory artifacts for your lab](devtest-lab-mandatory-artifacts.md)
156153
- [Create custom artifacts](devtest-lab-artifact-author.md)

‎articles/devtest-labs/devtest-lab-add-artifact-repo.md

Lines changed: 0 additions & 85 deletions
This file was deleted.
Lines changed: 70 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
---
2-
title: Create custom artifacts for your Azure DevTest Labs virtual machine
3-
description: Learn how to create and use artifacts to deploy and set up applications after you provision a virtual machine.
2+
title: Create custom artifacts for Azure DevTest Labs virtual machines
3+
description: Learn how to create and use artifacts to deploy and set up applications on DevTest Labs virtual machines.
44
ms.topic: how-to
5-
ms.date: 06/26/2020
5+
ms.date: 01/04/2022
66
---
77

8-
# Create custom artifacts for your DevTest Labs virtual machine
8+
# Create custom artifacts for DevTest Labs virtual machine
99

10-
Watch the following video for an overview of the steps described in this article:
10+
You can add *artifacts* to Azure DevTest Labs virtual machines (VMs). DevTest Labs artifacts specify actions to perform when provisioning a VM. An artifact consists of an artifact definition file and other script files that you store in a folder in a Git repository.
1111

12-
> [!VIDEO https://channel9.msdn.com/Blogs/Azure/how-to-author-custom-artifacts/player]
13-
>
14-
>
12+
This article describes how to create custom artifact files. For information about adding artifacts to VMs, see [Add artifacts to DevTest Labs VMs](add-artifact-vm.md). For information about adding artifact repositories to labs, see [Add an artifact repository to your lab in DevTest Labs](add-artifact-repository.md).
1513

16-
## Overview
17-
You can use *artifacts* to deploy and set up your application after you provision a VM. An artifact consists of an artifact definition file and other script files that are stored in a folder in a Git repository. Artifact definition files consist of JSON expressions that specify what you want to install on a VM. For example, you can define the name of an artifact, a command to run, and available parameters for the command. You can refer to other script files within the artifact definition file by name.
14+
## Artifact definition files
1815

19-
## Artifact definition file format
20-
The following example shows the sections that make up the basic structure of a definition file:
16+
Artifact definition files are JSON expressions that specify what you want to install on a VM. The files define the name of an artifact, a command to run, and available parameters for the command. You can refer to other script files by name within the artifact definition file.
17+
18+
The following example shows the sections that make up the basic structure of an *artifactfile.json* definition file:
2119

2220
```json
2321
{
@@ -39,18 +37,19 @@ The following example shows the sections that make up the basic structure of a d
3937
}
4038
```
4139

42-
| Element name | Required? | Description |
43-
| --- | --- | --- |
44-
| `$schema` |No |Location of the JSON schema file. The JSON schema file can help you test the validity of the definition file. |
45-
| `title` |Yes |Name of the artifact displayed in the lab. |
46-
| `description` |Yes |Description of the artifact displayed in the lab. |
47-
| `iconUri` |No |URI of the icon displayed in the lab. |
48-
| `targetOsType` |Yes |Operating system of the VM where the artifact is installed. Supported options are Windows and Linux. |
49-
| `parameters` |No |Values that are provided when the artifact install command is run on a machine. Parameters help you customize your artifact. |
50-
| `runCommand` |Yes |Artifact install command that is executed on a VM. |
40+
| Element name | Description |
41+
| --- | --- |
42+
| `$schema` |Location of the JSON schema file. The JSON schema file can help you test the validity of the definition file.|
43+
| `title` |Name of the artifact to display in the lab. **Required.**|
44+
| `description` |Description of the artifact to display in the lab. **Required.**|
45+
| `iconUri` |URI of the icon to display in the lab.|
46+
| `targetOsType` |Operating system of the VM to install the artifact on. Supported values: `Windows`, `Linux`. **Required.**|
47+
| `parameters` |Values to customize the artifact when installing on the VM.|
48+
| `runCommand` |The artifact install command to execute on the VM. **Required.**|
5149

5250
### Artifact parameters
53-
In the parameters section of the definition file, specify which values a user can input when they install an artifact. You can refer to these values in the artifact install command.
51+
52+
In the parameters section of the definition file, specify values a user can input when installing an artifact. You can refer to these values in the artifact install command.
5453

5554
To define parameters, use the following structure:
5655

@@ -64,21 +63,24 @@ To define parameters, use the following structure:
6463
}
6564
```
6665

67-
| Element name | Required? | Description |
68-
| --- | --- | --- |
69-
| `type` |Yes |Type of parameter value. See the following list for the allowed types. |
70-
| `displayName` |Yes |Name of the parameter that is displayed to a user in the lab. |
71-
| `description` |Yes |Description of the parameter that is displayed in the lab. |
66+
| Element name | Description |
67+
| --- | --- |
68+
| `type` |Type of parameter value. **Required.**|
69+
| `displayName` |Name of the parameter to display to the lab user. **Required.**|
70+
| `description` |Description of the parameter to display to the lab user. **Required.**|
71+
72+
Allowed parameter value types are:
7273

73-
Allowed types are:
74+
| Type | Description |
75+
| --- | --- |
76+
|`string`|Any valid JSON string|
77+
|`int`|Any valid JSON integer|
78+
|`bool`|Any valid JSON boolean|
79+
|`array`|Any valid JSON array|
7480

75-
* `string` (any valid JSON string)
76-
* `int` (any valid JSON integer)
77-
* `bool` (any valid JSON Boolean)
78-
* `array` (any valid JSON array)
81+
### Secrets as secure strings
7982

80-
## Secrets as secure strings
81-
Declare secrets as secure strings. Here's the syntax for declaring a secure string parameter within the `parameters` section of the **artifactfile.json** file:
83+
To declare secrets as secure string parameters with masked characters in the UI, use the following syntax in the `parameters` section of the *artifactfile.json* file:
8284

8385
```json
8486

@@ -90,29 +92,30 @@ Declare secrets as secure strings. Here's the syntax for declaring a secure stri
9092
},
9193
```
9294

93-
For the artifact install command, run the PowerShell script that takes the secure string created by using the ConvertTo-SecureString command.
95+
In the artifact install command, run the PowerShell script that takes the secure string created by using the `ConvertTo-SecureString` command.
9496

9597
```json
9698
"runCommand": {
9799
"commandToExecute": "[concat('powershell.exe -ExecutionPolicy bypass \"& ./artifact.ps1 -StringParam ''', parameters('stringParam'), ''' -SecureStringParam (ConvertTo-SecureString ''', parameters('securestringParam'), ''' -AsPlainText -Force) -IntParam ', parameters('intParam'), ' -BoolParam:$', parameters('boolParam'), ' -FileContentsParam ''', parameters('fileContentsParam'), ''' -ExtraLogLines ', parameters('extraLogLines'), ' -ForceFail:$', parameters('forceFail'), '\"')]"
98100
}
99101
```
100102

101-
For the complete example artifactfile.json and the artifact.ps1 (PowerShell script), see [this sample on GitHub](https://github.com/Azure/azure-devtestlab/tree/master/Artifacts/windows-test-paramtypes).
103+
Don't log secrets to the console, because the script captures output for user debugging.
102104

103-
Another important point to note is to not log secrets to the console, as output is captured for user debugging.
105+
### Artifact expressions and functions
104106

105-
## Artifact expressions and functions
106-
You can use expressions and functions to construct the artifact install command. Expressions evaluate when the artifact installs. Expressions can appear anywhere in a JSON string value, and always return another JSON value. Enclose expressions with brackets, [ and ]. If you need to use a literal string that starts with a [ bracket, use two brackets [[.
107+
You can use expressions and functions to construct the artifact install command. Expressions evaluate when the artifact installs. Expressions can appear anywhere in a JSON string value, and always return another JSON value. Enclose expressions with brackets, \[ and \]. If you need to use a literal string that starts with a bracket, use two brackets \[\[.
107108

108-
Typically, you use expressions with functions to construct a value. Just like in JavaScript, function calls are formatted as **functionName(arg1, arg2, arg3)**.
109+
You usually use expressions with functions to construct a value. Function calls are formatted as `functionName(arg1, arg2, arg3)`.
109110

110-
The following list shows common functions:
111+
Common functions include:
111112

112-
* **parameters(parameterName)**: Returns a parameter value that is provided when the artifact command is run.
113-
* **concat(arg1, arg2, arg3,….. )**: Combines multiple string values. This function can take various arguments.
113+
| Function | Description |
114+
| --- | --- |
115+
|`parameters(parameterName)`|Returns a parameter value to provide when the artifact command runs.|
116+
|`concat(arg1, arg2, arg3, ...)`|Combines multiple string values. This function can take various arguments.|
114117

115-
The following example shows how to use expressions and functions to construct a value:
118+
The following example uses expressions and functions to construct a value:
116119

117120
```json
118121
runCommand": {
@@ -125,23 +128,30 @@ The following example shows how to use expressions and functions to construct a
125128

126129
## Create a custom artifact
127130

128-
1. Install a JSON editor. You need a JSON editor to work with artifact definition files. We recommend using [Visual Studio Code](https://code.visualstudio.com/), which is available for Windows, Linux, and OS X.
129-
2. Get a sample artifactfile.json definition file. Check out the artifacts created by the DevTest Labs team in our [GitHub repository](https://github.com/Azure/azure-devtestlab). We've created a rich library of artifacts that can help you create your own artifacts. Download an artifact definition file and make changes to it to create your own artifacts.
130-
3. Make use of IntelliSense. Use IntelliSense to see valid elements that you can use to construct an artifact definition file. You also can see the different options for values of an element. For example, when you edit the **targetOsType** element, IntelliSense shows you two choices, for Windows or Linux.
131-
4. Store the artifact in the [public Git repository for DevTest Labs](https://github.com/Azure/azure-devtestlab/tree/master/Artifacts) or [your own Git repository](devtest-lab-add-artifact-repo.md). In the public repository, you can view artifacts shared by others that you can use directly or customize them to suit your needs.
132-
133-
1. Create a separate directory for each artifact. The directory name should be the same as the artifact name.
134-
2. Store the artifact definition file (artifactfile.json) in the directory that you created.
135-
3. Store the scripts that are referenced from the artifact install command.
136-
137-
Here's an example of how an artifact folder might look:
131+
To create a custom artifact:
132+
133+
- Install a JSON editor to work with artifact definition files. [Visual Studio Code](https://code.visualstudio.com/) is available for Windows, Linux, and MacOS.
134+
135+
- Start with a sample *artifactfile.json* definition file.
136+
137+
The public [DevTest Labs artifact repository](https://github.com/Azure/azure-devtestlab/tree/master/Artifacts) has a rich library of artifacts you can use. You can download an artifact definition file and customize it to create your own artifacts. This article uses the *artifactfile.json* definition file and *artifact.ps1* PowerShell script at [https://github.com/Azure/azure-devtestlab/tree/master/Artifacts/windows-test-paramtypes](https://github.com/Azure/azure-devtestlab/tree/master/Artifacts/windows-test-paramtypes).
138+
139+
- Use IntelliSense to see valid elements and value options you can use to construct an artifact definition file. For example, when you edit the `targetOsType` element, IntelliSense shows you `Windows` or `Linux` options.
140+
141+
- Store your artifacts in public or private Git artifact repositories.
142+
143+
- Store each *artifactfile.json* artifact definition file in a separate directory named the same as the artifact name.
144+
- Store the scripts that the install command references in the same directory as the artifact definition file.
138145

139-
![Screenshot that shows an artifact folder example.](./media/devtest-lab-artifact-author/git-repo.png)
140-
5. If you're using your own repository to store artifacts, add the repository to the lab by following instructions in the article: [Add a Git repository for artifacts and templates](devtest-lab-add-artifact-repo.md).
146+
The following screenshot shows an an example artifact folder:
147+
148+
![Screenshot that shows an example artifact folder.](./media/devtest-lab-artifact-author/git-repo.png)
141149

142-
## Related articles
143-
* [How to diagnose artifact failures in DevTest Labs](devtest-lab-troubleshoot-artifact-failure.md)
144-
* [Join a VM to an existing Active Directory domain by using a Resource Manager template in DevTest Labs](https://www.visualstudiogeeks.com/blog/DevOps/Join-a-VM-to-existing-AD-domain-using-ARM-template-AzureDevTestLabs)
150+
- To store your custom artifacts in the public [DevTest Labs artifact repository](https://github.com/Azure/azure-devtestlab/tree/master/Artifacts), open a pull request against the repo.
151+
- To add your private artifact repository to a lab, see [Add an artifact repository to your lab in DevTest Labs](add-artifact-repository.md).
145152

146153
## Next steps
147-
* Learn how to [add a Git artifact repository to a lab](devtest-lab-add-artifact-repo.md).
154+
155+
- [Add artifacts to DevTest Labs VMs](add-artifact-vm.md)
156+
- [Diagnose artifact failures in the lab](devtest-lab-troubleshoot-artifact-failure.md)
157+
- [Troubleshoot issues when applying artifacts](devtest-lab-troubleshoot-apply-artifacts.md)
Lines changed: 32 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,62 @@
11
---
2-
title: Create an Azure DevTest Labs custom image from a VHD file
3-
description: Learn how to create a custom image in Azure DevTest Labs from a VHD file using the Azure portal
2+
title: Create an Azure DevTest Labs virtual machine custom image from a VHD file
3+
description: Learn how to use a VHD file to create an Azure DevTest Labs virtual machine custom image in the Azure portal.
44
ms.topic: how-to
5-
ms.date: 06/26/2020
5+
ms.date: 01/04/2022
66
---
77

88
# Create a custom image from a VHD file
99

1010
[!INCLUDE [devtest-lab-create-custom-image-from-vhd-selector](../../includes/devtest-lab-create-custom-image-from-vhd-selector.md)]
1111

12-
[!INCLUDE [devtest-lab-custom-image-definition](../../includes/devtest-lab-custom-image-definition.md)]
13-
14-
[!INCLUDE [devtest-lab-upload-vhd-options](../../includes/devtest-lab-upload-vhd-options.md)]
15-
16-
## Step-by-step instructions
17-
18-
The following steps walk you through creating a custom image from a VHD file using the Azure portal:
19-
20-
1. Sign in to the [Azure portal](https://go.microsoft.com/fwlink/p/?LinkID=525040).
12+
You can create a virtual machine (VM) custom image for Azure DevTest Labs by using a virtual hard drive (VHD) file.
2113

22-
1. Select **All services**, and then select **DevTest Labs** from the list.
23-
24-
1. From the list of labs, select the desired lab.
25-
26-
1. On the lab's main pane, select **Configuration and policies**.
14+
[!INCLUDE [devtest-lab-custom-image-definition](../../includes/devtest-lab-custom-image-definition.md)]
2715

28-
1. On the **Configuration and policies** pane, select **Custom images**.
16+
This article describes how to create a custom image in the Azure portal. You can also [use PowerShell](devtest-lab-create-custom-image-from-vhd-using-powershell.md) to create a custom image.
2917

30-
1. On the **Custom images** pane, select **+Add**.
18+
[!INCLUDE [devtest-lab-upload-vhd-options](../../includes/devtest-lab-upload-vhd-options.md)]
3119

32-
![Add Custom image](./media/devtest-lab-create-template/add-custom-image.png)
20+
## Azure portal instructions
3321

34-
1. Enter the name of the custom image. This name is displayed in the list of base images when creating a VM.
22+
To create a custom image from a VHD file in DevTest Labs in the Azure portal, follow these steps:
3523

36-
1. Enter the description of the custom image. This description is displayed in the list of base images when creating a VM.
24+
1. In the [Azure portal](https://go.microsoft.com/fwlink/p/?LinkID=525040), go to the **Overview** page for the lab that has the uploaded VHD file.
3725

38-
1. For **OS type**, select either **Windows** or **Linux**.
26+
1. Select **Configuration and policies** in the left navigation.
3927

40-
- If you select **Windows**, specify via the checkbox whether *sysprep* has been run on the machine.
41-
- If you select **Linux**, specify via the checkbox whether *deprovision* has been run on the machine.
28+
1. On the **Configuration and policies** pane, select **Custom images** under **Virtual machine bases** in the left navigation.
4229

43-
1. Select a **VHD** from the drop-down menu. This is the VHD that will be used to create the new custom image. If necessary, select to **Upload a VHD using PowerShell**.
30+
1. On the **Custom images** page, select **Add**.
4431

45-
1. You can also enter a plan name, plan offer, and plan publisher if the image used to create the custom image is not a licensed image (published by Microsoft).
32+
![Screenshot that shows the Custom image page with the Add button.](media/devtest-lab-create-template/add-custom-image.png)
4633

47-
- **Plan name:** Enter the name of the Marketplace image (SKU) from which this custom image is created
48-
- **Plan offer:** Enter the product (offer) of the Marketplace image from which this custom image is created
49-
- **Plan publisher:** Enter the publisher of the Marketplace image from which this custom image is created
34+
1. On the **Add custom image** page:
5035

51-
> [!NOTE]
52-
> If the image you are using to create a custom image is **not** a licensed image, then these fields are empty and can be filled in if you choose. If the image **is** a licensed image, then the fields are auto populated with the plan information. If you try to change them in this case, a warning message is displayed.
53-
>
54-
>
36+
- Enter a name for the custom image to display in the list of base images for creating a VM.
37+
- Enter an optional description to display in the base image list.
38+
- Under **OS type**, select whether the OS for the VHD and custom image is **Windows** or **Linux**.
39+
- If you select **Windows**, select the checkbox if you ran *sysprep* on the machine before you created the VHD file.
40+
- If you select **Linux**, select the checkbox if you ran *deprovision* on the machine before you created the VHD file.
5541

56-
1. Select **OK** to create the custom image.
42+
1. Under **VHD**, select the uploaded VHD file for the custom image from the drop-down menu.
5743

58-
After a few minutes, the custom image is created and is stored inside the lab’s storage account. When a lab user wants to create a new VM, the image is available in the list of base images.
44+
1. Optionally, enter a plan name, plan offer, and plan publisher if the VHD image isn't a licensed image published by Microsoft. If the image is a licensed image, these fields are pre-populated with the plan information.
5945

60-
![Custom image available in list of base images](./media/devtest-lab-create-template/custom-image-available-as-base.png)
46+
- **Plan name:** Name of the non-Microsoft Marketplace image or SKU used to create the VHD image.
47+
- **Plan offer:** Product or offer name for the Marketplace image.
48+
- **Plan publisher:** Publisher of the Marketplace image.
6149

50+
1. Select **OK**.
6251

63-
[!INCLUDE [devtest-lab-try-it-out](../../includes/devtest-lab-try-it-out.md)]
52+
![Screenshot that shows the Add custom image page.](media/devtest-lab-create-template/create-custom-image.png)
6453

65-
## Related blog posts
54+
After creation, the custom image is stored in the lab's storage account. The custom image appears in the list of VM base images. Lab users can create new VMs based on the custom image.
6655

67-
- [Custom images or formulas?](./devtest-lab-faq.yml#blog-post)
68-
- [Copying Custom Images between Azure DevTest Labs](https://www.visualstudiogeeks.com/blog/DevOps/How-To-Move-CustomImages-VHD-Between-AzureDevTestLabs#copying-custom-images-between-azure-devtest-labs)
56+
![Screenshot that shows the Custom images available in the list of base images.](media/devtest-lab-create-template/custom-image-available-as-base.png)
6957

7058
## Next steps
7159

72-
- [Add a VM to your lab](./devtest-lab-add-vm.md)
60+
- [Add a VM to your lab](./devtest-lab-add-vm.md)
61+
- [Compare custom images and formulas in DevTest Labs](devtest-lab-comparing-vm-base-image-types.md)
62+
- [Copying Custom Images between Azure DevTest Labs](https://www.visualstudiogeeks.com/blog/DevOps/How-To-Move-CustomImages-VHD-Between-AzureDevTestLabs#copying-custom-images-between-azure-devtest-labs)
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.