Skip to content

Commit 31075f9

Browse files
Merge branch 'apmIntegrationInACA' of github.com:JoshTheTechWriter/azure-docs-pr into apmIntegrationInACA
2 parents da466a0 + 9696604 commit 31075f9

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

articles/container-apps/java-application-performance-management-config.md

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ ms.custom: devx-track-azurecli
77
ms.topic: tutorial
88
ms.date: 11/4/2024
99
ms.author: kuzhong
10-
author: karler
10+
author: KarlErickson
1111
---
1212

13-
# Tutorial: Configure Application Performance Management (APM) Java agent with init-container in Azure Container Apps
13+
# Tutorial: Configure the Application Performance Management (APM) Java agent with init containers in Azure Container Apps
1414

15-
This article shows you how to configure Application Performance Management (APM) Java agent with init containers in Azure Container Apps, which injects APM solutions without modifying your app image. While you can package the APM plugin in the same image or Dockerfile with your app, doing that binds together management efforts like release and Common Vulnerabilities and Exposures (CVE) mitigation.
15+
This article shows you how to configure the Application Performance Management (APM) Java agent with init containers in Azure Container Apps. APM helps power observability for your container apps. You can package the APM plugin in the same image or Dockerfile with your app, but it binds together the management concerns, like release and Common Vulnerabilities and Exposures (CVE) mitigation. Rather than binding the concerns together, you can use the Java agent and init containers in Azure Container Apps to inject APM solutions without modifying your app image.
1616

1717
In this tutorial, you learn how to:
1818

@@ -58,7 +58,7 @@ The following steps define environment variables and ensure your Container Apps
5858
$LOCATION="eastus"
5959
```
6060

61-
1. To sign in to Azure CLI, use the following commands:
61+
1. Sign in to the Azure CLI by using the following commands:
6262

6363
# [Bash](#tab/bash)
6464

@@ -74,7 +74,7 @@ The following steps define environment variables and ensure your Container Apps
7474
az account set --subscription $SUBSCRIPTION_ID
7575
```
7676

77-
1. To ensure you have the latest version of Azure CLI extensions for Container Apps and Application Insights, use the following commands:
77+
1. Ensure that you have the latest version of the Azure CLI extensions for Container Apps and Application Insights by using the following commands:
7878

7979
# [Bash](#tab/bash)
8080

@@ -90,7 +90,7 @@ The following steps define environment variables and ensure your Container Apps
9090
az extension add --name application-insights --upgrade
9191
```
9292

93-
1. To retrieve the connection string of Application Insights, use the following commands:
93+
1. Retrieve the connection string for Application Insights by using the following commands:
9494

9595
# [Bash](#tab/bash)
9696

@@ -110,11 +110,11 @@ The following steps define environment variables and ensure your Container Apps
110110

111111
## Prepare the container image
112112

113-
To build a setup image for Application Insights Java agent, perform the following steps in the same directory:
113+
To build a setup image for Application Insights Java agent, use the following steps in the same directory:
114114

115-
1. Save the following Dockerfile:
115+
1. Create a Dockerfile with the following contents:
116116

117-
```Dockerfile
117+
```dockerfile
118118
FROM mcr.microsoft.com/cbl-mariner/base/core:2.0
119119
120120
ARG version="3.5.4"
@@ -128,9 +128,9 @@ To build a setup image for Application Insights Java agent, perform the followin
128128
ENTRYPOINT ["/bin/sh", "setup.sh"]
129129
```
130130

131-
1. Save the following setup script:
131+
1. Create a file named **setup.sh** and add the following contents:
132132

133-
```setup.sh
133+
```bash
134134
#!/bin/sh
135135
136136
if [[ -z "$CONNECTION_STRING" ]]; then
@@ -142,7 +142,7 @@ To build a setup image for Application Insights Java agent, perform the followin
142142
fi
143143
```
144144

145-
1. Run the following command to create the image:
145+
1. Use the following command to create the image:
146146

147147
# [Bash](#tab/bash)
148148

@@ -177,13 +177,13 @@ To build a setup image for Application Insights Java agent, perform the followin
177177

178178
## Create a Container Apps environment and a Container App as the target Java app
179179

180-
To create a Container Apps environment and a container app as the target Java app, perform the following steps:
180+
To create a Container Apps environment and a container app as the target Java app, use the following steps:
181181

182182
1. Create a Container Apps environment by using the following command:
183183

184184
# [Bash](#tab/bash)
185185

186-
```bash
186+
```azurecli
187187
az containerapp env create \
188188
--name $ENVIRONMENT_NAME \
189189
--resource-group $RESOURCE_GROUP \
@@ -193,17 +193,19 @@ To create a Container Apps environment and a container app as the target Java ap
193193

194194
# [PowerShell](#tab/powershell)
195195

196-
```powershell
196+
```azurepowershell
197197
az containerapp env create `
198198
--name $ENVIRONMENT_NAME `
199199
--resource-group $RESOURCE_GROUP `
200200
--location "$LOCATION" `
201201
--query "properties.provisioningState"
202202
```
203203

204+
---
205+
204206
After successfully creating the Container Apps environment, the command line returns a `Succeeded` message.
205207

206-
1. Create a Container app for further configurations by using the following command:
208+
1. Create a container app for further configurations by using the following command:
207209

208210
# [Bash](#tab/bash)
209211

@@ -229,9 +231,9 @@ To create a Container Apps environment and a container app as the target Java ap
229231

230232
## Configure init container, secrets, environment variables, and volumes to set up Application Insights integration
231233

232-
To configure your init container with secrets, environment variables, and volumes so it can be used with Insights, perform the following steps:
234+
Use the following steps to configure your init container with secrets, environment variables, and volumes so you can use them with Application Insights:
233235

234-
1. Write the current configurations of the running Container App to **app.yml** in the current directory, by using the following command:
236+
1. Write the current configurations of the running Container App to **app.yaml** in the current directory, by using the following command:
235237

236238
# [Bash](#tab/bash)
237239

@@ -253,9 +255,9 @@ To configure your init container with secrets, environment variables, and volume
253255
> app.yaml
254256
```
255257

256-
1. Edit the configurations in **app.yml** by using the following instructions:
258+
1. Edit **app.yaml** by using the following steps:
257259

258-
1. Add a secret for Application Insights connection string using the following code snippet:
260+
1. Add a secret for the Application Insights connection string using the following example. Be sure to replace `$CONNECTION_STRING` with your Application Insights connection string.
259261

260262
```yaml
261263
properties:
@@ -267,7 +269,7 @@ To configure your init container with secrets, environment variables, and volume
267269

268270
Replace $CONNECTION_STRING with your Azure Application Insights connection string.
269271

270-
1. Add ephemeral storage volume for Java agent files using the following code snippet:
272+
1. Add an ephemeral storage volume for Java agent files by using the following code example:
271273

272274
```yaml
273275
properties:
@@ -277,7 +279,7 @@ To configure your init container with secrets, environment variables, and volume
277279
storageType: EmptyDir
278280
```
279281

280-
1. Add an init container with volume mounts and environment variables, using the following code snippet:
282+
1. Add an init container with volume mounts and environment variables by using the following example. Be sure to replace `<CONTAINER_REGISTRY_NAME>` with your Azure Container Registry name.
281283

282284
```yaml
283285
properties:
@@ -296,9 +298,7 @@ To configure your init container with secrets, environment variables, and volume
296298
volumeName: java-agent-volume
297299
```
298300

299-
Replace `<CONTAINER_REGISTRY_NAME>` with your Azure Container Registry name.
300-
301-
1. Update the app container with volume mounts and environment variables, using the following code snippets:
301+
1. Update the app container with volume mounts and environment variables by using the following example:
302302

303303
```yaml
304304
properties:
@@ -317,7 +317,7 @@ To configure your init container with secrets, environment variables, and volume
317317
volumeName: java-agent-volume
318318
```
319319

320-
1. Update the container app with the modified YAML file, using the following command:
320+
1. Update the container app with the modified YAML file by using the following command:
321321

322322
# [Bash](#tab/bash)
323323

@@ -339,11 +339,13 @@ To configure your init container with secrets, environment variables, and volume
339339
--query "properties.provisioningState"
340340
```
341341

342-
After updating the container app, the command returns a `Succeeded` message. Then you can view your Application Insights in the Azure portal to verify that your container app is connected.
342+
---
343+
344+
After updating the container app, the command returns a `Succeeded` message. Then, you can verify that your container app is connected by viewing your Application Insights instance in the Azure portal.
343345

344346
## Clean up resources
345347

346-
The resource group you created in this tutorial contributes to your Azure bill. If you aren't going to need it in the long term, use the following command to remove it:
348+
The resources you created in this tutorial contribute to your Azure bill. If you aren't going to need them in the long term, use the following command to remove the resource group, which also removes all the resources it contains:
347349
348350
# [Bash](#tab/bash)
349351

0 commit comments

Comments
 (0)