Skip to content

Commit c42dbbb

Browse files
Merge pull request #266599 from edburns/edburns-msft-ibm-527-update-café-app
On branch edburns-msft-ibm-527-update-café-app
2 parents fd6a8b8 + 234205f commit c42dbbb

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

articles/aks/howto-deploy-java-liberty-app.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Deploy a Java application with Open Liberty/WebSphere Liberty on an
55
author: KarlErickson
66
ms.author: edburns
77
ms.topic: how-to
8-
ms.date: 12/21/2022
8+
ms.date: 01/16/2024
99
keywords: java, jakartaee, javaee, microprofile, open-liberty, websphere-liberty, aks, kubernetes
1010
ms.custom: devx-track-java, devx-track-javaee, devx-track-javaee-liberty, devx-track-javaee-liberty-aks, devx-track-javaee-websphere, build-2023, devx-track-extended-java, devx-track-azurecli, linux-related-content
1111
---
@@ -28,6 +28,8 @@ This article is intended to help you quickly get to deployment. Before going to
2828

2929
[!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note.md)]
3030

31+
* You can use Azure Cloud Shell or a local terminal.
32+
3133
[!INCLUDE [azure-cli-prepare-your-environment.md](~/articles/reusable-content/azure-cli/azure-cli-prepare-your-environment.md)]
3234

3335
* This article requires at least version 2.31.0 of Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
@@ -88,7 +90,7 @@ The following steps guide you to create a Liberty runtime on AKS. After completi
8890
1. You can deploy WebSphere Liberty Operator by selecting **Yes** for option **IBM supported?**. Leaving the default **No** deploys Open Liberty Operator.
8991
1. You can deploy an application for your selected Operator by selecting **Yes** for option **Deploy an application?**. Leaving the default **No** doesn't deploy any application.
9092

91-
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.
93+
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. While you wait for the deployment to complete, you can follow the steps in the section [Create an Azure SQL Database](#create-an-azure-sql-database). After completing that section, come back here and continue.
9294

9395
## Capture selected information from the deployment
9496

@@ -146,14 +148,16 @@ There are a few samples in the repository. We'll use *java-app/*. Here's the fil
146148
```bash
147149
git clone https://github.com/Azure-Samples/open-liberty-on-aks.git
148150
cd open-liberty-on-aks
149-
git checkout 20240109
151+
export BASE_DIR=$PWD
152+
git checkout 20240220
150153
```
151154

152155
#### [PowerShell](#tab/in-powershell)
153156

154157
```powershell
155158
git clone https://github.com/Azure-Samples/open-liberty-on-aks.git
156159
cd open-liberty-on-aks
160+
$env:BASE_DIR=$PWD.Path
157161
git checkout 20240109
158162
```
159163

@@ -195,18 +199,18 @@ Now that you've gathered the necessary properties, you can build the application
195199

196200
#### [Bash](#tab/in-bash)
197201

198-
```bash
199-
cd <path-to-your-repo>/java-app
200202

203+
```bash
204+
cd $BASE_DIR/java-app
201205
# The following variables will be used for deployment file generation into target.
202206
export LOGIN_SERVER=<Azure-Container-Registry-Login-Server-URL>
203207
export REGISTRY_NAME=<Azure-Container-Registry-name>
204208
export USER_NAME=<Azure-Container-Registry-username>
205-
export PASSWORD=<Azure-Container-Registry-password>
209+
export PASSWORD='<Azure-Container-Registry-password>'
206210
export DB_SERVER_NAME=<server-name>.database.windows.net
207211
export DB_NAME=<database-name>
208212
export DB_USER=<server-admin-login>@<server-name>
209-
export DB_PASSWORD=<server-admin-password>
213+
export DB_PASSWORD='<server-admin-password>'
210214
export INGRESS_TLS_SECRET=<ingress-TLS-secret-name>
211215

212216
mvn clean install
@@ -215,7 +219,7 @@ mvn clean install
215219
#### [PowerShell](#tab/in-powershell)
216220

217221
```powershell
218-
cd <path-to-your-repo>/java-app
222+
cd $env:BASE_DIR\java-app
219223
220224
# The following variables will be used for deployment file generation into target.
221225
$Env:LOGIN_SERVER=<Azure-Container-Registry-Login-Server-URL>
@@ -242,14 +246,14 @@ You can now run and test the project locally before deploying to Azure. For conv
242246
#### [Bash](#tab/in-bash)
243247

244248
```bash
245-
cd <path-to-your-repo>/java-app
249+
cd $BASE_DIR/java-app
246250
mvn liberty:run
247251
```
248252

249253
#### [PowerShell](#tab/in-powershell)
250254

251255
```powershell
252-
cd <path-to-your-repo>/java-app
256+
cd $env:BASE_DIR\java-app
253257
mvn liberty:run
254258
```
255259

@@ -266,17 +270,17 @@ You can now run the `docker build` command to build the image.
266270
#### [Bash](#tab/in-bash)
267271

268272
```bash
269-
cd <path-to-your-repo>/java-app/target
273+
cd $BASE_DIR/java-app
270274

271-
docker build -t javaee-cafe:v1 --pull --file=Dockerfile .
275+
docker buildx build --platform linux/amd64 -t javaee-cafe:v1 --pull --file=Dockerfile .
272276
```
273277

274278
#### [PowerShell](#tab/in-powershell)
275279

276280
```powershell
277-
cd <path-to-your-repo>/java-app/target
281+
cd $env:BASE_DIR\java-app
278282
279-
docker build -t javaee-cafe:v1 --pull --file=Dockerfile .
283+
docker buildx build --platform linux/amd64 -t javaee-cafe:v1 --pull --file=Dockerfile .
280284
```
281285

282286
---
@@ -350,14 +354,14 @@ Use the following steps to deploy and test the application:
350354
#### [Bash](#tab/in-bash)
351355

352356
```bash
353-
cd <path-to-your-repo>/java-app/target
357+
cd $BASE_DIR/java-app/target
354358
kubectl apply -f db-secret.yaml
355359
```
356360

357361
#### [PowerShell](#tab/in-powershell)
358362

359363
```powershell
360-
cd <path-to-your-repo>/java-app/target
364+
cd $env:BASE_DIR\java-app\target
361365
kubectl apply -f db-secret.yaml
362366
```
363367

articles/aks/includes/jakartaee/create-azure-sql-database.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ Use the following steps to create an Azure SQL Database single database for use
1616
> 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**.
1717
>
1818
> :::image type="content" source="media/create-azure-sql-database/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/create-azure-sql-database/create-sql-database-networking.png":::
19+
>
20+
> Be aware that the [serverless compute tier](/azure/azure-sql/database/serverless-tier-overview) you selected for this database saves money by putting the database to sleep during periods of inactivity. The sample app will fail if the database is asleep when the app starts up. To force the database to wake up, you can execute a query using the query editor. Follow the steps in [Query the database](/azure/azure-sql/database/serverless-tier-overview). Here is an example query: `SELECT * FROM COFFEE;`.

0 commit comments

Comments
 (0)