Skip to content

Commit ed76b61

Browse files
committed
Resolve comments
1 parent 73386c2 commit ed76b61

File tree

1 file changed

+45
-41
lines changed

1 file changed

+45
-41
lines changed

articles/container-apps/java-apm-agent-config.md

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: croffz
66
ms.service: azure-container-apps
77
ms.custom: devx-track-azurecli
88
ms.topic: tutorial
9-
ms.date: 10/29/2024
9+
ms.date: 11/4/2024
1010
ms.author: kuzhong
1111
---
1212

@@ -32,73 +32,77 @@ In this tutorial, you learn how to:
3232

3333
The following commands help you define variables and ensure your Container Apps extension is up to date.
3434

35-
1. Sign in to the Azure CLI.
35+
1. Set up environment variables used in following commands.
3636

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

39-
```azurecli
40-
az login
39+
```bash
40+
SUBSCRIPTION_ID="00000000-0000-0000-0000-000000000000" # Replace with your own Azure subscription ID
41+
APP_INSIGHTS_RESOURCE_ID="/subscriptions/$SUBSCRIPTION_ID/resourceGroups/my-resource-group/providers/microsoft.insights/components/my-app-insights"
42+
CONTAINER_REGISTRY_NAME="myacr"
43+
RESOURCE_GROUP="my-resource-group"
44+
ENVIRONMENT_NAME="my-environment"
45+
CONTAINER_APP_NAME="my-container-app"
46+
LOCATION="eastus"
4147
```
4248

4349
# [PowerShell](#tab/powershell)
4450

45-
```azurecli
46-
az login
51+
```powershell
52+
$SUBSCRIPTION_ID="00000000-0000-0000-0000-000000000000" # Replace with your own Azure subscription ID
53+
$APP_INSIGHTS_RESOURCE_ID="/subscriptions/$SUBSCRIPTION_ID/resourceGroups/my-resource-group/providers/microsoft.insights/components/my-app-insights"
54+
$CONTAINER_REGISTRY_NAME="myacr"
55+
$RESOURCE_GROUP="my-resource-group"
56+
$ENVIRONMENT_NAME="my-environment"
57+
$CONTAINER_APP_NAME="my-container-app"
58+
$LOCATION="eastus"
4759
```
4860

49-
1. Ensure you have the latest version of Azure CLI extensions for Container Apps and Application Insights.
61+
1. Sign in to the Azure CLI.
5062

5163
# [Bash](#tab/bash)
5264

53-
```azurecli
54-
az extension add -n containerapp --upgrade
55-
az extension add -n application-insights --upgrade
65+
```bash
66+
az login
67+
az account set --subscription $SUBSCRIPTION_ID
5668
```
5769

5870
# [PowerShell](#tab/powershell)
5971

60-
```azurecli
61-
az extension add -n containerapp --upgrade
62-
az extension add -n application-insights --upgrade
72+
```powershell
73+
az login
74+
az account set --subscription $SUBSCRIPTION_ID
6375
```
6476

65-
1. Set up environment variables used in various commands to follow.
77+
1. Ensure you have the latest version of Azure CLI extensions for Container Apps and Application Insights.
6678

6779
# [Bash](#tab/bash)
6880

6981
```bash
70-
APP_INSIGHTS_RESOURCE_ID="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/microsoft.insights/components/my-app-insights"
71-
CONTAINER_REGISTRY_NAME="myacr"
72-
RESOURCE_GROUP="my-resource-group"
73-
ENVIRONMENT_NAME="my-environment"
74-
CONTAINER_APP_NAME="my-container-app"
75-
LOCATION="eastus"
82+
az extension add -n containerapp --upgrade
83+
az extension add -n application-insights --upgrade
7684
```
7785

7886
# [PowerShell](#tab/powershell)
7987

8088
```powershell
81-
$APP_INSIGHTS_RESOURCE_ID="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/microsoft.insights/components/my-app-insights"
82-
$CONTAINER_REGISTRY_NAME="myacr"
83-
$RESOURCE_GROUP="my-resource-group"
84-
$ENVIRONMENT_NAME="my-environment"
85-
$CONTAINER_APP_NAME="my-container-app"
86-
$LOCATION="eastus"
89+
az extension add -n containerapp --upgrade
90+
az extension add -n application-insights --upgrade
8791
```
8892

8993
1. Retrieve the connection string of Application Insights.
9094

9195
# [Bash](#tab/bash)
9296

93-
```azurecli
97+
```bash
9498
CONNECTION_STRING=$(az monitor app-insights component show \
9599
--ids $APP_INSIGHTS_RESOURCE_ID \
96100
--query connectionString)
97101
```
98102

99103
# [PowerShell](#tab/powershell)
100104

101-
```azurecli
105+
```powershell
102106
$CONNECTION_STRING=(az monitor app-insights component show `
103107
--ids $APP_INSIGHTS_RESOURCE_ID `
104108
--query connectionString)
@@ -142,7 +146,7 @@ The following commands help you define variables and ensure your Container Apps
142146

143147
# [Bash](#tab/bash)
144148

145-
```azurecli
149+
```bash
146150
docker build . -t "$CONTAINER_REGISTRY_NAME.azurecr.io/samples/java-agent-setup:1.0.0"
147151
```
148152

@@ -156,7 +160,7 @@ The following commands help you define variables and ensure your Container Apps
156160

157161
# [Bash](#tab/bash)
158162

159-
```azurecli
163+
```bash
160164
az acr login --name $CONTAINER_REGISTRY_NAME
161165
docker push "$CONTAINER_REGISTRY_NAME.azurecr.io/samples/java-agent-setup:1.0.0"
162166
```
@@ -177,7 +181,7 @@ The following commands help you define variables and ensure your Container Apps
177181

178182
# [Bash](#tab/bash)
179183

180-
```azurecli
184+
```bash
181185
az containerapp env create \
182186
--name $ENVIRONMENT_NAME \
183187
--resource-group $RESOURCE_GROUP \
@@ -187,7 +191,7 @@ The following commands help you define variables and ensure your Container Apps
187191

188192
# [PowerShell](#tab/powershell)
189193

190-
```azurecli
194+
```powershell
191195
az containerapp env create `
192196
--name $ENVIRONMENT_NAME `
193197
--resource-group $RESOURCE_GROUP `
@@ -201,7 +205,7 @@ The following commands help you define variables and ensure your Container Apps
201205

202206
# [Bash](#tab/bash)
203207

204-
```azurecli
208+
```bash
205209
az containerapp create \
206210
--name $CONTAINER_APP_NAME \
207211
--environment $ENVIRONMENT_NAME \
@@ -211,7 +215,7 @@ The following commands help you define variables and ensure your Container Apps
211215

212216
# [PowerShell](#tab/powershell)
213217

214-
```azurecli
218+
```powershell
215219
az containerapp create `
216220
--name $CONTAINER_APP_NAME `
217221
--environment $ENVIRONMENT_NAME `
@@ -221,13 +225,13 @@ The following commands help you define variables and ensure your Container Apps
221225

222226
Once created, the command returns a "Succeeded" message.
223227

224-
## Configure init-container, environment variables, and volumes to set up Application Insights integration
228+
## Configure init-container, secrets, environment variables, and volumes to set up Application Insights integration
225229

226230
1. Get current configurations of the running Container App.
227231

228232
# [Bash](#tab/bash)
229233

230-
```azurecli
234+
```bash
231235
az containerapp show \
232236
--name $CONTAINER_APP_NAME \
233237
--resource-group $RESOURCE_GROUP \
@@ -236,7 +240,7 @@ The following commands help you define variables and ensure your Container Apps
236240

237241
# [PowerShell](#tab/powershell)
238242

239-
```azurecli
243+
```powershell
240244
az containerapp show `
241245
--name $CONTAINER_APP_NAME `
242246
--resource-group $RESOURCE_GROUP `
@@ -313,7 +317,7 @@ The following commands help you define variables and ensure your Container Apps
313317

314318
# [Bash](#tab/bash)
315319

316-
```azurecli
320+
```bash
317321
az containerapp update \
318322
--name $CONTAINER_APP_NAME \
319323
--resource-group $RESOURCE_GROUP \
@@ -323,7 +327,7 @@ The following commands help you define variables and ensure your Container Apps
323327

324328
# [PowerShell](#tab/powershell)
325329

326-
```azurecli
330+
```powershell
327331
az containerapp update `
328332
--name $CONTAINER_APP_NAME `
329333
--resource-group $RESOURCE_GROUP `
@@ -338,11 +342,11 @@ The following commands help you define variables and ensure your Container Apps
338342
The resources created in this tutorial contribute to your Azure bill. If you aren't going to keep them in the long term, run the following commands to clean them up.
339343
340344
# [Bash](#tab/bash)
341-
```azurecli
345+
```bash
342346
az group delete --resource-group $RESOURCE_GROUP
343347
```
344348
# [PowerShell](#tab/powershell)
345-
```azurecli
349+
```powershell
346350
az group delete --resource-group $RESOURCE_GROUP
347351
```
348352

0 commit comments

Comments
 (0)