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
@@ -31,7 +33,7 @@ This article is intended to help you quickly get to deployment. Before going to
31
33
* This article requires at least version 2.31.0 of Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
32
34
33
35
> [!NOTE]
34
-
> This guidance can also be executed from a local developer command line with Azure CLI installed. To learn how to install the Azure CLI, see [How to install the Azure CLI](/cli/azure/install-azure-cli).
36
+
> This guidance can also be executed from a local developer command line with Azure CLI installed. To learn how to install the Azure CLI, see [How to install the Azure CLI](/cli/azure/install-azure-cli).
35
37
36
38
* If running the commands in this guide locally (instead of Azure Cloud Shell):
37
39
* Prepare a local machine with Unix-like operating system installed (for example, Ubuntu, Azure Linux, macOS, Windows Subsystem for Linux).
@@ -47,24 +49,25 @@ The following steps guide you to create a Liberty runtime on AKS. After completi
47
49
1. Visit the [Azure portal](https://portal.azure.com/). In the search box at the top of the page, type *IBM WebSphere Liberty and Open Liberty on Azure Kubernetes Service*. When the suggestions start appearing, select the one and only match that appears in the **Marketplace** section. If you prefer, you can go directly to the offer with this shortcut link: [https://aka.ms/liberty-aks](https://aka.ms/liberty-aks).
48
50
49
51
1. Select **Create**.
50
-

51
52
52
53
1. In the **Basics** pane
54
+
53
55
1. create a new resource group. Because resource groups must be unique within a subscription, pick a unique name. An easy way to have unique names is to use a combination of your initials, today's date, and some identifier. For example, `ejb0913-java-liberty-project-rg`.
54
56
1. Select *East US* as **Region**.
55
57
56
58
1. Select **Next**, enter the **AKS** pane. This pane allows you to select an existing AKS cluster and Azure Container Registry (ACR), instead of causing the deployment to create a new one, if desired. This capability enables you to use the sidecar pattern, as shown in the [Azure architecture center](/azure/architecture/patterns/sidecar). You can also adjust the settings for the size and number of the virtual machines in the AKS node pool. Leave all other values at the defaults.
57
-
58
-
1. Select **Next**, enter the **Load Balancing** pane. Next to **Connect to Azure Application Gateway?** select **Yes**, then further configuration will be required.
59
+
60
+
1. Select **Next**, enter the **Load Balancing** pane. Next to **Connect to Azure Application Gateway?** select **Yes**, then further configuration will be required.
61
+
59
62
1. You can customize the **virtual network** and **subnet** into which the deployment will place the resources. Leave these values at their defaults.
60
63
1. You can provide the **TLS/SSL certificate** presented by the Azure Application Gateway. Leave the values at the default to cause the offer to generate a self-signed certificate. Don't go to production using a self-signed certificate. For more information about self-signed certificates, see [Create a self-signed public certificate to authenticate your application](../active-directory/develop/howto-create-self-signed-certificate.md).
61
-
1. You can enable **cookie based affinity**, also known as sticky sessions. We want sticky sessions enabled for this article, so ensure this option is selected.
62
-

64
+
1. You can select **Enable cookie based affinity**, also known as sticky sessions. We want sticky sessions enabled for this article, so ensure this option is selected.
63
65
64
66
1. Select **Next**, enter the **Operator and application** pane. Leave these values at their defaults.
65
-
1.**IBM Supported?** if **Yes**, you select to deploy IBM WebSphere Liberty Operator; if **No**, you select to deploy Open Liberty Operator.
67
+
68
+
1.**IBM Supported?** if **Yes**, you select to deploy IBM WebSphere Liberty Operator; if **No**, you select to deploy Open Liberty Operator.
66
69
1.**Deploy an application?** if **Yes**, you may select to deploy your own application image which need to be public and accessible without credential; or select to deploy the Open Liberty sample image.
67
-
70
+
68
71
1. Select **Review + create** to validate your selected options. In the ***Review + create** pane, when you see **Create** light up after validation pass, select **Create**. The deployment may take up to 20 minutes.
69
72
70
73
## Capture selected information from the deployment
@@ -86,9 +89,11 @@ If you navigated away from the **Deployment is in progress** page, the following
86
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?**.
87
90
88
91
### [Bash](#tab/in-bash)
92
+
89
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.
90
-
94
+
91
95
### [PowerShell](#tab/in-powershell)
96
+
92
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.
93
98
94
99
---
@@ -111,7 +116,7 @@ The following steps guide you through creating an Azure SQL Database single data
111
116
>
112
117
> At the **Networking** step, set **Connectivity method** to **Public endpoint**, **Allow Azure services and resources to access this server** to **Yes**, and **Add current client IP address** to **Yes**.
113
118
>
114
-
> 
119
+
> :::image type="content" source="media/howto-deploy-java-liberty-app/create-sql-database-networking.png" alt-text="Screenshot of the Azure portal that shows the Networking tab of the Create SQL Database page with the Connectivity method and Firewall rules settings highlighted." lightbox="media/howto-deploy-java-liberty-app/create-sql-database-networking.png":::
115
120
116
121
Now that the database and AKS cluster have been created, we can proceed to preparing AKS to host your Open Liberty application.
117
122
@@ -166,40 +171,44 @@ In directory *liberty/config*, the *server.xml* file is used to configure the DB
166
171
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.
167
172
168
173
### [Bash](#tab/in-bash)
174
+
169
175
```bash
170
176
cd<path-to-your-repo>/java-app
171
177
172
178
# The following variables will be used for deployment file generation into target.
The following steps deploy and test the application.
297
+
Use the following steps to deploy and test the application:
282
298
283
299
1. Connect to the AKS cluster.
284
300
@@ -299,15 +315,13 @@ The following steps deploy and test the application.
299
315
kubectl apply -f openlibertyapplication-agic.yaml
300
316
```
301
317
302
-
1. Wait for the pods to be restarted.
303
-
304
-
Wait until all pods are restarted successfully using the following command.
318
+
1. Wait until all pods are restarted successfully by using the following command:
305
319
306
320
```bash
307
321
kubectl get pods --watch
308
322
```
309
323
310
-
You should see output similar to the following to indicate that all the pods are running.
324
+
You should see output similar to the following example to indicate that all the pods are running:
311
325
312
326
```output
313
327
NAME READY STATUS RESTARTS AGE
@@ -325,19 +339,23 @@ The following steps deploy and test the application.
325
339
```
326
340
327
341
Copy the value of **ADDRESS** from the output, this is the frontend public IP address of the deployed Azure Application Gateway.
328
-
342
+
329
343
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.
If the web page doesn't render correctly or returns a `502 Bad Gateway` error, that's because the app is still starting in the background. Wait for a few minutes and then try again.
@@ -347,15 +365,19 @@ The following steps deploy and test the application.
347
365
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.
348
366
349
367
### [Bash](#tab/in-bash)
368
+
350
369
```bash
351
370
az group delete --name $RESOURCE_GROUP_NAME --yes --no-wait
352
371
az group delete --name <db-resource-group> --yes --no-wait
353
372
```
373
+
354
374
### [PowerShell](#tab/in-powershell)
375
+
355
376
```powershell
356
377
az group delete --name $Env:RESOURCE_GROUP_NAME --yes --no-wait
357
378
az group delete --name <db-resource-group> --yes --no-wait
0 commit comments