@@ -59,24 +59,31 @@ Use the following steps to provision an Azure Spring Apps service instance.
59
59
60
60
1 . Select a location. This location must be a location supporting the Azure Spring Apps Enterprise plan. For more information, see the [ Azure Spring Apps FAQ] ( faq.md ) .
61
61
62
+ 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.
63
+
64
+ ``` azurecli
65
+ export LOCATION="<location>"
66
+ export RESOURCE_GROUP="<resource-group-name>"
67
+ export SERVICE_NAME="<Azure-Spring-Apps-service-instance-name>"
68
+ export WORKSPACE_NAME="<workspace-name>"
69
+ ```
70
+
62
71
1 . Use the following command to create a resource group:
63
72
64
73
``` azurecli
65
74
az group create \
66
- --name <resource-group-name> \
67
- --location <location>
75
+ --name ${RESOURCE_GROUP} \
76
+ --location ${LOCATION}
68
77
```
69
78
70
79
For more information about resource groups, see [ What is Azure Resource Manager?] ( ../../azure-resource-manager/management/overview.md ) .
71
80
72
- 1 . Prepare a name for your Azure Spring Apps service instance. The name 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.
73
-
74
81
1 . Use the following command to create an Azure Spring Apps service instance:
75
82
76
83
``` azurecli
77
84
az spring create \
78
- --resource-group <resource-group-name> \
79
- --name <Azure-Spring-Apps-service-instance-name> \
85
+ --resource-group ${RESOURCE_GROUP} \
86
+ --name ${SERVICE_NAME} \
80
87
--sku enterprise \
81
88
--enable-application-configuration-service \
82
89
--enable-service-registry \
@@ -88,23 +95,23 @@ Use the following steps to provision an Azure Spring Apps service instance.
88
95
89
96
``` azurecli
90
97
az monitor log-analytics workspace create \
91
- --resource-group <resource-group-name> \
92
- --workspace-name <workspace-name> \
93
- --location <location>
98
+ --resource-group ${RESOURCE_GROUP} \
99
+ --workspace-name ${WORKSPACE_NAME} \
100
+ --location ${LOCATION}
94
101
```
95
102
96
103
1 . Use the following commands to retrieve the Resource ID for your Log Analytics Workspace and Azure Spring Apps service instance:
97
104
98
105
``` azurecli
99
106
export LOG_ANALYTICS_RESOURCE_ID=$(az monitor log-analytics workspace show \
100
- --resource-group <resource-group-name> \
101
- --workspace-name <workspace-name> \
107
+ --resource-group ${RESOURCE_GROUP} \
108
+ --workspace-name ${WORKSPACE_NAME} \
102
109
--query id \
103
110
--output tsv)
104
111
105
112
export AZURE_SPRING_APPS_RESOURCE_ID=$(az spring show \
106
- --resource-group <resource-group-name> \
107
- --name <Azure-Spring-Apps-service-instance-name> \
113
+ --resource-group ${RESOURCE_GROUP} \
114
+ --name ${SERVICE_NAME} \
108
115
--query id \
109
116
--output tsv)
110
117
```
@@ -158,29 +165,29 @@ Use the following steps to provision an Azure Spring Apps service instance.
158
165
159
166
``` azurecli
160
167
az spring app create \
161
- --resource-group <resource-group-name> \
168
+ --resource-group ${RESOURCE_GROUP} \
162
169
--name cart-service \
163
- --service <Azure-Spring-Apps-service-instance-name>
170
+ --service ${SERVICE_NAME}
164
171
165
172
az spring app create \
166
- --resource-group <resource-group-name> \
173
+ --resource-group ${RESOURCE_GROUP} \
167
174
--name order-service \
168
- --service <Azure-Spring-Apps-service-instance-name>
175
+ --service ${SERVICE_NAME}
169
176
170
177
az spring app create \
171
- --resource-group <resource-group-name> \
178
+ --resource-group ${RESOURCE_GROUP} \
172
179
--name payment-service \
173
- --service <Azure-Spring-Apps-service-instance-name>
180
+ --service ${SERVICE_NAME}
174
181
175
182
az spring app create \
176
- --resource-group <resource-group-name> \
183
+ --resource-group ${RESOURCE_GROUP} \
177
184
--name catalog-service \
178
- --service <Azure-Spring-Apps-service-instance-name>
185
+ --service ${SERVICE_NAME}
179
186
180
187
az spring app create \
181
- --resource-group <resource-group-name> \
188
+ --resource-group ${RESOURCE_GROUP} \
182
189
--name frontend \
183
- --service <Azure-Spring-Apps-service-instance-name>
190
+ --service ${SERVICE_NAME}
184
191
```
185
192
186
193
## Externalize configuration with Application Configuration Service
@@ -191,9 +198,9 @@ Use the following steps to configure Application Configuration Service.
191
198
192
199
``` azurecli
193
200
az spring application-configuration-service git repo add \
194
- --resource-group <resource-group-name> \
201
+ --resource-group ${RESOURCE_GROUP} \
195
202
--name acme-fitness-store-config \
196
- --service <Azure-Spring-Apps-service-instance-name> \
203
+ --service ${SERVICE_NAME} \
197
204
--label main \
198
205
--patterns "catalog/default,catalog/key-vault,identity/default,identity/key-vault,payment/default" \
199
206
--uri "https://github.com/Azure-Samples/acme-fitness-store-config"
@@ -203,14 +210,14 @@ Use the following steps to configure Application Configuration Service.
203
210
204
211
``` azurecli
205
212
az spring application-configuration-service bind \
206
- --resource-group <resource-group-name> \
213
+ --resource-group ${RESOURCE_GROUP} \
207
214
--app payment-service \
208
- --service <Azure-Spring-Apps-service-instance-name>
215
+ --service ${SERVICE_NAME}
209
216
210
217
az spring application-configuration-service bind \
211
- --resource-group <resource-group-name> \
218
+ --resource-group ${RESOURCE_GROUP} \
212
219
--app catalog-service \
213
- --service <Azure-Spring-Apps-service-instance-name>
220
+ --service ${SERVICE_NAME}
214
221
```
215
222
216
223
## Activate service registration and discovery
@@ -219,14 +226,14 @@ To active service registration and discovery, use the following commands to bind
219
226
220
227
``` azurecli
221
228
az spring service-registry bind \
222
- --resource-group <resource-group-name> \
229
+ --resource-group ${RESOURCE_GROUP} \
223
230
--app payment-service \
224
- --service <Azure-Spring-Apps-service-instance-name>
231
+ --service ${SERVICE_NAME}
225
232
226
233
az spring service-registry bind \
227
- --resource-group <resource-group-name> \
234
+ --resource-group ${RESOURCE_GROUP} \
228
235
--app catalog-service \
229
- --service <Azure-Spring-Apps-service-instance-name>
236
+ --service ${SERVICE_NAME}
230
237
```
231
238
232
239
## Deploy polyglot applications with Tanzu Build Service
@@ -237,19 +244,19 @@ Use the following steps to deploy and build applications. For these steps, make
237
244
238
245
``` azurecli
239
246
az spring build-service builder create \
240
- --resource-group <resource-group-name> \
247
+ --resource-group ${RESOURCE_GROUP} \
241
248
--name quickstart-builder \
242
- --service <Azure-Spring-Apps-service-instance-name> \
249
+ --service ${SERVICE_NAME} \
243
250
--builder-file azure-spring-apps-enterprise/resources/json/tbs/builder.json
244
251
```
245
252
246
253
1 . Use the following command to build and deploy the payment service:
247
254
248
255
``` azurecli
249
256
az spring app deploy \
250
- --resource-group <resource-group-name> \
257
+ --resource-group ${RESOURCE_GROUP} \
251
258
--name payment-service \
252
- --service <Azure-Spring-Apps-service-instance-name> \
259
+ --service ${SERVICE_NAME} \
253
260
--config-file-pattern payment/default \
254
261
--source-path apps/acme-payment \
255
262
--build-env BP_JVM_VERSION=17
@@ -259,9 +266,9 @@ Use the following steps to deploy and build applications. For these steps, make
259
266
260
267
``` azurecli
261
268
az spring app deploy \
262
- --resource-group <resource-group-name> \
269
+ --resource-group ${RESOURCE_GROUP} \
263
270
--name catalog-service \
264
- --service <Azure-Spring-Apps-service-instance-name> \
271
+ --service ${SERVICE_NAME} \
265
272
--config-file-pattern catalog/default \
266
273
--source-path apps/acme-catalog \
267
274
--build-env BP_JVM_VERSION=17
@@ -271,9 +278,9 @@ Use the following steps to deploy and build applications. For these steps, make
271
278
272
279
``` azurecli
273
280
az spring app deploy \
274
- --resource-group <resource-group-name> \
281
+ --resource-group ${RESOURCE_GROUP} \
275
282
--name order-service \
276
- --service <Azure-Spring-Apps-service-instance-name> \
283
+ --service ${SERVICE_NAME} \
277
284
--builder quickstart-builder \
278
285
--source-path apps/acme-order
279
286
```
@@ -282,9 +289,9 @@ Use the following steps to deploy and build applications. For these steps, make
282
289
283
290
``` azurecli
284
291
az spring app deploy \
285
- --resource-group <resource-group-name> \
292
+ --resource-group ${RESOURCE_GROUP} \
286
293
--name cart-service \
287
- --service <Azure-Spring-Apps-service-instance-name> \
294
+ --service ${SERVICE_NAME} \
288
295
--builder quickstart-builder \
289
296
--env "CART_PORT=8080" \
290
297
--source-path apps/acme-cart
@@ -294,9 +301,9 @@ Use the following steps to deploy and build applications. For these steps, make
294
301
295
302
``` azurecli
296
303
az spring app deploy \
297
- --resource-group <resource-group-name> \
304
+ --resource-group ${RESOURCE_GROUP} \
298
305
--name frontend \
299
- --service <Azure-Spring-Apps-service-instance-name> \
306
+ --service ${SERVICE_NAME} \
300
307
--source-path apps/acme-shopping
301
308
```
302
309
@@ -311,23 +318,23 @@ Use the following steps to configure Spring Cloud Gateway and configure routes t
311
318
312
319
``` azurecli
313
320
az spring gateway update \
314
- --resource-group <resource-group-name> \
315
- --service <Azure-Spring-Apps-service-instance-name> \
321
+ --resource-group ${RESOURCE_GROUP} \
322
+ --service ${SERVICE_NAME} \
316
323
--assign-endpoint true
317
324
```
318
325
319
326
1 . Use the following commands to configure Spring Cloud Gateway API information:
320
327
321
328
``` azurecli
322
329
export GATEWAY_URL=$(az spring gateway show \
323
- --resource-group <resource-group-name> \
324
- --service <Azure-Spring-Apps-service-instance-name> \
330
+ --resource-group ${RESOURCE_GROUP} \
331
+ --service ${SERVICE_NAME} \
325
332
--query properties.url \
326
333
--output tsv)
327
334
328
335
az spring gateway update \
329
- --resource-group <resource-group-name> \
330
- --service <Azure-Spring-Apps-service-instance-name> \
336
+ --resource-group ${RESOURCE_GROUP} \
337
+ --service ${SERVICE_NAME} \
331
338
--api-description "Fitness Store API" \
332
339
--api-title "Fitness Store" \
333
340
--api-version "v1.0" \
@@ -339,9 +346,9 @@ Use the following steps to configure Spring Cloud Gateway and configure routes t
339
346
340
347
``` azurecli
341
348
az spring gateway route-config create \
342
- --resource-group <resource-group-name> \
349
+ --resource-group ${RESOURCE_GROUP} \
343
350
--name cart-routes \
344
- --service <Azure-Spring-Apps-service-instance-name> \
351
+ --service ${SERVICE_NAME} \
345
352
--app-name cart-service \
346
353
--routes-file azure-spring-apps-enterprise/resources/json/routes/cart-service.json
347
354
```
@@ -350,9 +357,9 @@ Use the following steps to configure Spring Cloud Gateway and configure routes t
350
357
351
358
``` azurecli
352
359
az spring gateway route-config create \
353
- --resource-group <resource-group-name> \
360
+ --resource-group ${RESOURCE_GROUP} \
354
361
--name order-routes \
355
- --service <Azure-Spring-Apps-service-instance-name> \
362
+ --service ${SERVICE_NAME} \
356
363
--app-name order-service \
357
364
--routes-file azure-spring-apps-enterprise/resources/json/routes/order-service.json
358
365
```
@@ -361,9 +368,9 @@ Use the following steps to configure Spring Cloud Gateway and configure routes t
361
368
362
369
``` azurecli
363
370
az spring gateway route-config create \
364
- --resource-group <resource-group-name> \
371
+ --resource-group ${RESOURCE_GROUP} \
365
372
--name catalog-routes \
366
- --service <Azure-Spring-Apps-service-instance-name> \
373
+ --service ${SERVICE_NAME} \
367
374
--app-name catalog-service \
368
375
--routes-file azure-spring-apps-enterprise/resources/json/routes/catalog-service.json
369
376
```
@@ -372,9 +379,9 @@ Use the following steps to configure Spring Cloud Gateway and configure routes t
372
379
373
380
``` azurecli
374
381
az spring gateway route-config create \
375
- --resource-group <resource-group-name> \
382
+ --resource-group ${RESOURCE_GROUP} \
376
383
--name frontend-routes \
377
- --service <Azure-Spring-Apps-service-instance-name> \
384
+ --service ${SERVICE_NAME} \
378
385
--app-name frontend \
379
386
--routes-file azure-spring-apps-enterprise/resources/json/routes/frontend.json
380
387
```
@@ -383,8 +390,8 @@ Use the following steps to configure Spring Cloud Gateway and configure routes t
383
390
384
391
``` azurecli
385
392
export GATEWAY_URL=$(az spring gateway show \
386
- --resource-group <resource-group-name> \
387
- --service <Azure-Spring-Apps-service-instance-name> \
393
+ --resource-group ${RESOURCE_GROUP} \
394
+ --service ${SERVICE_NAME} \
388
395
--query properties.url \
389
396
--output tsv)
390
397
@@ -401,17 +408,17 @@ Use the following steps to configure API Portal.
401
408
402
409
``` azurecli
403
410
az spring api-portal update \
404
- --resource-group <resource-group-name> \
405
- --service <Azure-Spring-Apps-service-instance-name> \
411
+ --resource-group ${RESOURCE_GROUP} \
412
+ --service ${SERVICE_NAME} \
406
413
--assign-endpoint true
407
414
```
408
415
409
416
1 . Use the following commands to retrieve the URL for API Portal:
410
417
411
418
``` azurecli
412
419
export PORTAL_URL=$(az spring api-portal show \
413
- --resource-group <resource-group-name> \
414
- --service <Azure-Spring-Apps-service-instance-name> \
420
+ --resource-group ${RESOURCE_GROUP} \
421
+ --service ${SERVICE_NAME} \
415
422
--query properties.url \
416
423
--output tsv)
417
424
0 commit comments