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/java-apm-agent-config.md
+54-44Lines changed: 54 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
title: "Tutorial: Configure APM integration for Java applications in Azure Container Apps"
3
-
description: Learn to configure APM integration for Java applications in Azure Container Apps
2
+
title: "Tutorial: Configure APM integration for Java applications with Java agent and init-container"
3
+
description: Learn to configure APM integration for Java applications with Java agent and init-container
4
4
services: container-apps
5
5
author: croffz
6
6
ms.service: azure-container-apps
@@ -10,9 +10,11 @@ ms.date: 09/26/2024
10
10
ms.author: kuzhong
11
11
---
12
12
13
-
# Tutorial: Configure APM integration for Java applications in Azure Container Apps
13
+
# Tutorial: Configure APM integration for Java applications with Java agent and init-container
14
14
15
-
APM (Application Performance Management) is useful when you need observability on your applications running online. You can configure APM integration for Java applications in Azure Container Apps easily by Java agent and init containers without modifying your app image. In this tutorial, you learn how to:
15
+
APM (Application Performance Management) is useful when it comes to observability for your applications running online. You can package the APM plugin in the same image or Dockerfile with your app, but this will bind the management efforts together, like release and CVE (Common Vulnerabilities and Exposures) mitigation. Alternatively, you can leverage Java agent and init containers in Azure Container Apps to inject APM solutions without modifying your app image.
16
+
17
+
In this tutorial, you learn how to:
16
18
17
19
> [!div class="checklist"]
18
20
> * Prepare an image to set up Java agent and push to Azure Container Registry
@@ -44,8 +46,6 @@ The following commands help you define variables and ensure your Container Apps
44
46
az login
45
47
```
46
48
47
-
---
48
-
49
49
1. Ensure you have the latest version of Azure CLI extensions for Container Apps and Application Insights.
50
50
51
51
# [Bash](#tab/bash)
@@ -62,8 +62,6 @@ The following commands help you define variables and ensure your Container Apps
62
62
az extension add -n application-insights --upgrade
63
63
```
64
64
65
-
---
66
-
67
65
1. Set up environment variables used in various commands to follow.
68
66
69
67
# [Bash](#tab/bash)
@@ -88,10 +86,6 @@ The following commands help you define variables and ensure your Container Apps
88
86
$LOCATION="eastus"
89
87
```
90
88
91
-
---
92
-
93
-
## Prepare an image to set up Java agent and push to Azure Container Registry
94
-
95
89
1. Retrieve the connection string of Application Insights.
96
90
97
91
# [Bash](#tab/bash)
@@ -110,44 +104,57 @@ The following commands help you define variables and ensure your Container Apps
110
104
--query connectionString)
111
105
```
112
106
113
-
---
107
+
## Prepare an image to set up Java agent and push to Azure Container Registry
108
+
109
+
> [!TIP]
110
+
> You can skip this step and use `` as the init-container image.
114
111
115
112
1. Build setup image for Application Insights Java agent.
116
113
117
-
Save the Dockerfile and run `docker build` in the same directory.
114
+
Save the Dockerfile along with the setup script, and run `docker build` in the same directory.
118
115
119
116
```Dockerfile
120
117
FROM mcr.microsoft.com/cbl-mariner/base/core:2.0
121
118
122
-
ARG connectionString
119
+
ARG version="3.5.4"
123
120
124
121
RUN tdnf update -y && tdnf install -y curl ca-certificates
125
122
126
-
RUN curl -L https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.5.4/applicationinsights-agent-3.5.4.jar > agent.jar
123
+
RUN curl -L "https://github.com/microsoft/ApplicationInsights-Java/releases/download/${version}/applicationinsights-agent-${version}.jar" > agent.jar
127
124
128
-
RUN echo "{\"connectionString\": \"${connectionString}\"}" > applicationinsights.json
@@ -319,8 +331,6 @@ The following commands help you define variables and ensure your Container Apps
319
331
--query "properties.provisioningState"
320
332
```
321
333
322
-
---
323
-
324
334
Once updated, the command returns a "Succeeded" message. Then you can check out your Application Insights in Azure portal to see your Container App is connected.
0 commit comments