Skip to content

Commit 5cde41d

Browse files
authored
Merge pull request #4134 from ghogen/docker-tools-work
Docker deployment to App Service
2 parents 0130362 + 005d6f9 commit 5cde41d

20 files changed

+125
-80
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7271,6 +7271,11 @@
72717271
"source_path": "docs/deployment/tutorial-kubernetes-tools.md",
72727272
"redirect_url": "/visualstudio/containers/tutorial-kubernetes-tools",
72737273
"redirect_document_id": true
7274+
},
7275+
{
7276+
"source_path": "docs/containers/vs-azure-tools-docker-setup.md",
7277+
"redirect_url": "/visualstudio/containers/",
7278+
"redirect_document_id": false
72747279
}
72757280
]
72767281
}

docs/azure/includes/create-aspnet5-app.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
title: "include file"
33
description: "include file"
44
services: container-registry
5-
author: mlearned
6-
ms.service: container-registry
7-
ms.author: mlearned
5+
author: ghogen
6+
ms.technology: vs-azure
7+
ms.author: ghogen
88
ms.topic: "include"
99
ms.date: 05/21/2018
1010
ms.custom: "include file"

docs/azure/includes/vs-2019/create-aspnet5-app-2019.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.topic: "include"
88
ms.date: 03/05/2019
99
---
1010

11-
1. From the Visual Studio Start Window, choose **Create a New Project**.
11+
1. From the Visual Studio **Start** window, choose **Create a new project**.
1212
1. Choose **ASP.NET Core Web Application**, and choose **Next**.
1313
1. Give your new application a name (or take the default) and choose **Create**.
1414
1. Choose **Web Application**.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
title: Deploy an ASP.NET Core Docker container to Azure App Service | Microsoft Docs
3+
description: Learn how to use Visual Studio Tools for Docker to deploy an ASP.NET Core web app to Azure App Service
4+
author: ghogen
5+
manager: jillfra
6+
ms.technology: vs-azure
7+
ms.devlang: dotnet
8+
ms.topic: article
9+
ms.date: 03/08/2019
10+
ms.author: ghogen
11+
---
12+
# Deploy an ASP.NET Core container to Azure App Service using Visual Studio
13+
14+
This tutorial walks you through using Visual Studio to publish your containerized ASP.NET Core web application to an [Azure App Service](/azure/app-service). Azure App Service is an appropriate service for a single-container web app hosted in Azure.
15+
16+
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.
17+
18+
## Prerequisites
19+
20+
To complete this tutorial:
21+
22+
::: moniker range="vs-2017"
23+
- Install the latest version of [Visual Studio 2017](https://azure.microsoft.com/downloads/) with the "ASP.NET and web development" workload
24+
::: moniker-end
25+
::: moniker range=">=vs-2019"
26+
- [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2019+rc) with the *ASP.NET and web development* workload.
27+
::: moniker-end
28+
- Install [Docker Desktop](https://docs.docker.com/docker-for-windows/install/)
29+
30+
## Create an ASP.NET Core web app
31+
32+
The following steps guide you through creating a basic ASP.NET Core app that will be used in this tutorial.
33+
34+
::: moniker range="vs-2017"
35+
1. From the Visual Studio menu, select **File > New > Project**.
36+
2. Under the **Templates** section of the **New Project** dialog box, select **Visual C# > Web**.
37+
3. Select **ASP.NET Core Web Application**.
38+
4. Give your new application a name (or take the default) and select **OK**.
39+
5. Select **Web Application**.
40+
6. Check the **Enable Docker Support** checkbox.
41+
7. Select the **Linux** container type and click **OK**. Windows containers are not supported to deploy to Azure App Service as a container.
42+
::: moniker-end
43+
::: moniker range=">= vs-2019"
44+
1. From the Visual Studio **Start** window, choose **Create a new project**.
45+
1. Choose **ASP.NET Core Web Application**, and choose **Next**.
46+
1. Give your new application a name (or take the default) and choose **Create**.
47+
1. Choose **Web Application**.
48+
1. Choose whether or not you want SSL support by using the **Configure for HTTPS** checkbox.
49+
1. Check the **Enable Docker Support** checkbox.
50+
1. Select the **Linux** container type, and click **Create**. Windows containers are not supported to deploy to Azure App Service as a container.
51+
::: moniker-end
52+
53+
## Deploy the container to Azure
54+
55+
1. Right-click your project in **Solution Explorer** and choose **Publish**.
56+
1. On the publish target dialog, choose **App Service Linux**.
57+
1. You can publish only to App Service, or you can publish to both App Service and Azure Container Registry (ACR). To publish the container in an Azure Container Registry (ACR), choose **Create new App Service for containers**, and click **Publish**.
58+
59+
![Screenshot of publish dialog](media/docker-deploy-app-service/publish-app-service-linux.PNG)
60+
61+
To publish only to an Azure App Service without using Azure Container Registry, choose **Create new**, and click **Publish**.
62+
63+
1. Check that you're signed in with the account that's associated with your Azure subscription, and choose a unique name, subscription, resource group, hosting plan, and container registry (if applicable), or accept the defaults.
64+
65+
![Screenshot of publish settings](media/docker-deploy-app-service/publish-app-service-linux2.png)
66+
67+
1. Choose **Create**. Your container is deployed to Azure in the resource group and container registry you selected. This process takes a bit of time. When it's completed, the **Publish** tab shows information about what was published, including the site URL.
68+
69+
![Screenshot of publish tab](media/docker-deploy-app-service/publish-succeeded.PNG)
70+
71+
1. Click on the site link to verify your app works as expected in Azure.
72+
73+
![Screenshot of web application](media/docker-deploy-app-service/web-application-running.png)
74+
75+
1. The publishing profile is saved with all the details you selected, such as the resource group and container registry.
76+
1. To deploy again with the same publishing profile, use the **Publish** button, the **Publish** button on the **Web Publish Activity** window, or right-click on the project in **Solution Explorer** and choose the **Publish** item on the context-menu.
77+
78+
## Clean up resources
79+
80+
To remove all Azure resources associated with this tutorial, delete the resource group using the [Azure portal](https://portal.azure.com). To find the resource group associated with a published web application, choose **View** > **Other Windows** > **Web Publish Activity**, and then choose the gear icon. The **Publish** tab opens, which contains the resource group.
81+
82+
In the Azure portal, choose **Resource groups**, select the resource group to open its details page. Verify that this is the correct resource group, and then choose **Remove resource group**, type the name, and choose **Delete**.
83+
84+
## Next steps
85+
86+
Set up continuous integration and delivery (CI/CD) with [Azure Pipelines](/azure/devops/pipelines/?view=azure-devops).
87+
88+
## See also
89+
90+
[Deploy to Azure Container Registry](vs-azure-tools-docker-hosting-web-apps-in-docker.md)
Loading
Loading
Loading
Loading
Loading
Loading

docs/containers/toc.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
href: tutorial-multicontainer.md
1111
- name: 'Tutorial: Kubernetes in Visual Studio'
1212
href: tutorial-kubernetes-tools.md
13-
- name: Debugging apps in a local Docker container
13+
- name: Debug app in a local Docker container
1414
href: vs-azure-tools-docker-edit-and-refresh.md
15-
- name: Deploy an ASP.NET container to a container registry using Visual Studio
15+
- name: Deploy to a container registry
1616
href: vs-azure-tools-docker-hosting-web-apps-in-docker.md
17-
- name: Configure a Docker Host with VirtualBox
18-
href: vs-azure-tools-docker-setup.md
19-
- name: Troubleshoot Visual Studio 2017 development with Docker
17+
- name: Deploy to Azure App Service
18+
href: docker-deploy-app-service.md
19+
- name: Troubleshoot Visual Studio development with Docker
2020
href: vs-azure-tools-docker-troubleshooting-docker-errors.md

docs/containers/tutorial-kubernetes-tools.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ms.topic: "conceptual"
55
author: ghogen
66
ms.author: ghogen
77
manager: jillfra
8+
ms.technology: vs-azure
89
ms.workload:
910
- "azure"
1011
---
@@ -132,7 +133,7 @@ To do this, you first need to double-check that you've installed everything as d
132133

133134
![Screenshot of Publish menu item](media/tutorial-kubernetes-tools/k8s-tools-publish-project.png)
134135

135-
2. In the **Publish** screen, choose **Container Registry** as the publish target, and follow the prompts to select your container registry. If you don't already have a container registry, choose **Create New Azure Container Registry** to create one from Visual Studio. For more information, see [Publish your container to Azure Container Registry](vs-azure-tools-docker-hosting-web-apps-in-docker.md#2-publish-your-container-to-azure-container-registry).
136+
2. In the **Publish** screen, choose **Container Registry** as the publish target, and follow the prompts to select your container registry. If you don't already have a container registry, choose **Create New Azure Container Registry** to create one from Visual Studio. For more information, see [Publish your container to Azure Container Registry](vs-azure-tools-docker-hosting-web-apps-in-docker.md).
136137

137138
![Screenshot of Pick a publish target screen](media/tutorial-kubernetes-tools/k8s-tools-publish-to-acr.png)
138139

@@ -152,7 +153,7 @@ To do this, you first need to double-check that you've installed everything as d
152153

153154
Updating the command line is useful if there are custom command line arguments that you wish to specify, such as a different Kubernetes context or chart name.
154155

155-
![Screenshoot of Helm configure screen](media/tutorial-kubernetes-tools/k8s-tools-helm-configure-screen.png)
156+
![Screenshot of Helm configure screen](media/tutorial-kubernetes-tools/k8s-tools-helm-configure-screen.png)
156157

157158
6. When you are ready to deploy, click the **Publish** button to publish your application to AKS.
158159

docs/containers/vs-azure-tools-docker-hosting-web-apps-in-docker.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22
title: Deploy an ASP.NET Docker container to Azure Container Registry (ACR) | Microsoft Docs
33
description: Learn how to use Visual Studio Tools for Docker to deploy an ASP.NET Core web app to a container registry
44
services: azure-container-service
5-
documentationcenter: .net
6-
author: mlearned
5+
author: ghogen
76
manager: jillfra
87
ms.assetid: e5e81c5e-dd18-4d5a-a24d-a932036e78b9
9-
ms.service: azure-container-service
108
ms.devlang: dotnet
119
ms.topic: article
12-
ms.tgt_pltfrm: NA
13-
ms.workload: NA
14-
ms.date: 05/21/2018
15-
ms.author: mlearned
10+
ms.technology: vs-azure
11+
ms.date: 03/14/2019
12+
ms.author: ghogen
1613
---
1714
# Deploy an ASP.NET container to a container registry using Visual Studio
1815

@@ -27,15 +24,25 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
2724

2825
To complete this tutorial:
2926

30-
* Install the latest version of [Visual Studio 2017](https://azure.microsoft.com/downloads/) with the "ASP.NET and web development" workload
27+
::: moniker range="vs-2017"
28+
* Install the latest version of [Visual Studio 2017](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2017)with the "ASP.NET and web development" workload
29+
::: moniker-end
30+
::: moniker range=">=vs-2019"
31+
* Install the latest version of [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link&utm_content=download+vs2019+rc) with the "ASP.NET and web development" workload
32+
::: moniker-end
3133
* Install [Docker for Windows](https://docs.docker.com/docker-for-windows/install/)
3234

33-
## 1. Create an ASP.NET Core web app
35+
## Create an ASP.NET Core web app
3436
The following steps guide you through creating a basic ASP.NET Core app that will be used in this tutorial.
3537

38+
::: moniker range="vs-2017"
3639
[!INCLUDE [create-aspnet5-app](../azure/includes/create-aspnet5-app.md)]
40+
::: moniker-end
41+
::: moniker range=">=vs-2019"
42+
[!INCLUDE [create-aspnet5-app](../azure/includes/vs-2019/create-aspnet5-app-2019.md)]
43+
::: moniker-end
3744

38-
## 2. Publish your container to Azure Container Registry
45+
## Publish your container to Azure Container Registry
3946
1. Right-click your project in **Solution Explorer** and choose **Publish**.
4047
2. On the publish target dialog, select the **Container Registry** tab.
4148
3. Choose **New Azure Container Registry** and click **Publish**.

docs/containers/vs-azure-tools-docker-setup.md

Lines changed: 0 additions & 57 deletions
This file was deleted.

docs/containers/vs-azure-tools-docker-troubleshooting-docker-errors.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
22
title: Troubleshooting Docker client errors on Windows | Microsoft Docs
33
description: Troubleshoot problems you encounter when using Visual Studio to create and deploy web apps to Docker on Windows by using Visual Studio 2017.
4-
services: azure-container-service
4+
ms.technology: vs-azure
55
author: devinb
66
manager: jillfra
77
ms.custom: seodec18
88
ms.assetid: 346f70b9-7b52-4688-a8e8-8f53869618d3
9-
ms.service: multiple
109
ms.devlang: dotnet
1110
ms.topic: conceptual
1211
ms.workload: multiple

0 commit comments

Comments
 (0)