Skip to content

Commit 9569214

Browse files
committed
edits
1 parent af8dfc1 commit 9569214

7 files changed

+96
-88
lines changed
Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
11
---
22
author: KarlErickson
33
ms.author: karler
4+
ms.reviewer: hangwan
45
ms.service: azure-container-apps
56
ms.topic: include
6-
ms.date: 02/24/2025
7+
ms.date: 03/05/2025
78
---
89

9-
You can deploy your Java application with many different options, including a local file system, a code repository, Maven, an IDE, a WAR file, a JAR file, or even directly from the source code. By the end of this tutorial, you deploy a web application that you can manage through the Azure portal. The following screenshot shows the home page of the PetClinic application deployed to Azure Container Apps:
10+
There are several options available for deploying Java applications, including the following options:
11+
12+
- Deployment from a local file system or from a code repository.
13+
- Deployment using Maven or an IDE.
14+
- Deployment using a WAR file, a JAR file, or directly from source code.
15+
16+
By the end of this tutorial, you deploy a web application that you can manage through the Azure portal. The following screenshot shows the home page of the PetClinic application deployed to Azure Container Apps:
1017

1118
:::image type="content" source="../media/java-get-started/azure-container-apps-spring-pet-clinic-home-page.png" alt-text="Screenshot of the home page of the PetClinic app." lightbox="../media/java-get-started/azure-container-apps-spring-pet-clinic-home-page.png":::
1219

1320
## Prerequisites
1421

1522
- An Azure subscription. [Create one for free.](https://azure.microsoft.com/free/).
1623
- The `Contributor` or `Owner` permission on the Azure subscription. For more information, see [Assign Azure roles using the Azure portal](../../role-based-access-control/role-assignments-portal.yml?tabs=current).
17-
- [A GitHub Account](https://github.com/join).
18-
- [git](https://git-scm.com/downloads)
24+
- [A GitHub account](https://github.com/join).
25+
- [Git](https://git-scm.com/downloads)
1926
- [Azure CLI](/cli/azure/install-azure-cli)
20-
- The Azure Container Apps CLI extension, version 0.3.47 or higher.
27+
- The Azure Container Apps CLI extension, version 0.3.47 or higher. Use the following command to install the latest version: `az extension add --name containerapp --upgrade --allow-preview`
2128
- [The Java Development Kit](/java/openjdk/install), version 17 or later.
2229
- [Apache Maven](https://maven.apache.org/download.cgi)
23-
24-
## Install the Container Apps CLI extension
25-
26-
Use the following command to install the latest version of the Azure Container Apps CLI extension:
27-
28-
```azurecli
29-
az extension add \
30-
--name containerapp \
31-
--upgrade \
32-
--allow-preview
33-
```

articles/container-apps/includes/java-get-started-next-steps.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
author: KarlErickson
33
ms.author: karler
4+
ms.reviewer: hangwan
45
ms.service: azure-container-apps
56
ms.topic: include
6-
ms.date: 02/24/2025
7+
ms.date: 03/05/2025
78
---
89

910
## Related content
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
---
22
author: KarlErickson
33
ms.author: karler
4+
ms.reviewer: hangwan
45
ms.service: azure-container-apps
56
ms.topic: include
6-
ms.date: 02/24/2025
7+
ms.date: 03/05/2025
78
---
89

910
## Verify the app status
1011

11-
After the deployment finishes, from the Azure portal, you can navigate to the **Overview** page of your container app and set the **Application Url** field. After doing that, you can see the project running in the cloud. The following screenshot shows the application status of the app running on Azure:
12-
13-
:::image type="content" source="../media/java-get-started/azure-container-apps-spring-pet-clinic-in-azure-portal.png" alt-text="Screenshot of the application details in Azure, with the Application URL field highlighted." lightbox="../media/java-get-started/azure-container-apps-spring-pet-clinic-in-azure-portal.png":::
12+
After the deployment finishes, go to the Azure portal **Overview** page of your container app and select **Application Url** to see the application running in the cloud.
1413

1514
## Clean up resources
1615

1716
If you plan to continue working with more quickstarts and tutorials, you might want to leave these resources in place. When you no longer need the resources, you can remove them to avoid Azure charges, by using the following command:
1817

1918
```azurecli
20-
az group delete \
21-
--name $RESOURCE_GROUP
19+
az group delete --name $RESOURCE_GROUP
2220
```
2321

24-
[!INCLUDE [java-get-started-next-steps](java-get-started-next-steps.md)]
22+
[!INCLUDE [java-get-started-next-steps](java-get-started-next-steps.md)]

articles/container-apps/java-get-started-dockerfile.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
---
22
title: Launch Your First Java application in Azure Container Apps Using a Dockerfile
3-
description: Learn how to deploy a Java project in Azure Container Apps by using a Dockerfile.
3+
description: Learn how to deploy a Java project in Azure Container Apps using a Dockerfile.
44
services: container-apps
55
author: KarlErickson
6+
ms.author: karler
7+
ms.reviewer: hangwan
68
ms.service: azure-container-apps
79
ms.custom: devx-track-java, devx-track-extended-java
810
ms.topic: quickstart
9-
ms.date: 02/24/2025
10-
ms.author: hangwan
11+
ms.date: 03/05/2025
1112
---
1213

13-
# Quickstart: Launch your first Java application in Azure Container Apps by using a Dockerfile
14+
# Quickstart: Launch your first Java application in Azure Container Apps using a Dockerfile
1415

15-
This article shows you how to use a Dockerfile to deploy the Spring PetClinic sample application to Azure Container Apps.
16+
This article shows you how to deploy the Spring PetClinic sample application to Azure Container Apps using a Dockerfile.
1617

1718
[!INCLUDE [java-get-started-introduction-and-prerequisites-and-install-azure-container-apps-cli-extension](includes/java-get-started-introduction-and-prerequisites-and-install-azure-container-apps-cli-extension.md)]
1819

@@ -60,24 +61,15 @@ Deploy the PetClinic application to Azure Container Apps by using the following
6061

6162
```bash
6263
export RESOURCE_GROUP="pet-clinic-container-apps"
63-
export LOCATION="canada-central"
64+
export LOCATION="canadacentral"
6465
export ENVIRONMENT="env-pet-clinic-container-apps"
6566
export CONTAINER_APP_NAME="pet-clinic"
6667
```
6768

68-
1. If you haven't yet, sign in to Azure from the CLI. For more information, see the [Setup](quickstart-code-to-cloud.md?tabs=bash%2Cjava#setup) section of [Build and deploy from local source code to Azure Container Apps](quickstart-code-to-cloud.md).
69+
1. Sign in to Azure from the CLI if you aren't already signed in. For more information, see the [Setup](quickstart-code-to-cloud.md?tabs=bash%2Cjava#setup) section of [Build and deploy from local source code to Azure Container Apps](quickstart-code-to-cloud.md).
6970
7071
1. Build and deploy the Spring PetClinic app by using the following command. The `..` (dot dot) indicates that you're using the Dockerfile in the parent folder.
7172

72-
> [!NOTE]
73-
> This command accomplishes the following tasks:
74-
>
75-
> - Creates the resource group.
76-
> - Creates an Azure container registry.
77-
> - Builds the container image and pushes it to the registry.
78-
> - Creates the Container Apps environment with a Log Analytics workspace.
79-
> - Creates and deploys the container app using the built container image.
80-
8173
```azurecli
8274
az containerapp up \
8375
--resource-group $RESOURCE_GROUP \
@@ -87,4 +79,12 @@ Deploy the PetClinic application to Azure Container Apps by using the following
8779
--source ..
8880
```
8981

82+
This command accomplishes the following tasks:
83+
84+
- Creates the resource group.
85+
- Creates an Azure container registry.
86+
- Builds the container image and pushes it to the registry.
87+
- Creates the Container Apps environment with a Log Analytics workspace.
88+
- Creates and deploys the container app using the built container image.
89+
9090
[!INCLUDE [java-get-started-verify-app-status-and-cleanup-and-next-steps](includes/java-get-started-verify-app-status-and-cleanup-and-next-steps.md)]

articles/container-apps/java-get-started-github-repository.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
---
2-
title: Launch your First Java Application in Azure Container Apps by Using a GitHub Repository
3-
description: Learn how to deploy a Java project in Azure Container Apps by using a GitHub Repository.
2+
title: Launch your First Java Application in Azure Container Apps Using a GitHub Repository
3+
description: Learn how to deploy a Java project in Azure Container Apps using a GitHub Repository.
44
services: container-apps
55
author: KarlErickson
6+
ms.author: karler
7+
ms.reviewer: hangwan
68
ms.service: azure-container-apps
79
ms.custom: devx-track-java, devx-track-extended-java
810
ms.topic: quickstart
9-
ms.date: 02/24/2025
10-
ms.author: hangwan
11+
ms.date: 03/05/2025
1112
---
1213

13-
# Quickstart: Launch your first Java application in Azure Container Apps by using a GitHub Repository
14+
# Quickstart: Launch your first Java application in Azure Container Apps using a GitHub Repository
1415

15-
This article shows you how to use a GitHub repository to deploy the Spring PetClinic sample application to Azure Container Apps.
16+
This article shows you how to deploy the Spring PetClinic sample application to Azure Container Apps using a GitHub repository.
1617

1718
[!INCLUDE [java-get-started-introduction-and-prerequisites-and-install-azure-container-apps-cli-extension](includes/java-get-started-introduction-and-prerequisites-and-install-azure-container-apps-cli-extension.md)]
1819

1920
## Prepare the project
2021

21-
Use the **Fork** button on the [Azure Container Apps Java Samples](https://github.com/Azure-Samples/azure-container-apps-java-samples.git) repo page to fork the repo to your personal GitHub account.
22+
Use the **Fork** button on the [Azure Container Apps Java Samples](https://github.com/Azure-Samples/azure-container-apps-java-samples.git) repo page to fork the repo to your personal GitHub account. When the fork is complete, copy the fork's URL for use in the next section.
2223

2324
## Deploy the project
2425

@@ -28,35 +29,35 @@ Deploy the project by using the following steps:
2829

2930
```bash
3031
export RESOURCE_GROUP="pet-clinic-container-apps"
31-
export LOCATION="canada-central"
32+
export LOCATION="canadacentral"
3233
export ENVIRONMENT="env-pet-clinic-container-apps"
3334
export CONTAINER_APP_NAME="pet-clinic"
35+
export REPO_URL="<URL-of-your-GitHub-repo-fork>"
3436
```
3537

36-
1. If you haven't yet, sign in to Azure from the CLI. For more information, see the [Setup](quickstart-code-to-cloud.md?tabs=bash%2Cjava#setup) section of [Quickstart: Build and deploy from local source code to Azure Container Apps](quickstart-code-to-cloud.md).
38+
1. Sign in to Azure from the CLI if you aren't already signed in. For more information, see the [Setup](quickstart-code-to-cloud.md?tabs=bash%2Cjava#setup) section of [Quickstart: Build and deploy from local source code to Azure Container Apps](quickstart-code-to-cloud.md).
3739
3840
1. Build and deploy your Spring Boot app by using the following command:
3941
40-
> [!NOTE]
41-
> This command performs the following tasks:
42-
>
43-
> - Creates the resource group.
44-
> - Creates an Azure container registry.
45-
> - Builds the container image and pushes it to the registry.
46-
> - Creates the Container Apps environment with a Log Analytics workspace.
47-
> - Creates and deploys the container app by using the built container image.
48-
4942
```azurecli
5043
az containerapp up \
5144
--resource-group $RESOURCE_GROUP \
5245
--name $CONTAINER_APP_NAME \
5346
--location $LOCATION \
5447
--environment $ENVIRONMENT \
5548
--context-path ./spring-petclinic \
56-
--repo <url-of-your-github-fork>
49+
--repo $REPO_URL
5750
```
5851
59-
When you push new code to the repository, the GitHub Action performs the following tasks:
52+
This command performs the following tasks:
53+
54+
- Creates the resource group.
55+
- Creates an Azure container registry.
56+
- Builds the container image and pushes it to the registry.
57+
- Creates the Container Apps environment with a Log Analytics workspace.
58+
- Creates and deploys the container app by using the built container image.
59+
60+
The project is now deployed. When you push new code to the repository, a GitHub Action performs the following tasks:
6061
6162
- Builds the container image and pushes it to the Azure container registry.
6263
- Deploys the container image to the created container app.

articles/container-apps/java-get-started.md

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
---
2-
title: Launch Your First Java Application in Azure Container Apps with a WAR or JAR File
3-
description: Shows how to deploy a Java project in Azure Container Apps with a WAR or JAR file.
2+
title: Launch Your First Java Application in Azure Container Apps using a WAR or JAR File
3+
description: Shows how to deploy a Java project in Azure Container Apps using a WAR or JAR file.
44
services: container-apps
55
author: KarlErickson
6+
ms.author: karler
7+
ms.reviewer: cshoe
68
ms.service: azure-container-apps
79
ms.custom: devx-track-java, devx-track-extended-java
810
ms.topic: quickstart
9-
ms.date: 02/24/2025
10-
ms.author: cshoe
11+
ms.date: 03/05/2025
1112
zone_pivot_groups: container-apps-java-artifacts
1213
---
1314

14-
# Quickstart: Launch your first Java application in Azure Container Apps with a WAR or JAR file
15+
# Quickstart: Launch your first Java application in Azure Container Apps using a WAR or JAR file
1516

16-
This article shows you how to use a WAR or JAR file to deploy the Spring PetClinic sample application to Azure Container Apps.
17+
This article shows you how to deploy the Spring PetClinic sample application to Azure Container Apps using a web application archive (WAR) file or a Java Archive (JAR) file.
1718

1819
[!INCLUDE [java-get-started-introduction-and-prerequisites-and-install-azure-container-apps-cli-extension](includes/java-get-started-introduction-and-prerequisites-and-install-azure-container-apps-cli-extension.md)]
1920

@@ -52,12 +53,10 @@ Build the project by using the following steps:
5253
1. Initialize and update the **Spring PetClinic Sample Application** repo to the latest version by using the following command:
5354

5455
```bash
55-
git submodule update \
56-
--init \
57-
--recursive
56+
git submodule update --init --recursive
5857
```
5958

60-
1. Use the following command to clean the Maven build area, compile the project's code, create a JAR file, and skip all tests during these processes:
59+
1. Use the following command to clean the Maven build area, compile the project's code, and create a JAR file, skipping all tests during these processes:
6160
6261
```bash
6362
mvn clean verify
@@ -75,7 +74,7 @@ You now have a **/target/petclinic.jar** file.
7574
cd spring-framework-petclinic
7675
```
7776
78-
1. Clean the Maven build area, compile the project's code, create a JAR file, and skip all tests during these processes, by using the following command:
77+
1. Use the following command to clean the Maven build area, compile the project's code, and create a JAR file, skipping all tests during these processes:
7978

8079
```bash
8180
mvn clean verify
@@ -89,19 +88,19 @@ You now have a **/target/petclinic.war** file.
8988

9089
::: zone pivot="jar"
9190

92-
Deploy the JAR package to Container Apps by using the following command:
91+
Deploy the JAR package to Azure Container Apps by using the following command:
9392

9493
> [!NOTE]
95-
> The default JDK version is 17. You have the option of specifying the version by using environment variables. To change the JDK version for compatibility with your application, use the `--build-env-vars BP_JVM_VERSION=<YOUR_JDK_VERSION>` argument. For more information, see [Build environment variables for Java in Azure Container Apps (preview)](java-build-environment-variables.md).
94+
> The default JDK version is 17. You have the option of specifying the version by using environment variables. To change the JDK version for compatibility with your application, use the `--build-env-vars BP_JVM_VERSION=<your-JDK-version>` argument. For more information, see [Build environment variables for Java in Azure Container Apps (preview)](java-build-environment-variables.md).
9695

9796
```azurecli
9897
az containerapp up \
99-
--resource-group <RESOURCE_GROUP> \
100-
--name <CONTAINER_APP_NAME> \
101-
--subscription <SUBSCRIPTION_ID>\
102-
--location <LOCATION> \
103-
--environment <ENVIRONMENT_NAME> \
104-
--artifact <JAR_FILE_PATH_AND_NAME> \
98+
--resource-group <resource-group> \
99+
--name <container-app-name> \
100+
--subscription <subscription-ID>\
101+
--location <location> \
102+
--environment <environment-name> \
103+
--artifact <JAR-file-path-and-name> \
105104
--ingress external \
106105
--target-port 8080 \
107106
--query properties.configuration.ingress.fqdn
@@ -114,17 +113,16 @@ az containerapp up \
114113
Deploy the WAR file to Azure Container Apps by using the following command:
115114

116115
> [!NOTE]
117-
> The default Tomcat version is 9. To change the version for compatibility with your application, use the `--build-env-vars BP_TOMCAT_VERSION=<YOUR_TOMCAT_VERSION>` argument. In this example, the Tomcat version is set to 10 (including any minor versions) by setting `BP_TOMCAT_VERSION=10.*`. For more information, see [Build environment variables for Java in Azure Container Apps (preview)](java-build-environment-variables.md).
116+
> The default Tomcat version is 9. To change the version for compatibility with your application, use the `--build-env-vars BP_TOMCAT_VERSION=<your-Tomcat-version>` argument. In this example, the Tomcat version is set to 10 - including any minor versions - by setting `BP_TOMCAT_VERSION=10.*`. For more information, see [Build environment variables for Java in Azure Container Apps (preview)](java-build-environment-variables.md).
118117

119118
```azurecli
120119
az containerapp up \
121-
--resource-group <RESOURCE_GROUP> \
122-
--name <CONTAINER_APP_NAME> \
123-
--resource-group <RESOURCE_GROUP> \
124-
--subscription <SUBSCRIPTION>\
125-
--location <LOCATION> \
126-
--environment <ENVIRONMENT_NAME> \
127-
--artifact <WAR_FILE_PATH_AND_NAME> \
120+
--resource-group <resource-group> \
121+
--name <container-app-name> \
122+
--subscription <subscription>\
123+
--location <location> \
124+
--environment <environment-name> \
125+
--artifact <WAR-file-path-and-name> \
128126
--build-env-vars BP_TOMCAT_VERSION=10.* \
129127
--ingress external \
130128
--target-port 8080 \
@@ -133,4 +131,18 @@ az containerapp up \
133131

134132
::: zone-end
135133

136-
[!INCLUDE [java-get-started-verify-app-status-and-cleanup-and-next-steps](includes/java-get-started-verify-app-status-and-cleanup-and-next-steps.md)]
134+
## Verify the app status
135+
136+
In this example, `containerapp up` command includes the `--query properties.configuration.ingress.fqdn` argument, which returns the fully qualified domain name (FQDN), also known as the app's URL.
137+
138+
View the application by pasting this URL into a browser.
139+
140+
## Clean up resources
141+
142+
If you plan to continue working with more quickstarts and tutorials, you might want to leave these resources in place. When you no longer need the resources, you can remove them to avoid Azure charges, by using the following command:
143+
144+
```azurecli
145+
az group delete --name <resource-group>
146+
```
147+
148+
[!INCLUDE [java-get-started-next-steps](includes/java-get-started-next-steps.md)]

0 commit comments

Comments
 (0)