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
This Java Web Application is not Microservices Application but standard Java Web Application which is wrote by using Java EE 8 technologies.
7
7
8
8
At first, you can select and expand the Continent (North America, Asia, Africa, Europe, South America, Oceania, Antarctica) in the left side of the menu, then you can see the countries in the Continent. Then you can select the one country, then you can see the cities where has the number of the population over 1,000,000 in right side of the screen like follows.
9
-
All of the data is coming from Managed [Azure Database for MySQL](https://docs.microsoft.com/azure/mysql/?WT.mc_id=docs-github-yoterada).
10
-
9
+
Data is coming from Managed [Azure Database for MySQL](https://docs.microsoft.com/azure/mysql/?WT.mc_id=docs-github-yoterada) or Managed [Azure SQL Database](https://learn.microsoft.com/en-us/azure/azure-sql/database/sql-database-paas-overview?view=azuresql).
11
10
12
11

13
12
14
-
15
13
## Runtime selection of Azure App Service on Linux for Java
16
14
17
15
In order to confirm which Java Runtime we can use on [Azure App Service on Linux](https://docs.microsoft.com/azure/app-service/containers/app-service-linux-intro?WT.mc_id=docs-github-yoterada), you can execute the following command.
@@ -60,13 +58,28 @@ OpenJDK 64-Bit Server VM 19.4-(Zulu-11.31+11-linux-musl-x64)-Microsoft-Azure-res
60
58
```
61
59
[Java long-term support and medium-term support on Azure and Azure Stack](https://docs.microsoft.com/azure/developer/java/fundamentals/java-jdk-long-term-support?WT.mc_id=docs-github-yoterada)
62
60
63
-
## Setup MySQL Server before creating the Java Web App
64
61
65
-
In order to run this application, you need to install and configure the [Azure Database for MySQL ](https://docs.microsoft.com/azure/mysql/?WT.mc_id=docs-github-yoterada) before the deploy.
66
-
In order to install and create the MySQL, please refer to the following documents?
62
+
> [!NOTE]
63
+
> The following sections include step by step guide of how to create a Web App project and how to create the Java application.
64
+
> You can also jump into subfolder *[java-webapp-with-mysql](java-webapp-with-mysql)* and *[java-webapp-with-mssql](java-webapp-with-mssql)* to run the application for a quick test.
65
+
66
+
67
+
## Setup Database before creating the Java Web App
68
+
69
+
In order to run this application, you need to install and configure the database before the deploy.
70
+
71
+
This application can be run with both MySQL and Azure SQL. You can set up one of them per your requirement and configure corresponding setting in Web Application.
72
+
73
+
### Setup Azure Database for MySQL
74
+
75
+
In order to install and create the MySQL, please refer to the following documents.
67
76
68
77
[Create DB for MySQL on Azure](https://github.com/yoshioterada/microprofile-samples/blob/master/MySQL/Azure-MySQL-Setup-For-Sample-App.md) for preparation of this Java Web App.
69
78
79
+
### Setup Azure SQL database
80
+
81
+
Follow [Setup Azure SQL database](java-webapp-with-mssql/AzureSQL-Setup-For-Sample-App.md) to create database and import world data.
82
+
70
83
71
84
## Create Maven Project for Java Web App
72
85
@@ -141,6 +154,8 @@ The above directory structure will be automatically created and it is created to
141
154
142
155
### Modify
143
156
157
+
The following pom.xml file is for MySQL.
158
+
144
159
```
145
160
<?xml version="1.0" encoding="UTF-8"?>
146
161
@@ -250,6 +265,26 @@ The above directory structure will be automatically created and it is created to
250
265
251
266
```
252
267
268
+
For Azure SQL, replace MySQL dependency:
269
+
270
+
```xml
271
+
<dependency>
272
+
<groupId>mysql</groupId>
273
+
<artifactId>mysql-connector-java</artifactId>
274
+
<version>8.0.21</version>
275
+
</dependency>
276
+
```
277
+
278
+
With SQL dependency:
279
+
280
+
```xml
281
+
<dependency>
282
+
<groupId>com.microsoft.sqlserver</groupId>
283
+
<artifactId>mssql-jdbc</artifactId>
284
+
<version>12.6.1.jre11</version>
285
+
</dependency>
286
+
```
287
+
253
288
## Modify web.xml file
254
289
255
290
```xml
@@ -291,42 +326,59 @@ In order to deploy the Java Web App to Azure App Service, if you configure the [
If you execute the command, it will show following question. If you answer all of the qeustion, the plugin will automatically added the configuration to deploy to Azure.
0 commit comments