Skip to content

Commit 9696604

Browse files
Apply suggestions from code review
Karl edits. Co-authored-by: Karl Erickson <[email protected]>
1 parent 881826c commit 9696604

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

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

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ ms.author: kuzhong
1111
author: KarlErickson
1212
---
1313

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

16-
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.
16+
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.
1717

1818
In this tutorial, you learn how to:
1919

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

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

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

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

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

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

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

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

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

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

112112
## Prepare the container image
113113

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

116-
1. Save the following Dockerfile:
116+
1. Create a Dockerfile with the following contents:
117117

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

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

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

146-
1. Run the following command to create the image:
146+
1. Use the following command to create the image:
147147

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

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

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

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

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

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

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

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

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

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

207-
1. Create a Container app for further configurations by using the following command:
209+
1. Create a container app for further configurations by using the following command:
208210

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

@@ -230,9 +232,9 @@ To create a Container Apps environment and a container app as the target Java ap
230232

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

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

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

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

@@ -254,9 +256,9 @@ To configure your init container with secrets, environment variables, and volume
254256
> app.yaml
255257
```
256258

257-
1. Edit the configurations in **app.yml** by using the following instructions:
259+
1. Edit **app.yaml** by using the following steps:
258260

259-
1. Add a secret for Application Insights connection string using the following code snippet:
261+
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.
260262

261263
```yaml
262264
properties:
@@ -268,7 +270,7 @@ To configure your init container with secrets, environment variables, and volume
268270

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

271-
1. Add ephemeral storage volume for Java agent files using the following code snippet:
273+
1. Add an ephemeral storage volume for Java agent files by using the following code example:
272274

273275
```yaml
274276
properties:
@@ -278,7 +280,7 @@ To configure your init container with secrets, environment variables, and volume
278280
storageType: EmptyDir
279281
```
280282

281-
1. Add an init container with volume mounts and environment variables, using the following code snippet:
283+
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.
282284

283285
```yaml
284286
properties:
@@ -297,9 +299,7 @@ To configure your init container with secrets, environment variables, and volume
297299
volumeName: java-agent-volume
298300
```
299301

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

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

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

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

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

343-
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.
343+
---
344+
345+
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.
344346

345347
## Clean up resources
346348

347-
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:
349+
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:
348350
349351
# [Bash](#tab/bash)
350352

0 commit comments

Comments
 (0)