Skip to content

Commit 1b07fc9

Browse files
committed
replace
1 parent 3bfafdb commit 1b07fc9

File tree

1 file changed

+33
-24
lines changed

1 file changed

+33
-24
lines changed

articles/spring-apps/enterprise/quickstart-monitor-end-to-end-enterprise.md

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,30 +41,39 @@ You must manually provide the Application Insights connection string to the Orde
4141
> [!NOTE]
4242
> Currently only the buildpacks for Java and NodeJS applications support Application Insights instrumentation.
4343
44+
1. Create variables to hold the resource names by using the following commands. Be sure to replace the placeholders with your own values. The name of your Azure Spring Apps service instance must be between 4 and 32 characters long and can contain only lowercase letters, numbers, and hyphens. The first character of the service name must be a letter and the last character must be either a letter or a number.
45+
46+
```azurecli
47+
export RESOURCE_GROUP="<resource-group-name>"
48+
export APP_INSIGHTS_NAME="<app-insights-name>"
49+
export KEY_VAULT_NAME="<key-vault-name>"
50+
export AZURE_SPRING_APPS_SERVICE_INSTANCE_NAME="<Azure-Spring-Apps-service-instance-name>"
51+
```
52+
53+
> [!NOTE]
54+
> By default, the APP_INSIGHTS_NAME is same as the AZURE_SPRING_APPS_SERVICE_INSTANCE_NAME.
55+
4456
1. Use the following commands to retrieve the Application Insights connection string and set it in Key Vault:
4557

4658
```azurecli
4759
export CONNECTION_STRING=$(az monitor app-insights component show \
48-
--resource-group <resource-group-name> \
49-
--app <app-insights-name> \
60+
--resource-group ${RESOURCE_GROUP} \
61+
--app ${APP_INSIGHTS_NAME} \
5062
--query "connectionString" \
5163
--output tsv)
5264
5365
az keyvault secret set \
54-
--vault-name <key-vault-name> \
66+
--vault-name ${KEY_VAULT_NAME} \
5567
--name "ApplicationInsights--ConnectionString" \
5668
--value ${CONNECTION_STRING}
5769
```
5870

59-
> [!NOTE]
60-
> By default, the Application Insights service instance has the same name as the Azure Spring Apps service instance.
61-
6271
1. Use the following command to update the sampling rate for the Application Insights binding to increase the amount of data available:
6372

6473
```azurecli
6574
az spring build-service builder buildpack-binding set \
66-
--resource-group <resource-group-name> \
67-
--service <Azure-Spring-Apps-service-instance-name> \
75+
--resource-group ${RESOURCE_GROUP} \
76+
--service ${AZURE_SPRING_APPS_SERVICE_INSTANCE_NAME} \
6877
--builder-name default \
6978
--name default \
7079
--type ApplicationInsights \
@@ -75,28 +84,28 @@ You must manually provide the Application Insights connection string to the Orde
7584

7685
```azurecli
7786
az spring app restart \
78-
--resource-group <resource-group-name> \
79-
--service <Azure-Spring-Apps-service-instance-name> \
87+
--resource-group ${RESOURCE_GROUP} \
88+
--service ${AZURE_SPRING_APPS_SERVICE_INSTANCE_NAME} \
8089
--name cart-service
8190
8291
az spring app restart \
83-
--resource-group <resource-group-name> \
84-
--service <Azure-Spring-Apps-service-instance-name> \
92+
--resource-group ${RESOURCE_GROUP} \
93+
--service ${AZURE_SPRING_APPS_SERVICE_INSTANCE_NAME} \
8594
--name order-service
8695
8796
az spring app restart \
88-
--resource-group <resource-group-name> \
89-
--service <Azure-Spring-Apps-service-instance-name> \
97+
--resource-group ${RESOURCE_GROUP} \
98+
--service ${AZURE_SPRING_APPS_SERVICE_INSTANCE_NAME} \
9099
--name catalog-service
91100
92101
az spring app restart \
93-
--resource-group <resource-group-name> \
94-
--service <Azure-Spring-Apps-service-instance-name> \
102+
--resource-group ${RESOURCE_GROUP} \
103+
--service ${AZURE_SPRING_APPS_SERVICE_INSTANCE_NAME} \
95104
--name frontend
96105
97106
az spring app restart \
98-
--resource-group <resource-group-name> \
99-
--service <Azure-Spring-Apps-service-instance-name> \
107+
--resource-group ${RESOURCE_GROUP} \
108+
--service ${AZURE_SPRING_APPS_SERVICE_INSTANCE_NAME} \
100109
--name identity-service
101110
```
102111

@@ -112,8 +121,8 @@ Generate traffic in the application by moving through the application, viewing t
112121

113122
```azurecli
114123
export GATEWAY_URL=$(az spring gateway show \
115-
--resource-group <resource-group-name> \
116-
--service <Azure-Spring-Apps-service-instance-name> \
124+
--resource-group ${RESOURCE_GROUP} \
125+
--service ${AZURE_SPRING_APPS_SERVICE_INSTANCE_NAME} \
117126
--query "properties.url" \
118127
--output tsv)
119128
@@ -126,19 +135,19 @@ Use the following command to get the latest 100 lines of application console log
126135

127136
```azurecli
128137
az spring app logs \
129-
--resource-group <resource-group-name> \
138+
--resource-group ${RESOURCE_GROUP} \
130139
--name catalog-service \
131-
--service <Azure-Spring-Apps-service-instance-name> \
140+
--service ${AZURE_SPRING_APPS_SERVICE_INSTANCE_NAME} \
132141
--lines 100
133142
```
134143

135144
By adding the `--follow` option, you can get real-time log streaming from an app. Use the following command to try log streaming for the Catalog Service application:
136145

137146
```azurecli
138147
az spring app logs \
139-
--resource-group <resource-group-name> \
148+
--resource-group ${RESOURCE_GROUP} \
140149
--name catalog-service \
141-
--service <Azure-Spring-Apps-service-instance-name> \
150+
--service ${AZURE_SPRING_APPS_SERVICE_INSTANCE_NAME} \
142151
--follow
143152
```
144153

0 commit comments

Comments
 (0)