Skip to content

Repo sync for protected branch #10366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions docs/azure/includes/vs-2019/create-aspnet5-app-2019.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@ author: ghogen
ms.subservice: azure-development
ms.author: ghogen
ms.topic: include
ms.date: 03/08/2021
ms.date: 08/22/2024
---

1. In the Visual Studio start window, select **Create a new project**.

1. Select **ASP.NET Core Web App**, and then select **Next**.

1. Enter a name for your new application (or use the default name), specify the location on disk, and then select **Next**.
1. Choose the .NET version you want to target. If you don't know, [choose the LTS (long-term support) release](https://dotnet.microsoft.com/download/dotnet).

![Create a web project - Additional information screen](../../media/create-aspnet5-app/net-core-50-enable-docker-support-visual-studio.png)
1. Select the .NET version you want to target. If you're not sure, [choose the LTS (long-term support) release](https://dotnet.microsoft.com/download/dotnet).

:::image type="content" source="../../media/create-aspnet5-app/net-core-50-enable-docker-support-visual-studio.png" border="false" alt-text="Screenshot that shows how to create a new ASP.NET Core web app project in Visual Studio 2019.":::

1. Choose whether you want SSL support by selecting or clearing the **Configure for HTTPS** checkbox.

1. Select the **Enable Docker Support** checkbox.
1. Select the type of container you want (Windows or Linux), and then select **Create**.

1. Use the dropdown list to select the type of container you want: **Windows** or **Linux**.

1. Select **Create** to complete the process.
15 changes: 11 additions & 4 deletions docs/azure/includes/vs-2022/create-aspnet5-app-2022.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@ author: ghogen
ms.subservice: azure-development
ms.author: ghogen
ms.topic: include
ms.date: 10/25/2021
ms.date: 08/22/2024
---

1. In the Visual Studio start window, select **Create a new project**.

1. Select **ASP.NET Core Web App**, and then select **Next**.

1. Enter a name for your new application (or use the default name), specify the location on disk, and then select **Next**.
1. Choose the .NET version you want to target. If you don't know, [choose the LTS (long-term support) release](https://dotnet.microsoft.com/download/dotnet).

![Create a web project - Additional information screen](../../media/create-aspnet5-app/asp-net-enable-docker-support-visual-studio.png)
1. Select the .NET version you want to target. If you're not sure, [choose the LTS (long-term support) release](https://dotnet.microsoft.com/download/dotnet).

:::image type="content" source="../../media/create-aspnet5-app/asp-net-enable-docker-support-visual-studio.png" border="false" alt-text="Screenshot that shows how to create a new ASP.NET Core web app project in Visual Studio 2022.":::

1. Choose whether you want SSL support by selecting or clearing the **Configure for HTTPS** checkbox.

1. Select the **Enable Docker** checkbox.
1. In the **Docker OS** textbox, select the type of container you want (Windows or Linux), and then select **Create**.

1. Use the **Docker OS** dropdown list to select the type of container you want: **Windows** or **Linux**.

1. Select **Create** to complete the process.
113 changes: 66 additions & 47 deletions docs/containers/hosting-web-apps-in-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,103 +6,122 @@ manager: mijacobs
ms.devlang: dotnet
ms.topic: how-to
ms.subservice: container-tools
ms.date: 10/27/2021
ms.date: 08/22/2024
ms.author: ghogen

#customer intent: As a developer, I want to use Visual Studio Container Tools, so I can deploy a containerized ASP.NET or ASP.NET Core web app to Azure Container Registry.
---

# Deploy an ASP.NET container to a container registry using Visual Studio

Docker is a lightweight container engine, similar in some ways to a virtual machine, which you can use to host applications and services.
This tutorial walks you through using Visual Studio to publish your containerized application to an [Azure Container Registry](https://azure.microsoft.com/services/container-registry).
This tutorial walks you through using Visual Studio to publish your containerized application to an [Azure Container Registry](https://azure.microsoft.com/products/container-registry).

If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/dotnet/?utm_source=acr-publish-doc&utm_medium=docs&utm_campaign=docs) before you begin.
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/pricing/purchase-options/azure-account?icid=dotnet?utm_source=acr-publish-doc&utm_medium=docs&utm_campaign=docs) before you begin.

## Prerequisites

To complete this tutorial:

::: moniker range="vs-2019"
- Install the latest version of [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/?cid=learn-onpage-download-cta) with the "ASP.NET and web development" workload
- Install [Docker Desktop for Windows](https://docs.docker.com/desktop/windows/install/)

- Install the latest version of [Visual Studio 2019](https://visualstudio.microsoft.com/vs/older-downloads/) with the "ASP.NET and web development" workload.

::: moniker-end
::: moniker range=">=vs-2022"
- Install the latest version of [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/?cid=learn-onpage-download-cta) with the "ASP.NET and web development" workload
- Install [Docker Desktop for Windows](https://docs.docker.com/desktop/windows/install/)

- Install the latest version of [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/?cid=learn-onpage-download-cta) with the "ASP.NET and web development" workload.

:::moniker-end

- Install [Docker Desktop for Windows](https://docs.docker.com/desktop/windows/install/).

## Create an ASP.NET Core web app

The following steps guide you through creating a basic ASP.NET Core app that will be used in this tutorial. If you already have a project, you can skip this section.
The following steps guide you through creating a basic ASP.NET Core app that you use in this tutorial. If you already have a project, you can skip this section.

::: moniker range="vs-2019"

[!INCLUDE [create-aspnet5-app](../azure/includes/vs-2019/create-aspnet5-app-2019.md)]

::: moniker-end
:::moniker range=">=vs-2022"

[!INCLUDE [create-aspnet5-app](../azure/includes/vs-2022/create-aspnet5-app-2022.md)]

::: moniker-end

## Publish your container to Azure Container Registry

::: moniker range="vs-2019"

## Publish your container to Azure Container Registry
1. Right-click your project in **Solution Explorer** and choose **Publish**. The **Publish** dialog opens.

1. Right-click your project in **Solution Explorer** and choose **Publish**.
2. On the **Publish** dialog, select **Docker Container Registry**.
1. On the **Target** tab, select **Docker Container Registry**, and then select **Next**.

![Screenshot of Publish dialog - choose Docker Container Registry.](media/container-tools/vs-2019/docker-container-registry.png)
:::image type="content" source="media/container-tools/vs-2019/docker-container-registry.png" border="false" alt-text="Screenshot that shows the Publish dialog and how to choose Docker Container Registry.":::

3. Choose **Create New Azure Container Registry**.
1. On the **Specific target** tab, select **Azure Container Registry**, and then select **Next**.

![Screenshot of Publish dialog - choose Create New Azure container registry.](media/container-tools/vs-2019/select-existing-or-create-new-azure-container-registry.png)
1. On the **Container Registry** tab, select the **Create a new Azure Container Registry** option at the bottom:

4. Fill in your desired values in the **Azure Container Registry** screen.
:::image type="content" source="media/container-tools/vs-2019/select-existing-or-create-new-azure-container-registry.png" border="false" alt-text="Screenshot of the Publish dialog that shows how to choose Create New Azure container registry.":::

| Setting | Suggested value | Description |
| ------------ | ------- | -------------------------------------------------- |
| **DNS Prefix** | Globally unique name | Name that uniquely identifies your container registry. |
| **Subscription** | Choose your subscription | The Azure subscription to use. |
| **[Resource Group](/azure/azure-resource-manager/resource-group-overview)** | myResourceGroup | Name of the resource group in which to create your container registry. Choose **New** to create a new resource group.|
| **[SKU](/azure/container-registry/container-registry-skus)** | Standard | Service tier of the container registry |
| **Registry Location** | A location close to you | Choose a Location in a [region](https://azure.microsoft.com/regions/) near you or near other services that will use your container registry. |
1. On the **Azure Container Registry** page, enter your values for the new resource:

![Screenshot of Visual Studio's create Azure Container Registry dialog.](media/hosting-web-apps-in-docker/vs-azure-container-registry-provisioning-dialog-2019.png)
| Setting | Suggested value | Description |
| ------------ | ------- | -------------------------------------------------- |
| **DNS Prefix** | Globally unique name | Name that uniquely identifies your container registry. |
| **Subscription** | Your subscription | The Azure subscription to use. |
| **[Resource Group](/azure/azure-resource-manager/management/overview)**| Your resource group | Name of the resource group in which to create your container registry. Select **New** to create a new resource group. |
| **[SKU](/azure/container-registry/container-registry-skus)** | "Standard" | Select the service tier of the container registry. |
| **Registry Location** | A nearby location | Choose a location in a [region](https://azure.microsoft.com/explore/global-infrastructure/geographies/) close to you or close to other services that you expect to use the container registry. |

5. Click **Create**.
:::image type="content" source="media/hosting-web-apps-in-docker/vs-azure-container-registry-provisioning-dialog-2019.png" border="false" alt-text="Screenshot that shows how to enter values in the dialog to create a new Azure Container Registry.":::

6. Choose **Finish** to complete the process.
::: moniker-end
1. After you enter the resource values, select **Create**.

Visual Studio validates the property values and creates the new container resource.
When the process completes, Visual Studio returns to the **Publish** dialog and selects the new container in the list.

1. Select **Finish** to publish the new container.

::: moniker-end
::: moniker range=">=vs-2022"

## Publish your container to Azure Container Registry
1. Right-click your project in **Solution Explorer** and choose **Publish**. The **Publish** dialog opens.

1. On the **Target** tab, select **Docker Container Registry**, and then select **Next**.

:::image type="content" source="media/container-tools/vs-2022/docker-container-registry.png" border="false" alt-text="Screenshot that shows the Publish dialog and how to choose Docker Container Registry.":::

1. On the **Specific target** tab, select **Azure Container Registry**, and then select **Next**.

1. Right-click your project in **Solution Explorer** and choose **Publish**.
2. On the **Publish** dialog, select **Docker Container Registry**.
1. On the **Registry** tab, select the **Create new** (+) option at the right:

![Screenshot of Publish dialog - choose Docker Container Registry.](media/container-tools/vs-2022/docker-container-registry.png)
:::image type="content" source="media/container-tools/vs-2022/select-existing-or-create-new-azure-container-registry.png" border="false" alt-text="Screenshot of the Publish dialog that shows how to choose Create New Azure container registry.":::

3. Choose **Create New Azure Container Registry**.
1. Fill in your desired values in the **Azure Container Registry** screen.

![Screenshot of Publish dialog - choose Create New Azure container registry.](media/container-tools/vs-2022/select-existing-or-create-new-azure-container-registry.png)
| Setting | Suggested value | Description |
| ------------ | ------- | -------------------------------------------------- |
| **DNS Prefix** | Globally unique name | Name that uniquely identifies your container registry. |
| **Subscription** | Your subscription | The Azure subscription to use. |
| **[Resource Group](/azure/azure-resource-manager/management/overview)**| Your resource group | Name of the resource group in which to create your container registry. Select **New** to create a new resource group. |
| **[SKU](/azure/container-registry/container-registry-skus)** | "Standard" | Select the service tier of the container registry. |
| **Registry Location** | A nearby location | Choose a location in a [region](https://azure.microsoft.com/explore/global-infrastructure/geographies/) close to you or close to other services that you expect to use the container registry. |

4. Fill in your desired values in the **Azure Container Registry** screen.
:::image type="content" source="media/container-tools/vs-2022/vs-azure-container-registry-provisioning-dialog.png" border="false" alt-text="Screenshot that shows how to enter values in the dialog to create a new Azure Container Registry.":::

| Setting | Suggested value | Description |
| ------------ | ------- | -------------------------------------------------- |
| **DNS Prefix** | Globally unique name | Name that uniquely identifies your container registry. |
| **Subscription** | Choose your subscription | The Azure subscription to use. |
| **[Resource Group](/azure/azure-resource-manager/resource-group-overview)** | myResourceGroup | Name of the resource group in which to create your container registry. Choose **New** to create a new resource group.|
| **[SKU](/azure/container-registry/container-registry-skus)** | Standard | Service tier of the container registry |
| **Registry Location** | A location close to you | Choose a Location in a [region](https://azure.microsoft.com/regions/) near you or near other services that will use your container registry. |
1. After you enter the resource values, select **Create**.

![Screenshot of Visual Studio's create Azure Container Registry dialog.](media/container-tools/vs-2022/vs-azure-container-registry-provisioning-dialog.png)
Visual Studio validates the property values and creates the new container resource.
When the process completes, Visual Studio returns to the **Publish** dialog and selects the new container in the list.

5. Click **Create**.
1. Select **Finish** to publish the new container.

6. Choose **Finish** to complete the process.
::: moniker-end

You can now pull the container from the registry to any host capable of running Docker images, for example [Azure Container Instances](/azure/container-instances/container-instances-tutorial-deploy-app).
You can now pull the container from the registry to any host capable of running Docker images, such as [Azure Container Instances](/azure/container-instances/container-instances-tutorial-deploy-app).

## Related content

[Quickstart: Deploy a container instance in Azure using the Azure CLI](/azure/container-instances/container-instances-quickstart)
- [Quickstart: Deploy a container instance in Azure using the Azure CLI](/azure/container-instances/container-instances-quickstart)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/designers/windows-forms-designer-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ Using the designer you can:
> [!NOTE]
> Use Windows Forms Designer, and not the Resource Editor, to make changes to a form's resource (*.resx*) file. If you edit a form-based .resx file, you'll see a warning that changes you make in the Resource Editor may be lost. This is because the Windows Forms Designer generates the .resx file.
> [!CAUTION]
> Windows Forms Designer executes application code when displaying controls or forms on the design surface. Only open projects from [trusted locations](..\ide\reference\trust-settings.md).
> [!CAUTION]
> Resources in `.resx` files may be serialized using `BinaryFormatter`, which is [not secure](/dotnet/standard/serialization/binaryformatter-security-guide). Only use Windows Forms Designer to work with forms and controls that you trust.
## See also

- [Windows Forms overview](/dotnet/framework/winforms/windows-forms-overview)
Expand Down
Loading