|
1 | 1 | ---
|
2 |
| -title: Upload VHD file to Azure DevTest Labs using AzCopy |
3 |
| -description: This article provides a walkthrough to use the AzCopy command-line utility to upload a VHD file to a lab's storage account in Azure DevTest Labs. |
| 2 | +title: Upload a VHD file to Azure DevTest Labs by using AzCopy |
| 3 | +description: Walk through the steps to use the AzCopy command-line utility to upload a VHD file to a lab storage account in Azure DevTest Labs. |
4 | 4 | ms.topic: how-to
|
5 | 5 | ms.author: rosemalcolm
|
6 | 6 | author: RoseHJM
|
7 |
| -ms.date: 06/26/2020 |
| 7 | +ms.date: 12/22/2022 |
8 | 8 | ---
|
9 | 9 |
|
10 |
| -# Upload VHD file to lab's storage account using AzCopy |
| 10 | +# Upload a VHD file to a lab storage account by using AzCopy |
11 | 11 |
|
12 | 12 | [!INCLUDE [devtest-lab-upload-vhd-selector](../../includes/devtest-lab-upload-vhd-selector.md)]
|
13 | 13 |
|
14 |
| -In Azure DevTest Labs, VHD files can be used to create custom images, which are used to provision virtual machines. |
15 |
| -The following steps walk you through using the AzCopy command-line utility to upload a VHD file to a lab's storage account. Once you've uploaded your VHD file, the [Next steps section](#next-steps) lists some articles that illustrate how to create a custom image from the uploaded VHD file. For more information about disks and VHDs in Azure, see [Introduction to managed disks](../virtual-machines/managed-disks-overview.md) |
| 14 | +In this article, learn how to use the AzCopy command-line utility to upload a VHD file to a lab storage account in Azure DevTest Labs. After you upload your VHD file, you can create a custom image from the uploaded VHD file and use the image to provision a virtual machine. |
16 | 15 |
|
17 |
| -> [!NOTE] |
| 16 | +For more information about disks and VHDs in Azure, see [Introduction to managed disks](../virtual-machines/managed-disks-overview.md). |
| 17 | + |
| 18 | +> [!NOTE] |
18 | 19 | >
|
19 | 20 | > AzCopy is a Windows-only command-line utility.
|
20 | 21 |
|
21 |
| -## Step-by-step instructions |
| 22 | +## Prerequisites |
| 23 | + |
| 24 | +- Download and install the [latest version of AzCopy](https://aka.ms/downloadazcopy). |
| 25 | + |
| 26 | +To upload a VHD file to a lab storage account by using AzCopy, first, get the lab storage account name via the Azure portal. Then, use AzCopy to upload the file. |
22 | 27 |
|
23 |
| -The following steps walk you through uploading a VHD file to Azure DevTest Labs using [AzCopy](https://aka.ms/downloadazcopy). |
| 28 | +## Get the lab storage account name |
24 | 29 |
|
25 |
| -1. Get the name of the lab's storage account using the Azure portal: |
| 30 | +To get the name of the lab storage account: |
26 | 31 |
|
27 | 32 | 1. Sign in to the [Azure portal](https://go.microsoft.com/fwlink/p/?LinkID=525040).
|
28 | 33 |
|
29 |
| -1. Select **All services**, and then select **DevTest Labs** from the list. |
| 34 | +1. Select **All resources**, and then select your lab. |
| 35 | + |
| 36 | +1. In the lab menu under **Settings**, select **Configuration and policies**. |
| 37 | + |
| 38 | +1. In **Activity log**, in the resource menu under **Virtual machine bases**, select **Custom images**. |
| 39 | + |
| 40 | +1. In **Custom images**, select **Add**. |
30 | 41 |
|
31 |
| -1. From the list of labs, select the desired lab. |
| 42 | +1. In **Custom image**, under **VHD**, select the **Upload an image using PowerShell** link. |
32 | 43 |
|
33 |
| -1. On the lab's blade, select **Configuration**. |
| 44 | + :::image type="content" source="media/devtest-lab-upload-vhd-using-azcopy/upload-image-powershell.png" alt-text="Screenshot that shows settings to upload a VHD by using PowerShell on the Custom image pane."::: |
34 | 45 |
|
35 |
| -1. On the lab **Configuration** blade, select **Custom images (VHDs)**. |
| 46 | +1. In **Upload an image using PowerShell**, scroll right to see a call to the Add-AzureRmVhd cmdlet. |
36 | 47 |
|
37 |
| -1. On the **Custom images** blade, Select **+Add**. |
| 48 | + The `-Destination` parameter contains the URI for a blob container in the following format: |
38 | 49 |
|
39 |
| -1. On the **Custom image** blade, select **VHD**. |
| 50 | + `https://<storageAccountName>.blob.core.windows.net/uploads/...` |
40 | 51 |
|
41 |
| -1. On the **VHD** blade, select **Upload a VHD using PowerShell**. |
| 52 | + :::image type="content" source="media/devtest-lab-upload-vhd-using-azcopy/destination-parameter.png" alt-text="Screenshot that shows an example of a URI in the Add VHD box."::: |
42 | 53 |
|
43 |
| -  |
| 54 | +1. Copy the storage account URI to use in the next section. |
44 | 55 |
|
45 |
| -1. The **Upload an image using PowerShell** blade displays a call to the **Add-AzureVhd** cmdlet. |
46 |
| -The first parameter (*Destination*) contains the URI for a blob container (*uploads*) in the following format: |
| 56 | +## Upload a VHD file |
47 | 57 |
|
48 |
| - ``` |
49 |
| - https://<STORAGE-ACCOUNT-NAME>.blob.core.windows.net/uploads/... |
50 |
| - ``` |
| 58 | +To upload a VHD file by using AzCopy: |
51 | 59 |
|
52 |
| -1. Make note of the full URI as it is used in later steps. |
| 60 | +1. In Windows, open a Command Prompt window and go to the AzCopy installation directory. |
53 | 61 |
|
54 |
| -1. Upload the VHD file using AzCopy: |
55 |
| - |
56 |
| -1. [Download and install the latest version of AzCopy](https://aka.ms/downloadazcopy). |
| 62 | + By default, AzCopy is installed in *ProgramFiles(x86)\Microsoft SDKs\Azure\AzCopy*. |
57 | 63 |
|
58 |
| -1. Open a command window and navigate to the AzCopy installation directory. Optionally, you can add the AzCopy installation location to your system path. By default, AzCopy is installed to the following directory: |
| 64 | + Optionally, you can add the AzCopy installation location to your system path. |
59 | 65 |
|
60 |
| - ```command-line |
61 |
| - %ProgramFiles(x86)%\Microsoft SDKs\Azure\AzCopy |
62 |
| - ``` |
| 66 | +1. At the command prompt, run the following command. Use the storage account key and blob container URI you copied from the Azure portal. The value for `vhdFileName` must be in quotes. |
63 | 67 |
|
64 |
| -1. Using the storage account key and blob container URI, run the following command at the command prompt. The *vhdFileName* value needs to be in quotes. The process of uploading a VHD file can be lengthy depending on the size of the VHD file and your connection speed. |
| 68 | + ```cmd |
| 69 | + AzCopy /Source:<sourceDirectory> /Dest:<blobContainerUri> /DestKey:<storageAccountKey> /Pattern:"<vhdFileName>" /BlobType:page |
| 70 | + ``` |
65 | 71 |
|
66 |
| - ```command-line |
67 |
| - AzCopy /Source:<sourceDirectory> /Dest:<blobContainerUri> /DestKey:<storageAccountKey> /Pattern:"<vhdFileName>" /BlobType:page |
68 |
| - ``` |
| 72 | +The process of uploading a VHD file might be lengthy depending on the size of the VHD file and your connection speed. |
69 | 73 |
|
70 | 74 | ## Next steps
|
71 | 75 |
|
72 |
| -- [Create a custom image in Azure DevTest Labs from a VHD file using the Azure portal](devtest-lab-create-template.md) |
73 |
| -- [Create a custom image in Azure DevTest Labs from a VHD file using PowerShell](devtest-lab-create-custom-image-from-vhd-using-powershell.md) |
| 76 | +- Learn how to [create a custom image in Azure DevTest Labs from a VHD file by using the Azure portal](devtest-lab-create-template.md). |
| 77 | +- Learn how to [create a custom image in Azure DevTest Labs from a VHD file by using PowerShell](devtest-lab-create-custom-image-from-vhd-using-powershell.md). |
0 commit comments