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
@@ -27,109 +27,54 @@ In this tutorial, you'll deploy a containerized application to Azure Container A
27
27
28
28
## Clone the project
29
29
30
-
1. Begin by cloning the [sample repository](https://github.com/azure-samples/containerapps-albumapi-javascript) to your machine using the following command.
30
+
1. Open a new Visual Studio Code window.
31
+
32
+
1. Select <kbd>F1</kbd> to open the command palette.
33
+
34
+
1. Enter **Git: Clone** and press enter.
35
+
36
+
1. Enter the following URL to clone the sample project:
> This tutorial uses a JavaScript project, but the steps are language agnostic.
38
44
39
-
1. Open Visual Studio Code.
40
-
41
-
1. Select **F1** to open the command palette.
45
+
1. Select a folder to clone the project into.
42
46
43
-
1. Select **File > Open Folder...** and select the folder where you cloned the sample project.
47
+
1. Select **Open** to open the project in Visual Studio Code.
44
48
45
49
## Sign in to Azure
46
50
47
-
1. Select **F1** to open the command palette.
51
+
1. Select <kbd>F1</kbd> to open the command palette.
48
52
49
53
1. Select **Azure: Sign In** and follow the prompts to authenticate.
50
54
51
55
1. Once signed in, return to Visual Studio Code.
52
56
53
-
## Create the container registry and Docker image
54
-
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
-
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
-
59
-
1. In the _Explorer_ window, expand the _src_ folder to reveal the Dockerfile.
60
-
61
-
1. Right select on the Dockerfile, and select **Build Image in Azure**.
62
-
63
-
This action opens the command palette and prompts you to define a container tag.
64
-
65
-
1. Enter a tag for the container. Accept the default, which is the project name with a run ID suffix.
66
-
67
-
1. Select the Azure subscription that you want to use.
68
-
69
-
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.
70
-
71
-
1. Enter a unique name for the new registry such as `msdocscapps123`, where `123` are unique numbers of your own choosing, and then select enter.
72
-
73
-
Container registry names must be globally unique across all over Azure.
74
-
75
-
1. Select **Basic** as the SKU.
76
-
77
-
1. Choose **+ Create new resource group**, or select an existing resource group you'd like to use.
78
-
79
-
For a new resource group, enter a name such as `msdocscontainerapps`, and press enter.
80
-
81
-
1. Select the location that is nearest to you. Select **Enter** to finalize the workflow, and Azure begins creating the container registry and building the image.
82
-
83
-
This process may take a few moments to complete.
84
-
85
-
1. Select **Linux** as the image base operating system (OS).
86
-
87
-
Once the registry is created and the image is built successfully, you're ready to create the container app to host the published image.
88
-
89
-
## Create and deploy to the container app
57
+
## Create and deploy to Azure Container Apps
90
58
91
59
The Azure Container Apps extension for Visual Studio Code enables you to choose existing Container Apps resources, or create new ones to deploy your applications to. In this scenario, you create a new Container App environment and container app to host your application. After installing the Container Apps extension, you can access its features under the Azure control panel in Visual Studio Code.
92
60
93
-
### Create the Container Apps environment
61
+
1. Select <kbd>F1</kbd> to open the command palette and run the **Azure Container Apps: Deploy Project from Workspace** command.
94
62
95
-
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.
96
-
97
-
1. Select <kbd>F1</kbd> to open the command palette.
98
-
99
-
1. Enter **Azure Container Apps: Create Container Apps Environment...** and enter the following values as prompted by the extension.
63
+
1. Enter the following values as prompted by the extension.
100
64
101
65
| Prompt | Value |
102
66
|--|--|
103
-
| Name | Enter **my-aca-environment** |
104
-
| Region | Select the region closest to you |
105
-
106
-
Once you issue this command, Azure begins to 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.
107
-
108
-
### Create the container app and deploy the Docker image
109
-
110
-
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.
111
-
112
-
1. Select <kbd>F1</kbd> to open the command palette.
113
-
114
-
1. Enter **Azure Container Apps: Create Container App...** and enter the following values as prompted by the extension.
115
-
116
-
| Prompt | Value | Remarks |
117
-
|--|--|--|
118
-
| Environment | Select **my-aca-environment** | |
119
-
| Name | Enter **my-container-app** | |
120
-
| Container registry | Select **Azure Container Registries**, then select the registry you created as you published the container image. | |
121
-
| Repository | Select the container registry repository where you published the container image. | |
122
-
| Tag | Select **latest** | |
123
-
| Environment variables | Select **Skip for now** | |
124
-
| Ingress | Select **Enable** | |
125
-
| HTTP traffic type | Select **External** | |
126
-
| Port | Enter **3500** | You set this value to the port number that your container uses. |
67
+
| Select subscription | Select the Azure subscription you want to use. |
68
+
| Select a container apps environment | Select **Create new container apps environment**. You're only asked this question if you have existing Container Apps environments. |
69
+
| Enter a name for the new container app resource(s) | Enter **my-container-app**. |
70
+
| Select a location | Select an Azure region close to you. |
71
+
| Would you like to save your deployment configuration? | Select **Save**. |
127
72
128
-
During this process, Visual Studio Code and Azure create the container app for you. 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 app in the browser.
73
+
The Azure activity log panel opens and displays the deployment progress. This process might take a few minutes to complete.
129
74
130
-
:::image type="content" source="media/visual-studio-code/visual-studio-code-app-deploy.png" alt-text="A screenshot showing the deployed app.":::
75
+
1. Once this process finishes, Visual Studio Code displays a notification. Select **Browse** to open the deployed app in a browser.
131
76
132
-
You can also append the `/albums` path at the end of the app URL to view data from a sample API request.
77
+
In the browser's location bar, append the `/albums` path at the end of the app URL to view data from a sample API request.
133
78
134
79
Congratulations! You successfully created and deployed your first container app using Visual Studio code.
135
80
@@ -139,11 +84,11 @@ If you're not going to continue to use this application, you can delete the Azur
139
84
140
85
Follow these steps in the Azure portal to remove the resources you created:
141
86
142
-
1. Select the **msdocscontainerapps** resource group from the *Overview* section.
87
+
1. Select the **my-container-app** resource group from the *Overview* section.
143
88
1. Select the **Delete resource group** button at the top of the resource group *Overview*.
144
-
1. Enter the resource group name **msdocscontainerapps** in the *Are you sure you want to delete "my-container-apps"* confirmation dialog.
89
+
1. Enter the resource group name **my-container-app** in the *Are you sure you want to delete "my-container-apps"* confirmation dialog.
145
90
1. Select **Delete**.
146
-
The process to delete the resource group may take a few minutes to complete.
91
+
The process to delete the resource group might take a few minutes to complete.
147
92
148
93
> [!TIP]
149
94
> 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