Skip to content

Commit a4b29a3

Browse files
author
Jill Grant
authored
Merge pull request #256892 from anthonychu/20231029-aca-vscode-quickstart
[Container Apps] Update VS Code quickstart for Click2Run
2 parents 1ea0de4 + c2300f8 commit a4b29a3

File tree

1 file changed

+26
-81
lines changed

1 file changed

+26
-81
lines changed

articles/container-apps/deploy-visual-studio-code.md

Lines changed: 26 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: alexwolfmsft
66
ms.author: alexwolf
77
ms.service: container-apps
88
ms.topic: tutorial
9-
ms.date: 09/01/2022
9+
ms.date: 10/29/2023
1010
ms.custom: vscode-azure-extension-update-completed, devx-track-dotnet, devx-track-linux
1111
---
1212

@@ -27,109 +27,54 @@ In this tutorial, you'll deploy a containerized application to Azure Container A
2727

2828
## Clone the project
2929

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:
3137

3238
```git
33-
git clone https://github.com/Azure-Samples/containerapps-albumapi-javascript.git
39+
https://github.com/Azure-Samples/containerapps-albumapi-javascript.git
3440
```
3541
3642
> [!NOTE]
3743
> This tutorial uses a JavaScript project, but the steps are language agnostic.
3844
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.
4246
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.
4448
4549
## Sign in to Azure
4650
47-
1. Select **F1** to open the command palette.
51+
1. Select <kbd>F1</kbd> to open the command palette.
4852
4953
1. Select **Azure: Sign In** and follow the prompts to authenticate.
5054
5155
1. Once signed in, return to Visual Studio Code.
5256
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
9058
9159
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.
9260
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.
9462
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.
10064
10165
| Prompt | Value |
10266
|--|--|
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**. |
12772
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.
12974
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.
13176
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.
13378
13479
Congratulations! You successfully created and deployed your first container app using Visual Studio code.
13580
@@ -139,11 +84,11 @@ If you're not going to continue to use this application, you can delete the Azur
13984
14085
Follow these steps in the Azure portal to remove the resources you created:
14186
142-
1. Select the **msdocscontainerapps** resource group from the *Overview* section.
87+
1. Select the **my-container-app** resource group from the *Overview* section.
14388
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.
14590
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.
14792
14893
> [!TIP]
14994
> 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

Comments
 (0)