|
1 | 1 | ---
|
2 | 2 | title: How to test your app in Azure
|
3 |
| -description: Learn how to create a file share in a lab and mount it on your local machine and a virtual machine in the lab, and then deploy desktop/web applications to the file share and test them. |
4 |
| -ms.topic: tutorial |
5 |
| -ms.date: 11/02/2021 |
| 3 | +description: Learn how to deploy desktop/web applications to a file share and test them. |
| 4 | +ms.topic: how-to |
| 5 | +ms.date: 11/03/2021 |
6 | 6 | ---
|
7 | 7 |
|
8 | 8 | # Test your app in Azure
|
9 |
| -This article provides steps for testing your application in Azure using DevTest Labs. First, you set up a file share within a lab and mount it as a drive on your local development machine and a VM inside a lab. Then, you use Visual Studio 2019 to deploy your app to the file share so that you can run the app on the VM in the lab. |
10 | 9 |
|
11 |
| -[!INCLUDE [updated-for-az](../../includes/updated-for-az.md)] |
| 10 | +In this guide, you'll learn how to test your application in Azure using DevTest Labs. You use Visual Studio to deploy your app to an Azure file share. Then you'll access the share from a lab virtual machine (VM). |
| 11 | + |
| 12 | +## Prerequisites |
12 | 13 |
|
13 |
| -## Prerequisites |
14 | 14 | - An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
|
15 | 15 |
|
16 |
| -2. Follow instructions in [this article](devtest-lab-create-lab.md) to create a lab using Azure DevTest Labs. Pin the lab to your dashboard so that you can easily find it next time you sign in. Azure DevTest Labs enables you to create resources within Azure quickly by minimizing waste and controlling cost. To learn more about DevTest Labs, see [overview](devtest-lab-overview.md). |
| 16 | +- A local workstation with [Visual Studio](https://visualstudio.microsoft.com/free-developer-offers/). |
17 | 17 |
|
18 |
| -1. Create an Azure Storage account in the lab's resource group by following instructions in the [Create a storage account](../storage/common/storage-account-create.md) article. On the **Create storage account** page, select **Use existing** for **Resource group**, and select the **lab's resource group**. |
19 |
| -1. Create a file share in your Azure storage by following instructions in the [Create a file share in Azure Files](../storage/files/storage-how-to-create-file-share.md) article. |
| 18 | +- A lab in [DevTest Labs](devtest-lab-overview.md). |
20 | 19 |
|
21 |
| -## Mount the file share on your local machine |
22 |
| -1. On your local machine, use the script from [Mount the Azure file share](../storage/files/storage-how-to-use-files-windows.md#mount-the-azure-file-share) section of [Use an Azure file share with Windows](../storage/files/storage-how-to-use-files-windows.md) article. |
23 |
| -2. Then, use `net use` command to mount the file share on your machine. Here is the sample command: Specify your Azure storage name and file share name before running the command. |
| 20 | +- An [Azure virtual machine](devtest-lab-add-vm.md) running Windows in your lab. |
24 | 21 |
|
25 |
| - `net use Z: \\<YOUR AZURE STORAGE NAME>.file.core.windows.net\<YOUR FILE SHARE NAME> /persistent:yes` |
| 22 | +- A [file share](../storage/files/storage-how-to-create-file-share.md) in your lab's existing Azure storage account. A storage account is automatically created with a lab. |
26 | 23 |
|
27 |
| -## Create a VM in the lab |
28 |
| -1. On the **File share** page, select the **resource group** in the breadcrumb menu at the top. You see the **Resource group** page. |
29 |
| - |
30 |
| -  |
31 |
| -2. On the **Resource group** page, select the **lab** you created in DevTest Labs. |
| 24 | +- The [Azure file share mounted](../storage/files/storage-how-to-use-files-windows.md#mount-the-azure-file-share) to your local workstation and lab VM. |
32 | 25 |
|
33 |
| -  |
34 |
| -3. On the **DevTest Lab** page for your lab, select **+ Add** on the toolbar. |
| 26 | +## Publish your app from Visual Studio |
35 | 27 |
|
36 |
| -  |
37 |
| -4. On the **Choose a base** page, search for **smalldisk**, and select **[smalldisk] Windows Server 2016 Data Center**. |
| 28 | +In this section, you publish your app from Visual Studio to your Azure file share. |
38 | 29 |
|
39 |
| -  |
40 |
| -5. On the **Virtual machine** page, specify **virtual machine name**, **user name**, **password**, and select **Create**. |
41 |
| - |
42 |
| -  |
| 30 | +1. Open Visual Studio, and choose **Create a new project** in the Start window. |
43 | 31 |
|
44 |
| -## Mount the file share on your VM |
45 |
| -1. After the virtual machine is created successfully, select the **virtual machine** from the list. |
| 32 | + :::image type="content" source="./media/test-app-in-azure/launch-visual-studio.png" alt-text="Screenshot of visual studio start page."::: |
46 | 33 |
|
47 |
| -  |
48 |
| -2. Select **Connect** on the toolbar to connect to the VM. |
49 |
| -3. [Install Azure PowerShell](/powershell/azure/install-az-ps). |
50 |
| -4. Follow instructions in the Mount the file share section. |
| 34 | +1. Select **Console Application** and then **Next**. |
51 | 35 |
|
52 |
| -## Publish your app from Visual Studio |
53 |
| -In this section, you publish your app from Visual Studio to a test VM in the cloud. |
| 36 | + :::image type="content" source="./media/test-app-in-azure/select-console-application.png" alt-text="Screenshot of option to choose console application."::: |
| 37 | + |
| 38 | +1. On the **Configure your new project** page, leave the defaults, and select **Next**. |
| 39 | + |
| 40 | +1. On the **Additional information** page, leave the defaults and select **Create**. |
54 | 41 |
|
55 |
| -1. Create a desktop/web application by using Visual Studio 2019. |
56 |
| -2. Build your app. |
57 |
| -3. To publish your app, right-click your project in the **Solution Explorer**, and select **Publish**. |
58 |
| -4. In the **Publish wizard**, enter the **drive** that's mapped to your file share. |
| 42 | +1. From **Solution Explorer**, right-click your project and select **Build**. |
59 | 43 |
|
60 |
| - **Desktop app:** |
| 44 | +1. From **Solution Explorer**, right-click your project and select **Publish** |
61 | 45 |
|
62 |
| -  |
| 46 | + :::image type="content" source="./media/test-app-in-azure/publish-application.png" alt-text="Screenshot of option to publish application."::: |
63 | 47 |
|
64 |
| - **Web app:** |
| 48 | +1. On the **Publish** page, select **Folder** and then **Next**. |
65 | 49 |
|
66 |
| -  |
| 50 | + :::image type="content" source="./media/test-app-in-azure/publish-to-folder.png" alt-text="Screenshot of option to publish to folder."::: |
67 | 51 |
|
68 |
| -1. Select **Next** to complete the publish workflow, and select **Finish**. When you finish the wizard steps, Visual Studio builds your application and publishes it to your file share. |
| 52 | +1. For the **Specific target** option, select **Folder** and then **Next**. |
69 | 53 |
|
| 54 | +1. For the **Location** option, select **Browse**, and select the file share you mounted earlier. Then Select **OK**, and then **Finish**. |
| 55 | + |
| 56 | + :::image type="content" source="./media/test-app-in-azure/selecting-file-share.png" alt-text="Screenshot of option to select file share."::: |
| 57 | + |
| 58 | +1. Select **Publish**. Visual Studio builds your application and publishes it to your file share. |
| 59 | + |
| 60 | + :::image type="content" source="./media/test-app-in-azure/final-publish.png" alt-text="Screenshot of option to select file share."::: |
70 | 61 |
|
71 | 62 | ## Test the app on your test VM in the lab
|
72 | 63 |
|
73 |
| -1. Navigate to the virtual machine page for your VM in the lab. |
74 |
| -2. Select **Start** on the toolbar to start the VM if it's in stopped state. You can set up auto-start and auto-shutdown policies for your VM to avoid starting and stopping each time. |
75 |
| -3. Select **Connect**. |
| 64 | +1. Connect to your lab virtual machine. |
76 | 65 |
|
77 |
| -  |
78 |
| -4. Within the virtual machine, launch **File Explorer**, and select **This PC** to find your file share. |
| 66 | +1. Within the virtual machine, launch **File Explorer**, and select **This PC** to find the file share you mounted earlier. |
79 | 67 |
|
80 |
| -  |
| 68 | + :::image type="content" source="./media/test-app-in-azure/find-share-on-vm.png" alt-text="Screenshot of file explorer."::: |
81 | 69 |
|
82 |
| - > [!NOTE] |
83 |
| - > For any reason, if you are unable to find your file share on your virtual machine or on your local machine, you can remount it by running the `net use` command. You can find the `net use` command on the **Connect** Wizard of your **File Share** in the Azure portal. |
84 | 70 | 1. Open the file share and confirm that you see the app you deployed from Visual Studio.
|
85 | 71 |
|
86 |
| -  |
| 72 | + :::image type="content" source="./media/test-app-in-azure/open-file-share.png" alt-text="Screenshot of contents of file share."::: |
87 | 73 |
|
88 | 74 | You can now access and test your app within the test VM you created in Azure.
|
89 | 75 |
|
90 | 76 | ## Next steps
|
| 77 | + |
91 | 78 | See the following articles to learn how to use VMs in a lab.
|
92 | 79 |
|
93 | 80 | - [Add a VM to a lab](devtest-lab-add-vm.md)
|
|
0 commit comments