Skip to content

Commit 1e54416

Browse files
Various edits, including improvements to code slugs.
1 parent 31075f9 commit 1e54416

File tree

1 file changed

+68
-66
lines changed

1 file changed

+68
-66
lines changed

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

Lines changed: 68 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Tutorial: Configure Application Performance Management (APM) Java agent with init-container in Azure Container Apps"
2+
title: "Tutorial: Configure Application Performance Management (APM) Java agent with Init Container in Azure Container Apps"
33
description: Learn to configure Application Performance Management (APM) Java agent with init-container in Azure Container Apps
44
services: container-apps
55
ms.service: azure-container-apps
@@ -30,9 +30,9 @@ In this tutorial, you learn how to:
3030

3131
## Set up the environment
3232

33-
The following steps define environment variables and ensure your Container Apps extension is up to date:
33+
Use the following steps to define environment variables and ensure your Container Apps extension is up to date:
3434

35-
1. To define environment variables, use the following commands:
35+
1. Define environment variables by using the following commands:
3636

3737
# [Bash](#tab/bash)
3838

@@ -60,47 +60,47 @@ The following steps define environment variables and ensure your Container Apps
6060

6161
1. Sign in to the Azure CLI by using the following commands:
6262

63-
# [Bash](#tab/bash)
63+
# [Azure CLI](#tab/azurecli)
6464

65-
```bash
65+
```azurecli
6666
az login
6767
az account set --subscription $SUBSCRIPTION_ID
6868
```
6969

70-
# [PowerShell](#tab/powershell)
70+
# [Azure PowerShell](#tab/azurepowershell)
7171

72-
```powershell
72+
```azurepowershell
7373
az login
7474
az account set --subscription $SUBSCRIPTION_ID
7575
```
7676

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:
77+
1. Use the following commands to ensure that you have the latest version of the Azure CLI extensions for Container Apps and Application Insights:
7878

79-
# [Bash](#tab/bash)
79+
# [Azure CLI](#tab/azurecli)
8080

8181
```bash
8282
az extension add --name containerapp --upgrade
8383
az extension add --name application-insights --upgrade
8484
```
8585

86-
# [PowerShell](#tab/powershell)
86+
# [Azure PowerShell](#tab/azurepowershell)
8787

8888
```powershell
8989
az extension add --name containerapp --upgrade
9090
az extension add --name application-insights --upgrade
9191
```
9292

93-
1. Retrieve the connection string for Application Insights by using the following commands:
93+
1. Retrieve the connection string for your Application Insights instance by using the following commands:
9494

95-
# [Bash](#tab/bash)
95+
# [Azure CLI](#tab/azurecli)
9696

9797
```bash
9898
CONNECTION_STRING=$(az monitor app-insights component show \
9999
--ids $APP_INSIGHTS_RESOURCE_ID \
100100
--query connectionString)
101101
```
102102

103-
# [PowerShell](#tab/powershell)
103+
# [Azure PowerShell](#tab/azurepowershell)
104104

105105
```powershell
106106
$CONNECTION_STRING=(az monitor app-insights component show `
@@ -110,7 +110,7 @@ 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, use the following steps in the same directory:
113+
To build a setup image for the Application Insights Java agent, use the following steps in the same directory:
114114

115115
1. Create a Dockerfile with the following contents:
116116

@@ -128,7 +128,7 @@ To build a setup image for Application Insights Java agent, use the following st
128128
ENTRYPOINT ["/bin/sh", "setup.sh"]
129129
```
130130

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

133133
```bash
134134
#!/bin/sh
@@ -142,30 +142,30 @@ To build a setup image for Application Insights Java agent, use the following st
142142
fi
143143
```
144144

145-
1. Use the following command to create the image:
145+
1. Create an image by using the following command:
146146

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

149149
```bash
150-
docker build . -t "$CONTAINER_REGISTRY_NAME.azurecr.io/samples/java-agent-setup:1.0.0"
150+
docker build . --tag "$CONTAINER_REGISTRY_NAME.azurecr.io/samples/java-agent-setup:1.0.0"
151151
```
152152

153153
# [PowerShell](#tab/powershell)
154154

155155
```powershell
156-
docker build . -t "$CONTAINER_REGISTRY_NAME.azurecr.io/samples/java-agent-setup:1.0.0"
156+
docker build . --tag "$CONTAINER_REGISTRY_NAME.azurecr.io/samples/java-agent-setup:1.0.0"
157157
```
158158

159159
1. Push the image to Azure Container Registry or another container image registry by using the following commands:
160160

161-
# [Bash](#tab/bash)
161+
# [Azure CLI](#tab/azurecli)
162162

163163
```bash
164164
az acr login --name $CONTAINER_REGISTRY_NAME
165165
docker push "$CONTAINER_REGISTRY_NAME.azurecr.io/samples/java-agent-setup:1.0.0"
166166
```
167167

168-
# [PowerShell](#tab/powershell)
168+
# [Azure PowerShell](#tab/azurepowershell)
169169

170170
```powershell
171171
az acr login --name $CONTAINER_REGISTRY_NAME
@@ -181,7 +181,7 @@ To create a Container Apps environment and a container app as the target Java ap
181181

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

184-
# [Bash](#tab/bash)
184+
# [Azure CLI](#tab/azurecli)
185185

186186
```azurecli
187187
az containerapp env create \
@@ -191,7 +191,7 @@ To create a Container Apps environment and a container app as the target Java ap
191191
--query "properties.provisioningState"
192192
```
193193

194-
# [PowerShell](#tab/powershell)
194+
# [Azure PowerShell](#tab/azurepowershell)
195195

196196
```azurepowershell
197197
az containerapp env create `
@@ -203,11 +203,11 @@ To create a Container Apps environment and a container app as the target Java ap
203203

204204
---
205205

206-
After successfully creating the Container Apps environment, the command line returns a `Succeeded` message.
206+
After you successfully create the Container Apps environment, the command line returns a `Succeeded` message.
207207

208-
1. Create a container app for further configurations by using the following command:
208+
1. Create a container app for further configuration by using the following command:
209209

210-
# [Bash](#tab/bash)
210+
# [Azure CLI](#tab/azurecli)
211211

212212
```bash
213213
az containerapp create \
@@ -217,7 +217,7 @@ To create a Container Apps environment and a container app as the target Java ap
217217
--query "properties.provisioningState"
218218
```
219219

220-
# [PowerShell](#tab/powershell)
220+
# [Azure PowerShell](#tab/azurepowershell)
221221

222222
```powershell
223223
az containerapp create `
@@ -227,15 +227,17 @@ To create a Container Apps environment and a container app as the target Java ap
227227
--query "properties.provisioningState"
228228
```
229229

230-
After successfully creating the Container App, the command line returns a `Succeeded` message.
230+
---
231+
232+
After you create the container app, the command line returns a `Succeeded` message.
231233

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

234-
Use the following steps to configure your init container with secrets, environment variables, and volumes so you can use them with Application Insights:
236+
Use the following steps to configure your init container with secrets, environment variables, and volumes. This configuration allows you to use the stored information with your Application Insights instance.
235237

236-
1. Write the current configurations of the running Container App to **app.yaml** in the current directory, by using the following command:
238+
1. Write the current configuration of the running Container App to an **app.yaml** file in the current directory, by using the following command:
237239

238-
# [Bash](#tab/bash)
240+
# [Azure CLI](#tab/azurecli)
239241

240242
```bash
241243
az containerapp show \
@@ -245,7 +247,7 @@ Use the following steps to configure your init container with secrets, environme
245247
> app.yaml
246248
```
247249

248-
# [PowerShell](#tab/powershell)
250+
# [Azure PowerShell](#tab/azurepowershell)
249251

250252
```powershell
251253
az containerapp show `
@@ -255,9 +257,9 @@ Use the following steps to configure your init container with secrets, environme
255257
> app.yaml
256258
```
257259

258-
1. Edit **app.yaml** by using the following steps:
260+
1. Use the following steps to edit your **app.yaml** file. The edits add secrets, ephemeral storage, and an init container to the file, and update the app container.
259261

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.
262+
1. Add a secret for the Application Insights connection string by using the following example. Replace `$CONNECTION_STRING` with your Application Insights connection string.
261263

262264
```yaml
263265
properties:
@@ -267,10 +269,8 @@ Use the following steps to configure your init container with secrets, environme
267269
value: $CONNECTION_STRING
268270
```
269271

270-
Replace $CONNECTION_STRING with your Azure Application Insights connection string.
272+
1. Add an ephemeral storage volume for Java agent files by using the following example:
271273

272-
1. Add an ephemeral storage volume for Java agent files by using the following code example:
273-
274274
```yaml
275275
properties:
276276
template:
@@ -279,8 +279,8 @@ Use the following steps to configure your init container with secrets, environme
279279
storageType: EmptyDir
280280
```
281281

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.
283-
282+
1. Add an init container with volume mounts and environment variables by using the following example. Replace `<CONTAINER_REGISTRY_NAME>` with your Azure Container Registry name.
283+
284284
```yaml
285285
properties:
286286
template:
@@ -317,47 +317,49 @@ Use the following steps to configure your init container with secrets, environme
317317
volumeName: java-agent-volume
318318
```
319319

320-
1. Update the container app with the modified YAML file by using the following command:
321-
322-
# [Bash](#tab/bash)
323-
324-
```bash
325-
az containerapp update \
326-
--name $CONTAINER_APP_NAME \
327-
--resource-group $RESOURCE_GROUP \
328-
--yaml app.yaml \
329-
--query "properties.provisioningState"
330-
```
331-
332-
# [PowerShell](#tab/powershell)
333-
334-
```powershell
335-
az containerapp update `
336-
--name $CONTAINER_APP_NAME `
337-
--resource-group $RESOURCE_GROUP `
338-
--yaml app.yaml `
339-
--query "properties.provisioningState"
340-
```
341-
342-
---
320+
1. Update the container app with the modified **app.yaml** file by using the following command:
321+
322+
# [Azure CLI](#tab/azurecli)
323+
324+
```azurecli
325+
az containerapp update \
326+
--resource-group $RESOURCE_GROUP \
327+
--name $CONTAINER_APP_NAME \
328+
--yaml app.yaml \
329+
--query "properties.provisioningState"
330+
```
331+
332+
# [Azure PowerShell](#tab/azurepowershell)
333+
334+
```azurepowershell
335+
az containerapp update `
336+
--resource-group $RESOURCE_GROUP `
337+
--name $CONTAINER_APP_NAME `
338+
--yaml app.yaml `
339+
--query "properties.provisioningState"
340+
```
341+
342+
---
343+
344+
After you update the container app, the command returns a `Succeeded` message. Now you can verify that your container app is connected, by viewing your Application Insights instance in the Azure portal.
343345

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.
345-
346346
## Clean up resources
347347

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:
348+
The resources you created in this tutorial contribute to your Azure bill. If you won't need them long term, use the following command to remove the resource group and its resources:
349349
350-
# [Bash](#tab/bash)
350+
# [Azure CLI](#tab/azurecli)
351351
352352
```bash
353353
az group delete --resource-group $RESOURCE_GROUP
354354
```
355355
356-
# [PowerShell](#tab/powershell)
356+
# [Azure PowerShell](#tab/azurepowershell)
357357
```powershell
358358
az group delete --resource-group $RESOURCE_GROUP
359359
```
360360
361+
---
362+
361363
## Other APM solutions
362364
363365
Other than [Azure Application Insights](/azure/azure-monitor/app/java-standalone-config), there are other popular APM solutions in the community. If you want to integrate your Azure Container App with other APM providers, just replace the Java agent JAR and related config files.

0 commit comments

Comments
 (0)