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
Copy file name to clipboardExpand all lines: articles/container-apps/deploy-visual-studio-code.md
+30-41Lines changed: 30 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: alexwolfmsft
6
6
ms.author: alexwolf
7
7
ms.service: container-apps
8
8
ms.topic: tutorial
9
-
ms.date: 4/05/2022
9
+
ms.date: 09/01/2022
10
10
ms.custom: mode-ui
11
11
---
12
12
@@ -27,16 +27,16 @@ In this tutorial, you'll deploy a containerized application to Azure Container A
27
27
28
28
## Clone the project
29
29
30
-
Begin by cloning the [sample repository]((https://github.com/azure-samples/containerapps-albumapi-javascript) to your machine using the following command.
30
+
1.Begin by cloning the [sample repository]((https://github.com/azure-samples/containerapps-albumapi-javascript) to your machine using the following command.
> This tutorial uses a JavaScript project, but the steps are language agnostic.
38
38
39
-
Launch Visual Studio Code and open the project folder in the editor.
39
+
1. Open Visual Studio Code.
40
40
41
41
1. Select **F1** to open the command palette.
42
42
@@ -52,17 +52,17 @@ Launch Visual Studio Code and open the project folder in the editor.
52
52
53
53
## Create the container registry and Docker image
54
54
55
-
Docker images contain all the source code and dependencies necessary to run an application. This sample project includes a Dockerfile used to build the application's container. Since you can build and publish the image for your app directly in Azure, a local Docker installation isn't required.
55
+
Docker images contain the source code and dependencies necessary to run an application. This sample project includes a Dockerfile used to build the application's container. Since you can build and publish the image for your app directly in Azure, a local Docker installation isn't required.
56
56
57
57
Container images are stored inside container registries. You can create a container registry and upload an image of your app in a single workflow using Visual Studio Code.
58
58
59
59
1. In the _Explorer_ window, expand the _src_ folder to reveal the Dockerfile.
60
60
61
-
1. Right select on the Dockerfile in Visual Studio Code, and select **Build Image in Azure**.
61
+
1. Right selecton the Dockerfile, and select**Build Image in Azure**.
62
62
63
63
This action opens the command palette and prompts you to define a container tag.
64
64
65
-
1. Enter a tag for the container. Accept the default, which is the project name with the `{{.Run.ID}}` replacement token as a suffix. Select **Enter** to continue.
65
+
1. Enter a tag for the container. Accept the default, which is the project name with the *latest* suffix.
66
66
67
67
1. Select **+ Create new registry**, or if you already have a registry you'd like to use, select that item and skip to creating and deploying to the container app.
68
68
@@ -90,53 +90,42 @@ The Azure Container Apps extension for Visual Studio Code enables you to choose
90
90
91
91
Every container app must be part of a Container Apps environment. An environment provides an isolated network for one or more container apps, making it possible for them to easily invoke each other. You'll need to create an environment before you can create the container app itself.
92
92
93
-
1) In the Container Apps extension panel, right select on the subscription you would like to use and select **Create Container App Environment**.
93
+
1. Select <kbd>F1</kbd> to open the command palette.
94
94
95
-
:::image type="content" source="media/visual-studio-code/visual-studio-code-create-app-environment.png" alt-text="A screenshot showing how to create a Container Apps environment.":::
95
+
1. Enter **Azure Container Apps: Create Container Apps Environment...** and enter the following values as prompted by the extension.
96
96
97
-
2) A command palette workflow will open at the top of the screen. Enter a name for the new Container Apps environment, such as `msdocsappenvironment`, and select **Enter**.
97
+
| Prompt | Value |
98
+
|--|--|
99
+
| Name | Enter **my-aca-environment**|
100
+
| Region | Select the region closest to you |
98
101
99
-
:::image type="content" source="media/visual-studio-code/visual-studio-code-container-app-environment.png" alt-text="A screenshot showing the container app environment.":::
100
-
101
-
3) Select the desired location for the container app from the list of options.
102
-
103
-
:::image type="content" source="media/visual-studio-code/visual-studio-code-container-env-location.png" alt-text="A screenshot showing the app environment location.":::
104
-
105
-
Visual Studio Code and Azure will create the environment for you. This process may take a few moments to complete. Creating a container app environment also creates a log analytics workspace for you in Azure.
102
+
Once you issue this command, Azure begins to create the environment foryou. This process may take a few moments to complete. Creating a container app environment also creates a log analytics workspace for youin Azure.
106
103
107
104
### Create the container app and deploy the Docker image
108
105
109
106
Now that you have a container app environment in Azure you can create a container app inside of it. You can also publish the Docker image you created earlier as part of this workflow.
110
107
111
-
1. In the Container Apps extension panel, right select on the container environment you created previously and select **Create Container App**
112
-
113
-
:::image type="content" source="media/visual-studio-code/visual-studio-code-create-container-app.png" alt-text="A screenshot showing how to create the container app.":::
114
-
115
-
1. A new command palette workflow will open at the top of the screen. Enter a name for the new container app, such as `msdocscontainerapp`, and then select **Enter**.
116
-
117
-
:::image type="content" source="media/visual-studio-code/visual-studio-code-container-name.png" alt-text="A screenshot showing the container app name.":::
118
-
119
-
1. Next, you're prompted to choose a container registry hosting solution to pull a Docker image from. For this scenario, select **Azure Container Registries**, though Docker Hub is also supported.
120
-
121
-
1. Select the container registry you created previously when publishing the Docker image.
122
-
123
-
1. Select the container registry repository you published the Docker image to. Repositories allow you to store and organize your containers in logical groupings.
124
-
125
-
1. Select the tag of the image you published earlier.
126
-
127
-
1. When prompted for environment variables, choose **Skip for now**. This application doesn't require any environment variables.
128
-
129
-
1. Select **Enable** on the ingress settings prompt to enable an HTTP endpoint for your application.
108
+
1. Select <kbd>F1</kbd> to open the command palette.
130
109
131
-
1.Choose**External**to configure the HTTP traffic that the endpoint will accept.
110
+
1. Enter**Azure Container Apps: Create Container App...**and enter the following values as prompted by the extension.
132
111
133
-
1. Enter a value of 3500 for the port, and then select **Enter** to complete the workflow. This value should be set to the port number that your container uses. In this case, the port number is `3500`.
112
+
| Prompt | Value | Remarks |
113
+
|--|--|--|
114
+
| Environment | Select **my-aca-environment**||
115
+
| Name | Enter **my-container-app**||
116
+
| Container registry | Select **Azure Container Registries**, thenselectthe registry you created as you published the container image. ||
117
+
| Repository | Select the container registry repository where you published the container image. ||
118
+
| Tag | Select **latest**||
119
+
| Environment variables | Select **Skip for now**||
120
+
| Ingress | Select **Enable**||
121
+
| HTTP traffic type| Select **External**||
122
+
| Port | Enter **3500**| You set this value to the port number that your container uses. |
134
123
135
124
During this process, Visual Studio Code and Azure create the container app foryou. The published Docker image you created earlier is also be deployed to the app. Once this process finishes, Visual Studio Code displays a notification with a link to browse to the site. Select this link, and to view your appin the browser.
136
125
137
126
:::image type="content" source="media/visual-studio-code/visual-studio-code-app-deploy.png" alt-text="A screenshot showing the deployed app.":::
138
127
139
-
You can also append the `/albums` path at the end of the app URL to view data from a sample API request.
128
+
You can also append the `/albums` path at the end of the app URL to view data from a sample API request.
140
129
141
130
Congratulations! You successfully created and deployed your first container app using Visual Studio code.
0 commit comments