You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -88,13 +88,13 @@ If you navigated away from the **Deployment is in progress** page, the following
88
88
*`cmdToConnectToCluster`
89
89
*`appDeploymentTemplateYaml` if you select **No** to **Deploy an application?** when deploying the Marketplace offer; or `appDeploymentYaml` if you select **yes** to **Deploy an application?**.
90
90
91
-
# [Bash](#tab/in-bash)
91
+
### [Bash](#tab/in-bash)
92
92
93
-
Paste the value of `appDeploymentTemplateYaml` or `appDeploymentYaml` into a Bash shell, append `| grep secretName`, and execute. This command will output the Ingress TLS secret name, such as `- secretName: secret785e2c`. Save aside the value for `secretName` from the output.
93
+
Paste the value of `appDeploymentTemplateYaml` or `appDeploymentYaml` into a Bash shell, append `| grep secretName`, and execute. This command will output the Ingress TLS secret name, such as `- secretName: secret785e2c`. Save aside the value for `secretName` from the output.
94
94
95
-
# [PowerShell](#tab/in-powershell)
95
+
### [PowerShell](#tab/in-powershell)
96
96
97
-
Paste the quoted string in `appDeploymentTemplateYaml` or `appDeploymentYaml` into a PowerShell, append `| ForEach-Object { [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_)) } | Select-String "secretName"`, and execute. This command will output the Ingress TLS secret name, such as `- secretName: secret785e2c`. Save aside the value for `secretName` from the output.
97
+
Paste the quoted string in `appDeploymentTemplateYaml` or `appDeploymentYaml` into a PowerShell, append `| ForEach-Object { [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($_)) } | Select-String "secretName"`, and execute. This command will output the Ingress TLS secret name, such as `- secretName: secret785e2c`. Save aside the value for `secretName` from the output.
98
98
99
99
---
100
100
@@ -130,12 +130,24 @@ Clone the sample code for this guide. The sample is on [GitHub](https://github.c
130
130
131
131
There are a few samples in the repository. We'll use *java-app/*. Here's the file structure of the application.
If you see a message about being in "detached HEAD" state, this message is safe to ignore. It just means you have checked out a tag.
140
152
141
153
```
@@ -170,7 +182,7 @@ In directory *liberty/config*, the *server.xml* file is used to configure the DB
170
182
171
183
Now that you've gathered the necessary properties, you can build the application. The POM file for the project reads many variables from the environment. As part of the Maven build, these variables are used to populate values in the YAML files located in *src/main/aks*. You can do something similar for your application outside Maven if you prefer.
@@ -216,11 +228,22 @@ You can now run and test the project locally before deploying to Azure. For conv
216
228
217
229
1. Start the application using `liberty:run`. `liberty:run` will also use the environment variables defined in the previous step.
218
230
231
+
#### [Bash](#tab/in-bash)
232
+
219
233
```bash
220
234
cd<path-to-your-repo>/java-app
221
235
mvn liberty:run
222
236
```
223
237
238
+
#### [PowerShell](#tab/in-powershell)
239
+
240
+
```powershell
241
+
cd <path-to-your-repo>/java-app
242
+
mvn liberty:run
243
+
```
244
+
245
+
---
246
+
224
247
1. Verify the application works as expected. You should see a message similar to `[INFO] [AUDIT] CWWKZ0003I: The application javaee-cafe updated in 1.930 seconds.` in the command output if successful. Go to `http://localhost:9080/` in your browser and verify the application is accessible and all functions are working.
225
248
226
249
1. Press <kbd>Ctrl</kbd>+<kbd>C</kbd> to stop.
@@ -229,39 +252,51 @@ You can now run and test the project locally before deploying to Azure. For conv
229
252
230
253
You can now run the `docker build` command to build the image.
docker tag javaee-cafe:v1 ${Env:LOGIN_SERVER}/javaee-cafe:v1
@@ -301,25 +336,56 @@ Use the following steps to deploy and test the application:
301
336
302
337
1. Apply the DB secret.
303
338
339
+
#### [Bash](#tab/in-bash)
340
+
304
341
```bash
305
342
cd<path-to-your-repo>/java-app/target
306
343
kubectl apply -f db-secret.yaml
307
344
```
308
345
346
+
#### [PowerShell](#tab/in-powershell)
347
+
348
+
```powershell
349
+
cd <path-to-your-repo>/java-app/target
350
+
kubectl apply -f db-secret.yaml
351
+
```
352
+
353
+
---
354
+
309
355
You'll see the output `secret/db-secret-sql created`.
310
356
311
357
1. Apply the deployment file.
312
358
359
+
#### [Bash](#tab/in-bash)
360
+
313
361
```bash
314
362
kubectl apply -f openlibertyapplication-agic.yaml
315
363
```
316
364
365
+
#### [PowerShell](#tab/in-powershell)
366
+
367
+
```powershell
368
+
kubectl apply -f openlibertyapplication-agic.yaml
369
+
```
370
+
371
+
---
372
+
317
373
1. Wait until all pods are restarted successfully by using the following command:
318
374
375
+
#### [Bash](#tab/in-bash)
376
+
319
377
```bash
320
378
kubectl get pods --watch
321
379
```
322
380
381
+
#### [PowerShell](#tab/in-powershell)
382
+
383
+
```powershell
384
+
kubectl get pods --watch
385
+
```
386
+
387
+
---
388
+
323
389
You should see output similar to the following example to indicate that all the pods are running:
324
390
325
391
```output
@@ -333,27 +399,37 @@ Use the following steps to deploy and test the application:
333
399
334
400
1. Get **ADDRESS** of the Ingress resource deployed with the application
335
401
402
+
#### [Bash](#tab/in-bash)
403
+
336
404
```bash
337
405
kubectl get ingress
338
406
```
339
407
408
+
#### [PowerShell](#tab/in-powershell)
409
+
410
+
```powershell
411
+
kubectl get ingress
412
+
```
413
+
414
+
---
415
+
340
416
Copy the value of **ADDRESS** from the output, this is the frontend public IP address of the deployed Azure Application Gateway.
341
417
342
418
1. Go to `https://<ADDRESS>` to test the application. For your convenience, this shell command will create an environment variable whose value you can paste straight into the browser.
@@ -363,14 +439,14 @@ Use the following steps to deploy and test the application:
363
439
364
440
To avoid Azure charges, you should clean up unnecessary resources. When the cluster is no longer needed, use the [az group delete](/cli/azure/group#az-group-delete) command to remove the resource group, container service, container registry, and all related resources.
365
441
366
-
# [Bash](#tab/in-bash)
442
+
### [Bash](#tab/in-bash)
367
443
368
444
```bash
369
445
az group delete --name $RESOURCE_GROUP_NAME --yes --no-wait
370
446
az group delete --name <db-resource-group> --yes --no-wait
371
447
```
372
448
373
-
# [PowerShell](#tab/in-powershell)
449
+
### [PowerShell](#tab/in-powershell)
374
450
375
451
```powershell
376
452
az group delete --name $Env:RESOURCE_GROUP_NAME --yes --no-wait
0 commit comments