You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#customer intent: As a lab user, I want to add artifacts to my VMs so I can use them to run scripts or commands, install tools or applications, or take other actions on my VMs.
9
11
---
10
12
11
13
# Add artifacts to DevTest Labs VMs
12
14
13
-
This article describes how to add *artifacts* to Azure DevTest Labs virtual machines (VMs). Artifacts specify actions to take to provision a VM, such as running Windows PowerShell scripts, running Bash commands, or installing software. You can use parameters to customize the artifacts for your own needs.
15
+
This article describes how to add *artifacts* to Azure DevTest Labs virtual machines (VMs). Artifacts are tools, actions, or software you can add to lab VMs. For example, artifacts can run Windows PowerShell scripts or Bash commands, install tools or applications, or take other actions like joining a domain.
16
+
17
+
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. Lab users can [create their own custom artifacts](devtest-lab-artifact-author.md) and store them in a repository, or use parameters to customize artifacts for their own needs.
18
+
19
+
A lab administrator can [add artifact repositories to a lab](add-artifact-repository.md) so all lab users can access them. Lab administrators can also [specify mandatory artifacts to be installed on all lab VMs](devtest-lab-mandatory-artifacts.md) at creation.
20
+
21
+
You can't change or remove mandatory artifacts at VM creation time, but you can add and configure other available individual artifacts at or after creation time. This article describes how to add available artifacts to VMs by using the Azure portal or Azure PowerShell.
22
+
23
+
## Prerequisites
24
+
25
+
# [Azure portal](#tab/portal)
14
26
15
-
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](add-artifact-repository.md).
27
+
- User access to a lab in DevTest Labs.
16
28
17
-
DevTest Labs lab owners can specify mandatory artifacts to be installed on all lab VMs at creation. For more information, see [Specify mandatory artifacts for DevTest Labs VMs](devtest-lab-mandatory-artifacts.md).
29
+
# [Azure PowerShell](#tab/PowerShell)
18
30
19
-
You can't change or remove mandatory artifacts at VM creation time, but you can add any available individual artifacts. This article describes how to add available artifacts to VMs by using the Azure portal or Azure PowerShell.
31
+
- User access to a lab in DevTest Labs.
32
+
- Azure PowerShell. You can either:
33
+
-[Use Azure Cloud Shell](/azure/cloud-shell/quickstart). Be sure to select the **PowerShell** environment.
34
+
-[Install Azure PowerShell](/powershell/azure/install-azure-powershell) to use on a physical or virtual machine. If necessary, run `Update-Module -Name Az` to update your installation.
20
35
21
-
## Add artifacts to VMs from the Azure portal
36
+
---
37
+
38
+
## Add artifacts to VMs
39
+
40
+
# [Azure portal](#tab/portal)
22
41
23
-
You can add artifacts during VM creation, or add artifacts to existing lab VMs.
42
+
You can use the Azure portal to add artifacts during VM creation or to add artifacts to an existing lab VM.
24
43
25
-
To add artifacts during VM creation:
44
+
### Add artifacts during VM creation
26
45
27
46
1. On the lab's home page, select **Add**.
28
47
1. On the **Choose a base** page, select the type of VM you want.
29
-
1. On the **Create lab resource** screen, select **Add or Remove Artifacts**.
48
+
1. On the **Create lab resource** screen, fill out the **Basic Settings** tab according to the instructions at [Create lab VMs in Azure DevTest Labs](devtest-lab-add-vm.md).
49
+
1. At the bottom of the **Basic Settings** tab, select **Add or Remove Artifacts**.
30
50
1. On the **Add artifacts** page, select the arrow next to each artifact you want to add to the VM.
31
-
1. On each **Add artifact** pane, enter any required and optional parameter values, and then select **OK**. The artifact appears under **Selected artifacts**, and the number of configured artifacts updates.
51
+
1. On each **Add artifact** pane, enter any required and optional parameter values, and then select **OK**. The artifact appears under **Selected artifacts** on the **Add artifacts** page, and the number of configured artifacts updates.
32
52
33
53
:::image type="content" source="./media/add-artifact-vm/devtestlab-add-artifacts-blade-selected-artifacts.png" alt-text="Screenshot that shows adding artifacts on the Add artifacts pane.":::
34
54
35
-
1.You can change the artifacts after adding them.
55
+
1.By default, artifacts install in the order you add them. To rearrange the order, select the ellipsis **...** next to the artifact in the **Selected artifacts** list, and select **Move up**, **Move down**, **Move to top**, or **Move to bottom**.
36
56
37
-
- By default, artifacts install in the order you add them. To rearrange the order, select the ellipsis **...** next to the artifact in the **Selected artifacts** list, and select **Move up**, **Move down**, **Move to top**, or **Move to bottom**.
38
-
- To edit the artifact's parameters, select **Edit** to reopen the **Add artifact** pane.
39
-
- To delete the artifact from the **Selected artifacts** list, select **Delete**.
57
+
- To edit an artifact's parameters after you add it, select the pencil icon, or select **...** next to the artifact and select **Edit**, to reopen the **Add artifact** pane.
58
+
- To delete an artifact from the **Selected artifacts** list, select **...** and then select **Delete**.
40
59
41
-
1. When you're done adding and arranging artifacts, select **OK**.
42
-
1. The **Create lab resource** screen shows the number of artifacts added. To add, edit, rearrange, or delete the artifacts before you create the VM, select **Add or Remove Artifacts** again.
60
+
1. When you're done adding, arranging, and configuring artifacts, select **OK** on the **Add artifacts** page.
61
+
1. The **Artifacts** section of the **Create lab resource** screen shows the number of artifacts added. To add, edit, rearrange, or delete the artifacts before you create the VM, select **Add or Remove Artifacts** again.
62
+
1. Optionally configure any **Advanced Settings** or **Tags**, and then select **Create** and **Create** again at the bottom of the **Create lab resource** screen to create the VM.
43
63
44
64
After you create the VM, the installed artifacts appear on the VM's **Artifacts** page. To see details about each artifact's installation, select the artifact name.
45
65
46
-
To install artifacts on an existing VM:
66
+
### Add artifacts to an existing VM
47
67
48
68
1. From the lab's home page, select the VM from the **My virtual machines** list.
49
-
1. On the VM page, select **Artifacts** in the top menu bar or left navigation.
69
+
1. On the VM page, select **Artifacts** in the top menu bar or under **Operations** in the left navigation.
50
70
1. On the **Artifacts** page, select **Apply artifacts**.
51
71
52
-
:::image type="content" source="./media/add-artifact-vm/artifacts.png" alt-text="Screenshot that shows Artifacts pane for an existing V M.":::
72
+
:::image type="content" source="./media/add-artifact-vm/artifacts.png" alt-text="Screenshot that shows the Artifacts pane for an existing VM.":::
53
73
54
-
1. On the **Add artifacts** page, select and configure artifacts the same as for a new VM.
74
+
1. On the **Add artifacts** page, select and configure artifacts the same way as for a new VM.
55
75
1. When you're done adding artifacts, select **Install**. The artifacts install on the VM immediately.
If necessary, sign in to your Azure account by using the [Connect-AzAccount](/powershell/module/Az.Accounts/Connect-AzAccount) cmdlet. If you have multiple Azure subscriptions, use `Set-AzContext -SubscriptionId "<SubscriptionId>"` and provide the subscription ID you want to use.
60
80
61
-
The following PowerShell script applies an artifact to a VM by using the [Invoke-AzResourceAction](/powershell/module/az.resources/invoke-azresourceaction) cmdlet.
81
+
Run the following PowerShell script to apply an artifact to a VM by using the [Invoke-AzResourceAction](/powershell/module/az.resources/invoke-azresourceaction) cmdlet. Provide the information the script calls for when prompted.
62
82
63
83
```powershell
64
84
#Requires -Module Az.Resources
65
85
66
-
param
67
-
(
86
+
param (
68
87
[Parameter(Mandatory=$true, HelpMessage="The ID of the subscription that contains the lab")]
69
88
[string] $SubscriptionId,
70
89
[Parameter(Mandatory=$true, HelpMessage="The name of the lab that has the VM")]
0 commit comments