You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #288296 from Akhilesh-microsoft/ACA/deploy_visual_studio
[ACA: deploy-visual-studio]: resource-faq]: Verified the article, reviewed the content, and fixed all editorial issues. Updated some latest version related info and ms.date w.r.t freshness pass.
Copy file name to clipboardExpand all lines: articles/container-apps/deploy-visual-studio.md
+27-27Lines changed: 27 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,15 @@ author: alexwolfmsft
6
6
ms.author: alexwolf
7
7
ms.service: azure-container-apps
8
8
ms.topic: tutorial
9
-
ms.date: 3/04/2022
9
+
ms.date: 10/14/2024
10
10
ms.custom: mode-ui, devx-track-dotnet
11
11
---
12
12
13
13
# Tutorial: Deploy to Azure Container Apps using Visual Studio
14
14
15
15
Azure Container Apps enables you to run microservices and containerized applications on a serverless platform. With Container Apps, you enjoy the benefits of running containers while leaving behind the concerns of manually configuring cloud infrastructure and complex container orchestrators.
16
16
17
-
In this tutorial, you'll deploy a containerized ASP.NET Core 6.0 application to Azure Container Apps using Visual Studio. The steps below also apply to earlier versions of ASP.NET Core.
17
+
In this tutorial, you deploy a containerized ASP.NET Core 8.0 application to Azure Container Apps using Visual Studio. The steps below also apply to earlier versions of ASP.NET Core.
18
18
19
19
## Prerequisites
20
20
@@ -23,31 +23,31 @@ In this tutorial, you'll deploy a containerized ASP.NET Core 6.0 application to
23
23
24
24
## Create the project
25
25
26
-
Begin by creating the containerized ASP.NET Core application to deploy to Azure.
26
+
Begin by creating the containerized ASP.NET Core application.
27
27
28
-
1)Inside Visual Studio, select **File** and then choose **New => Project**.
28
+
1)In Visual Studio, select **File** and then choose **New => Project**.
29
29
30
30
2) In the dialog window, search for *ASP.NET*, and then choose **ASP.NET Core Web App** and select **Next**.
31
31
32
32
3) In the **Project Name** field, name the application *MyContainerApp* and then select **Next**.
33
33
34
-
4) On the **Additional Information** screen, make sure to select **Enable Docker**, and then make sure **Linux** is selected for the **Docker OS** setting. Azure Container Apps currently does not support Windows containers. This selection ensures the project template supports containerization by default. While enabled, the project uses a container as it is running or building.
34
+
4) On the **Additional Information** screen, make sure to select **Enable Docker**, and then make sure **Linux** is selected for the **Docker OS** setting. Azure Container Apps currently doesn't support Windows containers. This selection ensures the project template supports containerization by default. While enabled, the project uses a container as it is running or building.
35
35
36
36
5) Click **Create** and Visual Studio creates and loads the project.
37
37
38
38
:::image type="content" source="media/visual-studio/container-apps-enable-docker.png" alt-text="A screenshot showing to enable docker.":::
39
39
40
40
## Deploy to Azure Container Apps
41
41
42
-
The application includes a Dockerfile because the Enable Docker setting was selected in the project template. Visual Studio uses the Dockerfile to build the container image that is run by Azure Container Apps.
42
+
The application includes a Dockerfile because the project template had the *Enable Docker* setting selected. Visual Studio uses the Dockerfile to build the container image that the Azure Container Apps run.
43
43
44
44
Refer to [How Visual Studio builds containerized apps](/visualstudio/containers/container-build) if you'd like to learn more about the specifics of this process.
45
45
46
-
You are now ready to deploy to the application to Azure Containers Apps.
46
+
You're now ready to deploy to the application to Azure Containers Apps.
47
47
48
48
### Create the resources
49
49
50
-
The Visual Studio publish dialogs will help you choose existing Azure resources, or create new ones to be used to deploy your applications to. It will also build the container image using the Dockerfile in the project, push this image to ACR, and finally deploy the new image to the container app selected.
50
+
The publish dialog windows in Visual Studio help you choose existing Azure resources, or allow you to create new ones for deployment. This process also builds the container image, pushes the image to Azure Container Registry (ACR), and deploys the new container app image.
51
51
52
52
1) Right-click the **MyContainerApp** project node and select **Publish**.
53
53
@@ -59,77 +59,77 @@ The Visual Studio publish dialogs will help you choose existing Azure resources,
5) Next, create an Azure Container App to host the project. Select the **green plus icon** on the right to open the create dialog. In the *Create new* dialog, enter the following values:
62
+
5) Next, create an Azure Container App to host the project. Select the **green plus icon** on the right to open the *Create new* dialog. In the *Create new* dialog, enter the following values:
63
63
64
64
-**Container App name**: Enter a name of `msdocscontainerapp`.
65
65
-**Subscription name**: Choose the subscription where you would like to host your app.
66
-
-**Resource group**: A resource group acts as a logical container to organize related resources in Azure. You can either select an existing resource group, or select **New** to create one with a name of your choosing, such as `msdocscontainerapps`.
67
-
-**Container Apps Environment**: Container Apps Environment: Every container app must be part of a container app environment. An environment provides an isolated network for one or more container apps, making it possible for them to easily invoke each other. Click **New** to open the Create new dialog for your container app environment. Leave the default values and select **OK** to close the environment dialog.
68
-
-**Container Name**: This is the friendly name of the container that will run for this container app. Use the name `msdocscontainer1` for this quickstart. A container app typically runs a single container, but there are times when having more than one container is needed. One such example is when a sidecar container is required to perform an activity such as specialized logging or communications.
66
+
-**Resource group**: A resource group acts as a logical container to organize related resources in Azure. You can either select an existing resource group, or select **New** to create one with a name of your choosing, such as `msdocscontainerapps`.
67
+
-**Container Apps Environment**: Container Apps Environment: Every container app must be part of a container app environment. An environment provides an isolated network for one or more container apps, making it possible for them to easily invoke each other. Click **New** to open the Create new dialog for your container app environment. Leave the default values and select **OK** to close the environment dialog.
68
+
-**Container Name**: This is the friendly name of the container that runs for this container app. Use the name `msdocscontainer1` for this quickstart. A container app typically runs a single container, but there are times when having more than one container is needed. One such example is when a sidecar container is required to perform an activity such as specialized logging or communications.
69
69
70
70
:::image type="content" source="media/visual-studio/container-apps-create-new.png" alt-text="A screenshot showing how to create new Container Apps.":::
71
71
72
-
6) Select **Create** to finalize the creation or your container app. Visual Studio and Azure create the needed resources on your behalf. This process may take a couple minutes, so allow it to run to completion before moving on.
72
+
6) Select **Create** to finalize the creation or your container app. Visual Studio and Azure create the needed resources on your behalf. This process may take a couple minutes, so allow it to run to completion before moving on.
73
73
74
74
7) Once the resources are created, choose **Next**.
75
75
76
76
:::image type="content" source="media/visual-studio/container-apps-select-resource.png" alt-text="A screenshot showing how to select the created resource.":::
77
77
78
-
8) On the **Registry** screen, you can either select an existing Registry if you have one, or create a new one. To create a new one, click the green **+** icon on the right. On the **Create new** registry screen, fill in the following values:
78
+
8) On the **Registry** screen, you can either select an existing Registry if you have one, or create a new one. To create a new one, click the green **+** icon on the right. On the *Create new* registry screen, fill in the following values:
79
79
80
80
-**DNS prefix**: Enter a value of `msdocscontainerregistry` or a name of your choosing.
81
-
-**Subscription Name**: Select the subscription you want to use - you may only have one to choose from.
81
+
-**Subscription Name**: Select the subscription you want to use - you might only have one to choose from.
82
82
-**Resource Group**: Choose the msdocs resource group you created previously.
83
83
-**Sku**: Select **Standard**.
84
84
-**Registry Location**: Select a region that is geographically close to you.
85
85
86
86
:::image type="content" source="media/visual-studio/container-apps-registry.png" alt-text="A screenshot showing how to create the container registry.":::
87
87
88
-
9)After you have populated these values, select **Create**. Visual Studio and Azure will take a moment to create the registry.
88
+
9)Once you populate these values, select **Create**. Visual Studio and Azure take a moment to create the registry.
89
89
90
-
10) Once the container registry is created, make sure it is selected, and then choose **Finish**. Visual Studio will take a moment to create the publish profile. This publish profile is where VS stores the publish options and resources you chose so you can quickly publish again whenever you want. You can close the dialog once it finishes.
90
+
10) Once the container registry is created, make sure it's selected, and then choose **Finish**. Visual Studio takes a moment to create the publish profile. This publish profile is where Visual Studio stores the publish options and resources you chose so you can quickly publish again whenever you want. You can close the dialog once it finishes.
91
91
92
92
:::image type="content" source="media/visual-studio/container-apps-choose-registry.png" alt-text="A screenshot showing how select the created registry.":::
93
93
94
94
### Publish the app using Visual Studio
95
95
96
96
While the resources and publishing profile are created, you still need to publish and deploy the app to Azure.
97
97
98
-
Choose **Publish** in the upper right of the publishing profile screen to deploy to the container app you created in Azure. This process may take a moment, so wait for it to complete.
98
+
Choose **Publish** in the upper right of the publishing profile screen to deploy to the container app you created in Azure. This process might take a moment, so wait for it to complete.
99
99
100
100
:::image type="content" source="media/visual-studio/container-apps-publish.png" alt-text="A screenshot showing how to publish the app.":::
101
101
102
-
When the app finishes deploying, Visual Studio opens a browser to the URL of your deployed site. This page may initially display an error if all of the proper resources have not finished provisioning. You can continue to refresh the browser periodically to check if the deployment has fully completed.
102
+
When the app finishes deploying, Visual Studio opens a browser to the URL of your deployed site. This page might initially display an error if all of the proper resources don't finish provisioning. You can continue to refresh the browser periodically to check if the deployment fully completes.
103
103
104
104
:::image type="content" source="media/visual-studio/container-apps-site.png" alt-text="A screenshot showing the published site.":::
105
105
106
106
### Publish the app using GitHub Actions
107
107
108
-
Container Apps can also be deployed using CI/CD through [GitHub actions](https://docs.github.com/en/actions), which are a powerful tool for automating, customizing, and executing development workflows directly through the GitHub repository of your project.
108
+
Container Apps can also be deployed using CI/CD through [GitHub Actions](https://docs.github.com/en/actions). GitHub Actions is a powerful tool for automating, customizing, and executing development workflows directly through the GitHub repository of your project.
109
109
110
-
If Visual Studio detects the project you are publishing is hosted in GitHub, the publish flow presents an additional **Deployment type** step. This stage allows developers to choose whether to publish directly through Visual Studio using the steps shown earlier in the quickstart, or through a GitHub Actions workflow.
110
+
If Visual Studio detects the project you're publishing is hosted in GitHub, the publish flow presents an additional **Deployment type** step. This stage allows developers to choose whether to publish directly through Visual Studio using the steps shown earlier in the quickstart, or through a GitHub Actions workflow.
111
111
112
112
:::image type="content" source="media/visual-studio/container-apps-deployment-type.png" alt-text="A screenshot showing the deployment type.":::
113
113
114
-
If you select the GitHub Actions workflow, Visual Studio will add a *.github* folder to the root directory of the project, along with a generated YAML file inside of it. The YAML file contains GitHub Actions configurations to build and deploy your app to Azure every time you push your code.
114
+
If you select the GitHub Actions workflow, Visual Studio creates a *.github* folder to the root directory of the project, along with a generated YAML file inside of it. The YAML file contains GitHub Actions configurations to build and deploy your app to Azure every time you push your code.
115
115
116
-
After you make a change and push your code, you can see the progress of the build and deploy process in GitHub under the **Actions** tab. This page provides detailed logs and indicators regarding the progress and health of the workflow.
116
+
After you make a change and push your code, you can see the progress of the build and deploy process in GitHub under the **Actions** tab. This page provides detailed logs and indicators regarding the progress and health of the workflow.
Once you see a green checkmark next to the build and deploy jobs the workflow is complete. When you browse to your Container Apps site you should see the latest changes applied. You can always find the URL for your container app using the Azure portal page.
120
+
The workflow is complete when you see a green checkmark next to the build and deploy jobs. When you browse to your Container Apps site, you should see the latest changes applied. You can always find the URL for your container app using the Azure portal page.
121
121
122
122
## Clean up resources
123
123
124
-
If you're not going to continue to use this application, you can delete the Azure Container Apps instance and all the associated services by removing the resource group.
124
+
If you no longer plan to use this application, you can delete the Azure Container Apps instance and all the associated services by removing the resource group.
125
125
126
-
Follow these steps in the Azure portal to remove the resources you created:
126
+
To remove the resources you created, follow these steps in the Azure portal:
127
127
128
128
1. Select the **msdocscontainerapps** resource group from the *Overview* section.
129
129
1. Select the **Delete resource group** button at the top of the resource group *Overview*.
130
130
1. Enter the resource group name **msdocscontainerapps** in the *Are you sure you want to delete "my-container-apps"* confirmation dialog.
131
131
1. Select **Delete**.
132
-
The process to delete the resource group may take a few minutes to complete.
132
+
The process to delete the resource group might take a few minutes to complete.
133
133
134
134
> [!TIP]
135
135
> Having issues? Let us know on GitHub by opening an issue in the [Azure Container Apps repo](https://github.com/microsoft/azure-container-apps).
0 commit comments