Skip to content

Latest commit

 

History

History
89 lines (53 loc) · 4.75 KB

File metadata and controls

89 lines (53 loc) · 4.75 KB
title Deploy ASP.NET container app to Container Registry
description Use Visual Studio Container Tools to deploy a containerized ASP.NET or ASP.NET Core web app to Azure Container Registry.
author ghogen
ms.devlang dotnet
ms.topic how-to
ms.subservice container-tools
ms.date 5/14/2026
ms.author ghogen

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

This tutorial walks you through using Visual Studio to publish your containerized application to an Azure Container Registry.

If you don't have an Azure subscription, create a free account before you begin.

Prerequisites

::: moniker range="vs-2022"

::: moniker range="visualstudio"

:::moniker-end

Create an ASP.NET Core web app

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-2022"

[!INCLUDE create-aspnet5-app]

::: moniker-end

Publish your container to Azure Container Registry

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

  1. Right-click your project in Solution Explorer and choose Publish. The Publish dialog opens.

  2. 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.":::

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

  4. On the Registry tab, select the Create new (+) option at the right:

    :::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.":::

  5. Fill in your desired values in the Azure Container Registry screen.

    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 Your resource group Name of the resource group in which to create your container registry. Select New to create a new resource group.
    SKU "Standard" Select the service tier of the container registry.
    Registry Location A nearby location Choose a location in a region close to you or close to other services that you expect to use the container registry.

    :::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.":::

  6. 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.

  7. Select Finish to publish the new container.

::: moniker-end

You can now pull the container from the registry to any host capable of running Docker images, such as Azure Container Instances.

Related content