title | description | author | ms.author | ms.topic | ms.date |
---|---|---|---|---|---|
Migrate Java applications to Azure |
This topic provides an overview of recommended strategies for migrating Java applications to Azure. |
yevster |
yebronsh |
conceptual |
1/20/2020 |
This topic provides an overview of recommended strategies for migrating Java applications to Azure.
Before you select a cloud destination for your Java application, you'll need to identify its application type. Most Java applications are one of the following types:
- Spring Boot / JAR applications
- Spring Cloud / microservices
- Web applications
- Java EE applications
- Batch / scheduled jobs
These types are described in the following sections.
Many newer applications are invoked directly from the command line. These applications still handle web requests, but instead of relying on an application server to provide HTTP request handling, they incorporate HTTP communication and all other dependencies directly into the application package. Such applications are frequently built with frameworks such as Spring Boot, Dropwizard, Micronaut, MicroProfile, Vert.x, and others.
These applications are packaged into archives with the .jar extension (JAR files).
The microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and are independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies. Such services are frequently built with frameworks such as Spring Cloud.
These services are packaged into multiple applications with the .jar extension (JAR files).
Web applications run inside a Servlet container. Some use servlet APIs directly, while many use additional frameworks that encapsulate servlet APIs, such as Apache Struts, Spring MVC, JavaServer Faces (JSF), and others.
Web applications are packaged into archives with the .war extension (WAR files).
Java EE applications (also referred to as J2EE applications or, more recently Jakarta EE applications) can contain some, all, or none of the elements of web applications. They can also contain and consume many additional components as defined by the Java EE specification.
Java EE applications can be packaged as archives with the .ear extension (EAR files) or as archives with the .war extension (WAR files).
Java EE applications must be deployed onto Java EE-compliant application servers (such as WebLogic, WebSphere, WildFly, GlassFish, Payara, and others).
Applications that rely only on features provided by the Java EE specification (that is, app-server-independent applications) can be migrated from one compliant application server onto another. If your application is dependent on a specific application server (app-server-dependent), you may need to select an Azure service destination that permits you to host that application server.
Some applications are intended to run briefly, execute a particular workload, and then exit rather than wait for requests or user input. Sometimes such jobs need to run once or at regular, scheduled intervals. On premises, such jobs are often invoked from a server's crontab.
These applications are packaged into archives with the .jar extension (JAR files).
Note
If your application uses a scheduler (such as Spring Batch or Quartz) to run scheduled tasks, we strongly recommend that you factor such tasks to run outside of the application. If your application scales to multiple instances in the cloud, the same job will run more than once. Furthermore, if your scheduling mechanism uses the host's local time zone, you may experience undesirable behavior when scaling your application across regions.
The following sections show you which service destinations meet your application requirements, and what responsibilities they involve.
Use the following grid to identify the destinations that support the application types and features you require.
| |App
Service
Java SE|App
Service
Tomcat|Azure
Spring
Cloud|AKS|Virtual Machines|
|---|---|---|---|---|---|---|
| Spring Boot / JAR applications |✔| | |✔|✔|
| Spring Cloud / microservices | | |✔|✔|✔|
| Web applications | |✔| |✔|✔|
| Java EE applications | | | |✔|✔|
| Commercial application servers
(such as WebLogic or WebSphere) | | | |✔|✔|
| Long-term persistence on local filesystem |✔|✔| |✔|✔|
| Application server-level clustering | | | |✔|✔|
| Batch / scheduled jobs | | |✔|✔|✔|
Use the following grid to understand the responsibility each destination places on your team following migration.
Your team is responsible on a continual basis for the tasks indicated with "👉". We recommend implementing a robust, highly automated process for fulfilling all such responsibilities.
Note
This isn't an exhaustive list of responsibilities.
If you deploy the servlet container (such as Spring Boot) as part of your application, you should consider it a library and, as such, it's always your responsibility.
If your application needs to access any of your on-premises services, you'll need to provision one of Azure's connectivity services. For more information, see Choose a solution for connecting an on-premises network to Azure. Alternatively, you'll need to refactor your application to use publicly available APIs that your on-premises resources expose.
You should complete this effort before you start any migration.
Document the hardware of the current production server(s) plus the average and peak request counts and resource usage. You'll need this information to provision resources in the service destination.
Use the following grids to find migration guidance by application type and targeted Azure service destination.
Java applications
Use the rows below to find your Java application type and the columns to find the Azure service destination that will host your application.
If you would like to migrate a JBoss EAP app to Tomcat on App Service, first convert the Java EE app to Java Web Apps (servlets) running on Tomcat, then follow the guidance indicated below.
If you would like to migrate a Web app on Tomcat to Azure Spring Cloud, first convert the app into Spring Cloud microservices, then follow the guidance indicated below.
|Destination →
Application type ↓|App
Service
Java SE|App
Service
Tomcat|Azure
Spring
Cloud|AKS|Virtual Machines|
|---|---|---|---|---|---|---|
| Spring Boot /
JAR applications | guidance | guidance
planned | guidance
planned | guidance
planned | guidance
planned |
| Spring Cloud /
microservices | N/A | N/A | guidance
planned | guidance
planned | guidance
planned |
| Web applications
on Tomcat | N/A | guidance | N/A | guidance | guidance
planned |
Java EE applications
Use the rows below to find your Java EE application type running on a specific app server. Use the columns to find the Azure service destination that will host your application.
|Destination →
App server ↓|App
Service
Java SE|App
Service
Tomcat|Azure
Spring
Cloud|AKS|Virtual Machines|
|---|---|---|---|---|---|---|
| WildFly /
JBoss AS | N/A | N/A | N/A | guidance
planned | guidance
planned |
| WebLogic | N/A | N/A | N/A | guidance | guidance |
| WebSphere | N/A | N/A | N/A | guidance | guidance
planned |
| JBoss EAP | N/A | N/A | N/A | N/A | guidance
planned |