Skip to content

Commit 2e42b21

Browse files
authored
Merge pull request #313297 from craigshoemaker/aca/deep/migration
[Container Apps] New: Migration guides
2 parents d953c51 + 115d818 commit 2e42b21

38 files changed

Lines changed: 1407 additions & 1 deletion

articles/container-apps/TOC.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,20 @@ items:
250250
href: troubleshoot-target-port-settings.md
251251
- name: Container start
252252
href: troubleshoot-container-start-failures.md
253-
- name: Migration
253+
- name: Migrate to Azure Container Apps
254254
items:
255255
- name: Heroku migration overview
256256
href: migrate-heroku-overview.md
257257
- name: Migrate from Heroku
258258
href: migrate-heroku.md
259+
- name: Migrate Spring Boot applications
260+
href: migrate-spring-boot.md
261+
- name: Migrate Spring Cloud applications
262+
href: migrate-spring-cloud.md
263+
- name: Migrate Tomcat applications
264+
href: migrate-tomcat.md
265+
- name: Migrate Java with GitHub Copilot app modernization
266+
href: migrate-java-github-copilot-app-modernization.md
259267
- name: Azure Developer CLI (azd) templates
260268
href: container-apps-cli-templates.md
261269
- name: Observability
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
author: deepganguly
3+
ms.author: deepganguly
4+
ms.service: azure-container-apps
5+
ms.topic: include
6+
ms.date: 03/11/2026
7+
---
8+
9+
- **CI/CD pipelines**: Add a deployment pipeline for automatic, consistent deployments. Instructions are available for [Azure Pipelines](../azure-pipelines.md) and [GitHub Actions](../github-actions.md).
10+
- **Blue-green deployment**: Use container app revisions, revision labels, and ingress traffic weights to test code changes in production before making them available to end users. For more information, see [Blue-Green Deployment in Azure Container Apps](../blue-green-deployment.md).
11+
- **Service bindings**: Add service bindings to connect your application to supported Azure databases. Service bindings eliminate the need to provide connection information, including credentials, to your Spring Boot applications.
12+
- **JVM metrics**: Enable the Java development stack to collect JVM core metrics. For more information, see [Java metrics for Java apps in Azure Container Apps](../java-metrics.md).
13+
- **Alerts**: Add Azure Monitor alert rules and action groups to quickly detect and address aberrant conditions. For more information, see [Set up alerts in Azure Container Apps](../alerts.md).
14+
- **Zone redundancy**: Replicate your app across availability zones by enabling zone redundancy. Traffic is load balanced and automatically routed to replicas if a zone outage occurs. For more information, see [Reliability in Azure Container Apps](/azure/reliability/reliability-azure-container-apps).
15+
- **Web Application Firewall**: Protect your container app from common exploits and vulnerabilities by using Web Application Firewall on Application Gateway. For more information, see [Protect Azure Container Apps with Web Application Firewall on Application Gateway](../waf-app-gateway.md).
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
author: deepganguly
3+
ms.author: deepganguly
4+
ms.service: azure-container-apps
5+
ms.topic: include
6+
ms.date: 03/11/2026
7+
---
8+
9+
#### Service discovery and load balancing
10+
11+
Enable your application to work with the Spring Cloud Registry component so other deployed Spring applications and clients can dynamically discover it. For more information, see [Configure settings for the Eureka Server for Spring component in Azure Container Apps](../java-eureka-server.md).
12+
13+
Then, modify any application clients to use the Spring Client Load Balancer. When you use the Spring Client Load Balancer, the client gets addresses for all running instances of the application and finds one that works if another becomes corrupted or unresponsive. For more information, see [Spring Tips: Spring Cloud Load Balancer](https://spring.io/blog/2020/03/25/spring-tips-spring-cloud-loadbalancer) in the Spring Blog.
14+
15+
#### API gateway
16+
17+
Consider adding a [Spring Cloud Gateway](https://cloud.spring.io/spring-cloud-gateway/reference/html/) instance. Spring Cloud Gateway provides a single endpoint for all applications deployed in your Azure Container Apps environment. If you already deployed a Spring Cloud Gateway, ensure that you configured a routing rule to route traffic to your newly deployed application.
18+
19+
#### Centralized configuration
20+
21+
Consider adding a Spring Cloud Config Server to centrally manage and version-control configuration for all your Spring Cloud applications. First, create a Git repository to house the configuration and configure the app instance to use it. For more information, see [Configure settings for the Config Server for Spring component in Azure Container Apps](../java-config-server.md).
22+
23+
Migrate your configuration by using the following steps:
24+
25+
1. Inside the application's *src/main/resources* directory, create a *bootstrap.yml* file with the following contents:
26+
27+
```yml
28+
spring:
29+
application:
30+
name: <your-application-name>
31+
```
32+
33+
1. In the configuration Git repository, create a *\<your-application-name\>.yml* file, where `your-application-name` is the same as in the preceding step. Move the settings from the *application.yml* file in *src/main/resources* to the new file you created. If the settings were previously in a *.properties* file, convert them to YAML first. You can find online tools or IntelliJ plugins to accomplish this conversion.
34+
35+
1. Create an *application.yml* file in the directory you created. Use this file to define settings and resources shared among all applications in the Azure Container Apps environment, such as data sources, logging settings, and Spring Boot Actuator configuration.
36+
37+
1. Commit and push these changes to the Git repository.
38+
39+
1. Remove the *application.properties* or *application.yml* file from the application.
40+
41+
#### Administration
42+
43+
Consider adding the Admin for Spring managed component to enable an administrative interface for Spring Boot web applications that expose actuator endpoints. For more information, see [Configure the Spring Boot Admin component in Azure Container Apps](../java-admin.md).
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
author: deepganguly
3+
ms.author: deepganguly
4+
ms.service: azure-container-apps
5+
ms.topic: include
6+
ms.date: 03/11/2026
7+
---
8+
9+
Identify any external caches in use. Frequently, you use Redis via Spring Data Redis. For configuration information, see the [Spring Data Redis](https://spring.io/projects/spring-data-redis) documentation.
10+
11+
Determine whether you cache session data via [Spring Session](https://spring.io/projects/spring-session) by searching for the respective configuration (in [Java](https://docs.spring.io/spring-session/reference/3.0/index.html) or [XML](https://docs.spring.io/spring-session/reference/3.0/index.html)).
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
author: deepganguly
3+
ms.author: deepganguly
4+
ms.service: azure-container-apps
5+
ms.topic: include
6+
ms.date: 03/11/2026
7+
---
8+
9+
Document all the certificates used for public SSL endpoints or communication with backend databases and other systems. You can view all certificates on the production servers by running the following command:
10+
11+
```bash
12+
keytool -list -v -keystore <path to keystore>
13+
```
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
author: deepganguly
3+
ms.author: deepganguly
4+
ms.service: azure-container-apps
5+
ms.topic: include
6+
ms.date: 03/11/2026
7+
---
8+
9+
For a Spring Boot application, connection strings typically appear in configuration files when it depends on an external database. Here's an example from an *application.properties* file:
10+
11+
```properties
12+
spring.datasource.url=jdbc:mysql://localhost:3306/mysql_db
13+
spring.datasource.username=dbuser
14+
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
15+
```
16+
17+
Here's an example from an *application.yaml* file:
18+
19+
```yaml
20+
spring:
21+
data:
22+
mongodb:
23+
uri: mongodb://mongouser:[email protected]:27017
24+
```
25+
26+
See Spring Data documentation for more possible configuration scenarios:
27+
28+
- [JPA Repositories](https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#jpa.repositories)
29+
- [JDBC Repositories](https://docs.spring.io/spring-data/jdbc/docs/current/reference/html/#jdbc.repositories)
30+
- [Cassandra Repositories](https://docs.spring.io/spring-data/cassandra/docs/current/reference/html/#cassandra.repositories)
31+
- [MongoDB Repositories](https://docs.spring.io/spring-data/mongodb/docs/current/reference/html/#mongodb.repositories)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
author: deepganguly
3+
ms.author: deepganguly
4+
ms.service: azure-container-apps
5+
ms.topic: include
6+
ms.date: 03/11/2026
7+
---
8+
9+
Identify any instances where your services read from or write to the local file system. Note which files are short-term or temporary and which files are long-lived.
10+
11+
Azure Container Apps offers several types of storage. By using ephemeral storage, you can read and write temporary data within a running container or replica. By using Azure Files, you can provide permanent storage that multiple containers can share. For more information, see [Use storage mounts in Azure Container Apps](../storage-mounts.md).
12+
13+
If your application serves **read-only static content**, consider moving it to Azure Blob Storage and adding Azure CDN for global distribution. For more information, see [Static website hosting in Azure Storage](/azure/storage/blobs/storage-blob-static-website) and [Quickstart: Integrate an Azure storage account with Azure CDN](/azure/cdn/cdn-create-a-storage-account-with-cdn).
14+
15+
If your application handles **dynamically published static content** (uploaded or generated content that doesn't change after creation), you can integrate Azure Blob Storage and Azure CDN. You can also use an Azure Function to manage uploads and trigger CDN refreshes. For a sample implementation, see [Uploading and CDN-preloading static content with Azure Functions](https://github.com/Azure-Samples/functions-java-push-static-contents-to-cdn).
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
author: deepganguly
3+
ms.author: deepganguly
4+
ms.service: azure-container-apps
5+
ms.topic: include
6+
ms.date: 03/11/2026
7+
---
8+
9+
Identify the brokers in use by looking in the build manifest (typically, a *pom.xml* or *build.gradle* file) for the relevant dependencies.
10+
11+
For example, a Spring Boot application that uses ActiveMQ typically contains this dependency in its *pom.xml* file:
12+
13+
```xml
14+
<dependency>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-starter-activemq</artifactId>
17+
</dependency>
18+
```
19+
20+
Spring Boot applications that use commercial brokers typically contain dependencies directly on the brokers' JMS driver libraries. Here's an example from a *build.gradle* file:
21+
22+
```json
23+
dependencies {
24+
...
25+
compile("com.ibm.mq:com.ibm.mq.allclient:9.4.0.5")
26+
...
27+
}
28+
```
29+
30+
After you identify the brokers in use, find the corresponding settings. You typically find them in the *application.properties* and *application.yml* files in the application directory.
31+
32+
> [!NOTE]
33+
> Microsoft recommends using the most secure authentication flow available. The authentication flow described in this procedure, such as for databases, caches, messaging, or AI services, requires a high degree of trust in the application and carries risks not present in other flows. Use this flow only when more secure options, like managed identities for passwordless or keyless connections, aren't viable. For local machine operations, prefer user identities for passwordless or keyless connections.
34+
35+
Here's an ActiveMQ example from an *application.properties* file:
36+
37+
```properties
38+
spring.activemq.brokerurl=broker:(tcp://localhost:61616,network:static:tcp://remotehost:61616)?persistent=false&useJmx=true
39+
spring.activemq.user=admin
40+
spring.activemq.password=<password>
41+
```
42+
43+
For more information on ActiveMQ configuration, see the [Spring Boot messaging documentation](https://docs.spring.io/spring-boot/reference/messaging/index.html).
44+
45+
Here's an IBM MQ example from an *application.yaml* file:
46+
47+
```yaml
48+
ibm:
49+
mq:
50+
queueManager: qm1
51+
channel: dev.ORDERS
52+
connName: localhost(14)
53+
user: admin
54+
password: <password>
55+
```
56+
57+
For more information on IBM MQ configuration, see the [IBM MQ Spring components documentation](https://github.com/ibm-messaging/mq-jms-spring#ibm-mq-jms-spring-components).
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
author: deepganguly
3+
ms.author: deepganguly
4+
ms.service: azure-container-apps
5+
ms.topic: include
6+
ms.date: 03/11/2026
7+
---
8+
9+
<!-- Used by: migrate-spring-boot.md, migrate-spring-cloud-to-azure-container-apps.md, migrate-tomcat.md -->
10+
11+
If your application contains code with dependencies on the host OS, refactor it to remove those dependencies. For example, replace any use of `/` or `\` in file system paths with [`File.Separator`](https://docs.oracle.com/javase/8/docs/api/java/io/File.html#separator) or [`Paths.get`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Paths.html#get-java.lang.String-java.lang.String...-).
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
author: deepganguly
3+
ms.author: deepganguly
4+
ms.service: azure-container-apps
5+
ms.topic: include
6+
ms.date: 03/11/2026
7+
---
8+
9+
<!-- Used by: migrate-spring-boot.md, migrate-spring-cloud-to-azure-container-apps.md -->
10+
11+
If you create your Dockerfile manually and deploy a containerized application to Azure Container Apps, you have full control over your deployment, including JRE/JDK versions.
12+
13+
For deployment from artifacts, Azure Container Apps offers specific versions of Java (8, 11, 17, and 21) and specific versions of Spring Boot and Spring Cloud components. To ensure compatibility, first migrate your application to a supported version of Java in its current environment, then proceed with the remaining migration steps. Fully test the resulting configuration with the latest stable release of your Linux distribution.
14+
15+
> [!NOTE]
16+
> This validation is especially important if your current server runs on an unsupported JDK, such as Oracle JDK or IBM OpenJ9.
17+
18+
To check your current Java version, sign in to your production server and run the following command:
19+
20+
```bash
21+
java -version
22+
```
23+
24+
For supported versions of Java, Spring Boot, and Spring Cloud, see [Java on Azure Container Apps overview](../java-overview.md).

0 commit comments

Comments
 (0)