Skip to content

Commit 28575ed

Browse files
dingmeng-xueKarlErickson
authored andcommitted
Migrate Spring Apps to Azure Container Apps
1 parent ac10f26 commit 28575ed

File tree

37 files changed

+425
-569
lines changed

37 files changed

+425
-569
lines changed

articles/java/.openpublishing.redirection.java.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@
183183
"redirect_url": "/azure/developer/java/migration/index"
184184
},
185185
{
186-
"source_path": "migration/migrate-spring-boot-to-azure-container-apps.md",
186+
"source_path": "migration/migrate-spring-boot-to-azure-spring-apps.md",
187+
"redirect_url": "/azure/developer/java/migration/index"
188+
},
189+
{
190+
"source_path": "migration/migrate-spring-cloud-to-azure-spring-apps.md",
187191
"redirect_url": "/azure/developer/java/migration/index"
188192
},
189193
{

articles/java/identity/deploy-spring-boot-to-azure-spring-apps.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,4 @@ This article assumes that you completed one of the following articles using only
7171

7272
For more information and other deployment options, see the following articles:
7373

74-
- [Quickstart: Deploy your first application to Azure Spring Apps](/azure/spring-apps/enterprise/quickstart?tabs=Azure-portal%2CAzure-portal-maven-plugin-ent%2CConsumption-workload&pivots=sc-enterprise)
75-
- [Spring Boot to Azure Spring Apps](../migration/migrate-spring-boot-to-azure-spring-apps.md)
74+
- [Quickstart: Deploy your first application to Azure Spring Apps](/azure/spring-apps/enterprise/quickstart?tabs=Azure-portal%2CAzure-portal-maven-plugin-ent%2CConsumption-workload&pivots=sc-enterprise)

articles/java/index.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ conceptualContent:
9999

100100
- title: Migrate to Azure
101101
links:
102-
- text: Spring to Azure Spring Apps
102+
- text: Spring to Azure Container Apps
103103
itemType: how-to-guide
104-
url: migration/migrate-spring-boot-to-azure-spring-apps.md
104+
url: migration/migrate-spring-boot-to-azure-container-apps.md
105105
- text: Tomcat to Azure App Service
106106
itemType: how-to-guide
107107
url: migration/migrate-tomcat-to-tomcat-app-service.md

articles/java/java-zone-pivot-groups.yml

-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
# YamlMime:ZonePivotGroups
22
groups:
3-
# Owner: karler
4-
- id: spring-cloud-tier-selection
5-
title: Azure Spring Apps tier
6-
prompt: Select an Azure Spring Apps tier
7-
pivots:
8-
- id: sc-standard-tier
9-
title: Standard tier
10-
- id: sc-enterprise-tier
11-
title: Enterprise tier
123
# Owner: v-yeyonghui
134
- id: passwordless-mysql
145
title: Azure Database for MySQL use passwordless connection
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
author: KarlErickson
3+
ms.author: karler
4+
ms.date: 4/15/2020
5+
---
6+
7+
### Configure persistent storage
8+
9+
If any part of your application reads or writes to the local file system, you'll need to configure persistent storage to replace the local file system. You can specify the path to mount in the container through the app settings and align it with the path your app is using. For more information, see [Use storage mounts in Azure Container Apps](/azure/container-apps/storage-mounts).

articles/java/migration/includes/configure-persistent-storage-azure-spring-apps.md

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
author: KarlErickson
3+
ms.author: karler
4+
ms.date: 5/26/2020
5+
---
6+
7+
#### Determine whether and how the file system is used
8+
9+
Find any instances where your services write to and/or read from the local file system. Identify where short-term/temporary files are written and read and where long-lived files are written and read.
10+
11+
Azure Container Apps offer several types of storage. Ephemeral storage can read and write temporary data and be available to a running container or replica. Azure File provides permanent storage and can be shared across multiple containers. For more information, see [Use storage mounts in Azure Container Apps](/azure/container-apps/storage-mounts)
12+
13+
##### Read-only static content
14+
15+
If your application currently serves static content, you need an alternate location for it. You may wish to consider moving static content to Azure Blob Storage and adding Azure CDN for lightning-fast downloads globally. 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).
16+
17+
##### Dynamically published static content
18+
19+
If your application supports static content, whether uploaded or generated by the application itself, that remains unchanged after its creation, you can integrate Azure Blob Storage and Azure CDN. Additionally, you can use an Azure Function to manage uploads and trigger CDN refreshes when necessary. We've provided a sample implementation for your use at [Uploading and CDN-preloading static content with Azure Functions](https://github.com/Azure-Samples/functions-java-push-static-contents-to-cdn).

articles/java/migration/includes/determine-whether-and-how-the-file-system-is-used-azure-spring-apps.md

-22
This file was deleted.

articles/java/migration/includes/determine-whether-your-application-contains-os-specific-code-no-title.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ ms.author: edburns
44
ms.date: 1/21/2020
55
---
66

7-
If your application contains any code with dependencies on the host OS, then you'll need to refactor it to remove those dependencies. For example, you may need to 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...-).
7+
If your application contains any code with dependencies on the host OS, then you need to refactor it to remove those dependencies. For example, you may need to 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...-) if your application is running on Windows.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
author: KarlErickson
3+
ms.author: karler
4+
ms.date: 7/21/2020
5+
---
6+
7+
#### Determine whether your application relies on scheduled jobs
8+
9+
Ephemeral application such as Unix cron jobs or short-live applications based on Spring Batch framework should run as a job on Azure Container Apps. For details, see [Jobs in Azure Container Apps](/azure/container-apps/jobs). If your application is a long-running application and executes tasks regularly using a scheduling framework such as Quartz or Spring Batch, Azure Container Apps can host that application. However, the application must handle scaling appropriately to avoid race conditions where the same application instances are executed more than once per scheduled period during scale-out or rolling upgrade.
10+
11+
Inventory any scheduled tasks running on the production servers, inside or outside your application code.

articles/java/migration/includes/determine-whether-your-application-relies-on-scheduled-jobs-azure-spring-apps.md

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
author: KarlErickson
3+
ms.author: karler
4+
ms.date: 4/15/2020
5+
---
6+
7+
### Ensure console logging and configure diagnostic settings
8+
9+
Configure your logging to ensure that all output is routed to the console rather than to files.
10+
11+
Once an application is deployed to Azure Container Apps, you can configure the logging options within your Container Apps environment to define one or more destinations of the logs. These destinations can include Azure Monitor Log Analytics, Azure Event hub, or even other third-party monitoring solutions. Additionally, you have the option to disable log data and view logs only at runtime. For detailed configuration instruction, see [Log storage and monitoring options in Azure Container Apps](/azure/container-apps/log-options).

articles/java/migration/includes/ensure-console-logging-and-configure-diagnostic-settings-azure-spring-apps.md

-19
This file was deleted.

articles/java/migration/includes/identify-jms-brokers-in-spring.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Spring Boot applications using commercial brokers typically contain dependencies
2222
```json
2323
dependencies {
2424
...
25-
compile("com.ibm.mq:com.ibm.mq.allclient:9.0.4.0")
25+
compile("com.ibm.mq:com.ibm.mq.allclient:9.4.0.5")
2626
...
2727
}
2828
```

articles/java/migration/includes/identify-local-state-azure-spring-apps.md renamed to articles/java/migration/includes/identify-local-state-azure-container-apps.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ On PaaS environments, no application is guaranteed to be running exactly once at
1111
* The application must be relocated to a physical host due to failure or system update.
1212
* The application is being updated.
1313

14-
In any of these cases, the original instance will remain running until the new instance has finished starting up. This has the following potentially significant implications for your application:
14+
In any of these cases, the original instance remains running until the new instance has finished starting up. This pattern can have the following potentially significant implications for your application:
1515

1616
* No [singleton](https://en.wikipedia.org/wiki/Singleton_pattern) can be guaranteed to be truly single.
17-
* Any data that has not been persisted to outside storage will likely be lost far sooner than it would on a single physical server or VM.
17+
* Any data not persisted to outside storage will likely be lost sooner than it would be on a single physical server or VM.
1818

19-
Before migrating to Azure Spring Apps, ensure that your code does not contain local state that must not be lost or duplicated. If local state exists, change the code to store that state outside the application. Cloud-ready applications typically store application state in locations such as the following:
19+
Before migrating to Azure Container Apps, ensure that your code doesn't contain local state that must not be lost or duplicated. If local state exists, change the code to store that state outside the application. Cloud-ready applications typically store application state in locations such as the following options:
2020

2121
* [Azure Cache for Redis](/azure/azure-cache-for-redis/cache-java-get-started)
2222
* [Azure Cosmos DB](/azure/cosmos-db/create-sql-api-java)
2323
* Another external database, such as [Azure SQL](/azure/azure-sql/azure-sql-iaas-vs-paas-what-is-overview), [Azure Database for MySQL](/azure/mysql/overview), or [Azure Database for PostgreSQL](/azure/postgresql/overview).
24+
* [Azure Storage](/azure/storage/blobs), used for storing unstructured data or even serialized objects.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
author: KarlErickson
3+
ms.author: karler
4+
ms.date: 4/15/2020
5+
---
6+
7+
#### Identify log aggregation solutions
8+
9+
Identify any log aggregation solutions in use by the applications you're migrating. You need to configure diagnostic settings in migration to make logged events available for consumption. For more information, see [Ensure console logging and configure diagnostic settings](#ensure-console-logging-and-configure-diagnostic-settings) section.
10+
11+
#### Identify application performance management (APM) agents
12+
13+
Identify any application performance management agents used by your applications. Azure Containers Apps doesn't offer built-in support for APM integration. You need to prepare your container image or integrate APM tool directly into your code. If the application doesn't use a supported APM, consider using Application Insights. For more information, see the [Migration](#configure-application-performance-management-apm-integrations) section.

articles/java/migration/includes/identify-logs-metrics-apm-azure-spring-apps.md

-13
This file was deleted.

articles/java/migration/includes/identify-spring-boot-versions.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ In Maven projects, the Spring Boot version is typically found in the `<parent>`
1616
<parent>
1717
<groupId>org.springframework.boot</groupId>
1818
<artifactId>spring-boot-starter-parent</artifactId>
19-
<version>2.7.10</version>
19+
<version>3.3.3</version>
2020
<relativePath/> <!-- lookup parent from repository -->
2121
</parent>
2222
```
@@ -27,8 +27,8 @@ In Gradle projects, the Spring Boot version will typically be found in the `plug
2727

2828
```gradle
2929
plugins {
30-
id 'org.springframework.boot' version '2.7.10'
31-
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
30+
id 'org.springframework.boot' version '3.3.3'
31+
id 'io.spring.dependency-management' version '1.1.6'
3232
id 'java'
3333
}
3434
```

articles/java/migration/includes/inventory-configuration-sources-and-secrets-spring-cloud.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.date: 09/09/2024
88

99
#### Inventory passwords and secure strings
1010

11-
Check all properties and configuration files and all environment variables on the production deployment(s) for any secret strings and passwords. In a Spring Cloud application, you can typically find such strings in the *application.properties* or *application.yml* file in individual services or in the Spring Cloud Config repository.
11+
Check all properties and configuration files and all environment variables on the production deployments for any secret strings and passwords. In a Spring Cloud application, you can typically find such strings in the *application.properties* or *application.yml* file in individual services or in the Spring Cloud Config repository.
1212

1313
[!INCLUDE [inventory-certificates-h4](inventory-certificates-h4.md)]
1414

@@ -18,13 +18,11 @@ If you use Spring Cloud Vault to store and access secrets, identify the backing
1818

1919
#### Locate the configuration server source
2020

21-
If your application uses a [Spring Cloud Config server](https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#_spring_cloud_config_server), identify where the configuration is stored. You'll typically find this setting in the *bootstrap.yml* or *bootstrap.properties* file, or sometimes in the *application.yml* or *application.properties* file. The setting will look like the following example:
21+
If your application uses a [Spring Cloud Config server](https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#_spring_cloud_config_server), identify where the configuration is stored. You typically find this setting in the *bootstrap.yml* or *bootstrap.properties* file, or sometimes in the *application.yml* or *application.properties* file. The setting looks like the following example:
2222

2323
```properties
2424
spring.cloud.config.server.git.uri: file://${user.home}/spring-cloud-config-repo
2525
```
2626

2727
While git is most commonly used as Spring Cloud Config's backing datastore, as shown earlier, one of the other possible backends may be in use. Consult the [Spring Cloud Config documentation](https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#_environment_repository) for information on other backends, such as [Relational Database (JDBC)](https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#_jdbc_backend), [SVN](https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#_version_control_backend_filesystem_use), and [the local file system](https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#_file_system_backend).
2828

29-
> [!NOTE]
30-
> If your configuration server data is stored on premises, such as GitHub Enterprise, you'll need to make it available to Azure Spring Apps via a Git repository.

articles/java/migration/includes/inventory-databases-spring-boot.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ ms.date: 2/12/2020
66

77
#### Databases
88

9-
For any SQL database, identify the connection string.
10-
11-
For a Spring Boot application, connection strings typically appear in configuration files.
12-
13-
Here's an example from an *application.properties* file:
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:
1410

1511
```properties
1612
spring.datasource.url=jdbc:mysql://localhost:3306/mysql_db

0 commit comments

Comments
 (0)