Skip to content

Commit ca5dff1

Browse files
authored
Merge pull request #291942 from hangwan97/TOC_refine
Update TOC.yml
2 parents e8e8361 + 9569214 commit ca5dff1

8 files changed

+362
-149
lines changed

articles/container-apps/TOC.yml

Lines changed: 64 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,27 @@
381381
- name: Turn on Java features
382382
href: java-feature-switch.md
383383
displayName: java
384+
- name: Automatic memory fitting (preview)
385+
href: java-memory-fit.md
386+
displayName: java
387+
- name: Build environment variables (preview)
388+
href: java-build-environment-variables.md
389+
displayName: java
384390
- name: Launch your first Java app
385-
href: java-get-started.md
386-
- name: Artificial Intelligence
391+
items:
392+
- name: Dockerfile
393+
href: /azure/developer/java/toolkit-for-intellij/java-get-started-dockerfile.md
394+
displayName: java
395+
- name: Github repository
396+
href: /azure/developer/java/toolkit-for-intellij/java-get-started-github-repository.md
397+
displayName: java
398+
- name: IntelliJ
399+
href: /azure/developer/java/toolkit-for-intellij/create-container-apps-intellij?toc=/azure/container-apps/toc.json&bc=/azure/container-apps/breadcrumb/toc.json
400+
displayName: java
401+
- name: Artifacts (preview)
402+
href: java-get-started.md
403+
displayName: java
404+
- name: Artificial intelligence
387405
items:
388406
- name: PetClinic AI
389407
items:
@@ -394,55 +412,51 @@
394412
href: java-petclinic-ai-tutorial.md
395413
displayName: java
396414
displayName: java
397-
- name: Launch your first Java microservice apps with managed Java components
398-
href: java-microservice-get-started.md
399-
displayName: java
400-
- name: Get started using IntelliJ
401-
href: /azure/developer/java/toolkit-for-intellij/create-container-apps-intellij?toc=/azure/container-apps/toc.json&bc=/azure/container-apps/breadcrumb/toc.json
402-
displayName: java
403-
- name: Automatic memory fitting (preview)
404-
href: java-memory-fit.md
405-
displayName: java
406-
- name: Build environment variables (preview)
407-
href: java-build-environment-variables.md
408-
displayName: java
409-
- name: Metrics
410-
href: java-metrics.md
411-
displayName: java
412-
- name: Scale with Java metrics
413-
href: java-metrics-scale-with-keda.md
414-
displayName: java
415-
- name: Connect to Eureka Server for Spring
416-
href: java-eureka-server.md
417-
displayName: java
418-
- name: Connect to Admin for Spring
419-
href: java-admin.md
420-
displayName: java
421-
- name: Connect to Config Server for Spring
422-
href: java-config-server.md
423-
displayName: java
424-
- name: Connect to Gateway for Spring
425-
href: java-gateway-for-spring.md
426-
displayName: java
427-
- name: Set dynamic logger level
428-
href: java-dynamic-log-level.md
429-
displayName: java
430-
- name: Tutorials
415+
- name: Java components
431416
items:
432-
- name: Integrate Eureka Server with Admin for Spring
433-
href: java-admin-eureka-integration.md
434-
displayName: java
435-
- name: Query managed component logs
436-
href: java-component-logs.md
437-
displayName: java
438-
- name: Configure Application Performance Management (APM) Java agent with init-container
439-
href: java-application-performance-management-config.md
440-
- name: Create a highly available Eureka server component cluster
441-
href: java-eureka-server-highly-available.md
442-
displayName: java
443-
- name: Build a Java metrics dashboard with Azure Managed Grafana
444-
href: java-metrics-with-grafana.md
445-
displayName: java
417+
- name: Launch your first Java microservice apps with managed Java components
418+
href: java-microservice-get-started.md
419+
displayName: java
420+
- name: Connect to Eureka Server for Spring
421+
href: java-eureka-server.md
422+
displayName: java
423+
- name: Integrate Eureka Server with Admin for Spring
424+
href: java-admin-eureka-integration.md
425+
displayName: java
426+
- name: Create a highly available Eureka server component cluster
427+
href: java-eureka-server-highly-available.md
428+
displayName: java
429+
- name: Connect to Admin for Spring
430+
href: java-admin.md
431+
displayName: java
432+
- name: Connect to Config Server for Spring
433+
href: java-config-server.md
434+
displayName: java
435+
- name: Connect to Gateway for Spring
436+
href: java-gateway-for-spring.md
437+
displayName: java
438+
- name: Monitoring
439+
items:
440+
- name: Java metrics
441+
href: java-metrics.md
442+
displayName: java
443+
- name: Query managed component logs
444+
href: java-component-logs.md
445+
displayName: java
446+
- name: Configure application performance management (APM) Java agent with init-container
447+
href: java-application-performance-management-config.md
448+
displayName: java
449+
- name: Scale with Java metrics
450+
href: java-metrics-scale-with-keda.md
451+
displayName: java
452+
- name: Build a Java metrics dashboard with Azure Managed Grafana
453+
href: java-metrics-with-grafana.md
454+
displayName: java
455+
- name: Diagnostic
456+
items:
457+
- name: Set dynamic logger level
458+
href: java-dynamic-log-level.md
459+
displayName: java
446460
- name: JavaScript
447461
items:
448462
- name: Overview
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
author: KarlErickson
3+
ms.author: karler
4+
ms.reviewer: hangwan
5+
ms.service: azure-container-apps
6+
ms.topic: include
7+
ms.date: 03/05/2025
8+
---
9+
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:
17+
18+
:::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":::
19+
20+
## Prerequisites
21+
22+
- An Azure subscription. [Create one for free.](https://azure.microsoft.com/free/).
23+
- 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).
24+
- [A GitHub account](https://github.com/join).
25+
- [Git](https://git-scm.com/downloads)
26+
- [Azure CLI](/cli/azure/install-azure-cli)
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`
28+
- [The Java Development Kit](/java/openjdk/install), version 17 or later.
29+
- [Apache Maven](https://maven.apache.org/download.cgi)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
author: KarlErickson
3+
ms.author: karler
4+
ms.reviewer: hangwan
5+
ms.service: azure-container-apps
6+
ms.topic: include
7+
ms.date: 03/05/2025
8+
---
9+
10+
## Related content
11+
12+
- [Quickstart: Launch your first Java microservice application with managed Java components in Azure Container Apps](../java-microservice-get-started.md)
13+
- [Java PetClinic AI sample in Container Apps overview](../java-petclinic-ai-overview.md)
14+
- [Build environment variables for Java in Azure Container Apps (preview)](../java-build-environment-variables.md)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
author: KarlErickson
3+
ms.author: karler
4+
ms.reviewer: hangwan
5+
ms.service: azure-container-apps
6+
ms.topic: include
7+
ms.date: 03/05/2025
8+
---
9+
10+
## Verify the app status
11+
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.
13+
14+
## Clean up resources
15+
16+
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:
17+
18+
```azurecli
19+
az group delete --name $RESOURCE_GROUP
20+
```
21+
22+
[!INCLUDE [java-get-started-next-steps](java-get-started-next-steps.md)]
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
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 using a Dockerfile.
4+
services: container-apps
5+
author: KarlErickson
6+
ms.author: karler
7+
ms.reviewer: hangwan
8+
ms.service: azure-container-apps
9+
ms.custom: devx-track-java, devx-track-extended-java
10+
ms.topic: quickstart
11+
ms.date: 03/05/2025
12+
---
13+
14+
# Quickstart: Launch your first Java application in Azure Container Apps using a Dockerfile
15+
16+
This article shows you how to deploy the Spring PetClinic sample application to Azure Container Apps using a Dockerfile.
17+
18+
[!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)]
19+
20+
## Build the project locally
21+
22+
Build the Spring PetClinic application on your local machine by using the following steps:
23+
24+
1. Clone the [Azure Container Apps Java Samples](https://github.com/Azure-Samples/azure-container-apps-java-samples) repo by using the following command:
25+
26+
```bash
27+
git clone https://github.com/Azure-Samples/azure-container-apps-java-samples.git
28+
```
29+
30+
1. Navigate to the **spring-petclinic** folder by using the following command:
31+
32+
```bash
33+
cd azure-container-apps-java-samples/spring-petclinic/spring-petclinic/
34+
```
35+
36+
1. Initialize and update the PetClinic application to the latest version by using the following command:
37+
38+
```bash
39+
git submodule update --init --recursive
40+
```
41+
42+
1. Build the PetClinic application by using the following command:
43+
44+
```bash
45+
./mvnw clean install
46+
```
47+
48+
1. Run your application locally by using the following command:
49+
50+
```bash
51+
./mvnw spring-boot:run
52+
```
53+
54+
1. After the application is up, access it locally at `http://localhost:8080`.
55+
56+
## Deploy the PetClinic application to Azure Container Apps
57+
58+
Deploy the PetClinic application to Azure Container Apps by using the following steps:
59+
60+
1. Set the necessary environment variables by using the following commands:
61+
62+
```bash
63+
export RESOURCE_GROUP="pet-clinic-container-apps"
64+
export LOCATION="canadacentral"
65+
export ENVIRONMENT="env-pet-clinic-container-apps"
66+
export CONTAINER_APP_NAME="pet-clinic"
67+
```
68+
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).
70+
71+
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.
72+
73+
```azurecli
74+
az containerapp up \
75+
--resource-group $RESOURCE_GROUP \
76+
--name $CONTAINER_APP_NAME \
77+
--location $LOCATION \
78+
--environment $ENVIRONMENT \
79+
--source ..
80+
```
81+
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+
90+
[!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)]
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
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.
4+
services: container-apps
5+
author: KarlErickson
6+
ms.author: karler
7+
ms.reviewer: hangwan
8+
ms.service: azure-container-apps
9+
ms.custom: devx-track-java, devx-track-extended-java
10+
ms.topic: quickstart
11+
ms.date: 03/05/2025
12+
---
13+
14+
# Quickstart: Launch your first Java application in Azure Container Apps using a GitHub Repository
15+
16+
This article shows you how to deploy the Spring PetClinic sample application to Azure Container Apps using a GitHub repository.
17+
18+
[!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)]
19+
20+
## Prepare the project
21+
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.
23+
24+
## Deploy the project
25+
26+
Deploy the project by using the following steps:
27+
28+
1. Set the necessary environment variables by using the following commands:
29+
30+
```bash
31+
export RESOURCE_GROUP="pet-clinic-container-apps"
32+
export LOCATION="canadacentral"
33+
export ENVIRONMENT="env-pet-clinic-container-apps"
34+
export CONTAINER_APP_NAME="pet-clinic"
35+
export REPO_URL="<URL-of-your-GitHub-repo-fork>"
36+
```
37+
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).
39+
40+
1. Build and deploy your Spring Boot app by using the following command:
41+
42+
```azurecli
43+
az containerapp up \
44+
--resource-group $RESOURCE_GROUP \
45+
--name $CONTAINER_APP_NAME \
46+
--location $LOCATION \
47+
--environment $ENVIRONMENT \
48+
--context-path ./spring-petclinic \
49+
--repo $REPO_URL
50+
```
51+
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:
61+
62+
- Builds the container image and pushes it to the Azure container registry.
63+
- Deploys the container image to the created container app.
64+
65+
[!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)]

0 commit comments

Comments
 (0)