Table of contents
1.
Introduction
2.
Spring Boot Application to Azure Spring Apps
3.
Pre-Migration
3.1.
Examine the Application's Components
3.1.1.
Identify the local state of the Application 
3.1.2.
Check the file system
3.1.3.
Handle OS-specific codes
3.1.4.
Migrate to the supported Java version in the current environment
3.1.5.
Obtain the Spring Boot Version
3.1.6.
Maven Projects
3.1.7.
Gradle Projects
3.1.8.
Review log aggregation solution
3.1.9.
Identify APM agents
3.2.
List External resources 
3.2.1.
Databases
3.2.2.
JMS message brokers
3.2.3.
External Caches
3.2.4.
Identity and Authorization 
3.2.5.
Find any clients using a non-standard port
3.3.
All other remaining External Resources
3.4.
List the configuration sources
3.4.1.
List passwords or secret strings
3.4.2.
List Certificates 
3.5.
Look over the deployment architecture
3.5.1.
For each Service, document the hardware requirements
3.5.2.
Document distribution/geo-replication
4.
Migration 
4.1.
Create an Azure Spring Apps Instance
4.2.
Make sure console logging is enabled and set up diagnostics
4.3.
Configure Persistent Storage
4.4.
Migrate all certificates to KeyVault
4.5.
Remove APM integrations
4.6.
Disable Metrics Clients and Endpoints
4.7.
Deploy on Azure Spring Apps
4.8.
Setup Externalised Settings and per-service secrets
4.9.
Migrate and enable the identity provider
4.10.
Make your Application Public
5.
Post-migration
6.
Interview Preparation
7.
Frequently Asked Questions
7.1.
What is Microsoft Azure?
7.2.
What is Azure Kubernetes Services?
7.3.
What are Azure Spring Apps?
7.4.
How do you handle OS-specific codes when migrating from Spring boot application to Azure Spring Apps?
7.5.
How can you find the external resources in the spring boot application?
8.
Conclusion
Last Updated: Aug 13, 2025

Spring Boot Application to Azure Spring Apps

Author Teesha Goyal
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Azure Spring apps were formerly known as Azure Spring Cloud services. It is an open-source platform to integrate spring with Azure services. It is easy to use as it requires menial code changes and a few configuration lines. 

This article will discuss migrating a Spring Boot application to Azure Spring Apps.

Also, Check our Spring Boot Course and gain in-depth knowledge and career-advancing skill

Spring Boot Application to Azure Spring Apps

Moving an existing Spring boot application to the Azure spring app requires specific steps divided into three stages. They are:

  • Pre-migration
  • Migration
  • Post-migration

Some steps under the pre-migration, migration, and post-migration phases are necessary to move a spring boot application to run on Azure Spring Apps. Now, we will discuss each of these phases in detail.

Pre-Migration

Before we start migrating Spring Boot applications to Azure Spring apps, some essential things must be checked and taken care of. Such steps come under the pre-migration phase. 

Examine the Application's Components

The most important thing to do at the beginning of migrating an existing spring boot application to Azure Spring Apps is to inspect/examine the application's components. 

Identify the local state of the Application 

On a platform as a service, no application is guaranteed to be running exactly once at any given time. Even if it is a single instance, if a system failure occurs or any situation arises where the data is shifted from one location to another, then an instance keeps on running until another instance is completely started to run. 

When one instance ends and another one begins running, there is a potential that some data will be lost. The data stored or present in the local state will be lost. You have to ensure your code doesn't contain any local state that needs to be preserved or avoid duplication before switching to Azure Spring Apps. If a local state is present, modify the code to store it externally to the application. There are a few cloud-ready platforms that can be used to serve the same. Some of them are Azure Cache for Redis, Azure CosmosDB, Azure SQL, etc.

Check the file system

When we migrate the spring boot application to Azure Spring Apps, it becomes vital to reconfigure the file system being used. In rare cases, we may also require changing the file system's architecture. That is why it becomes necessary to determine whether and how the file system is used. We need to know where the short-term lived files are stored and where the long-term lived files are stored. 

A spring boot application can be static or dynamic, and the approach to handle both situations is different. Following are the two situations regarding file system management:

  • Static Content: If your application is static and has only static content, then it is easier to handle the file system; you just have to change the location of the data. You can move the content to Azure Blob Storage and add Azure CDN. By adding Azure CDN, you can ensure that your site provides high-speed downloading globally. 
     
  • Static Content published dynamically: If your applications allow dynamically publishing or uploading data in a static manner, it cannot be modified after creation.  Azure Blob storage and Azure CDN can be used. An Azure function handles uploads and CDN refresh. 

 

Handle OS-specific codes

If your application contains OS-specific codes that have dependencies on the host OS, it becomes crucial to remove these dependencies. One such way is by removing the / or \ symbols with paths.get or File.Separator in the file system. 

Migrate to the supported Java version in the current environment

It is crucial to validate that our application works correctly on the supported java version. Various Java versions are available; it is good to first find the best-suited java version in the current environment and then migrate to Azure Spring apps. It becomes more critical when we are dealing with unsupported JDK. 

To check the java version used in your application, you can run the following command in your production server.

java -version

 

Obtain the Spring Boot Version

It is also essential to determine the spring boot version before migrating a Spring Boot Application to Azure Spring Apps. To do so, we have to find the migrated application's spring boot version—the method to find the spring boot version is different in Maven and Gradle Projects.

Maven Projects

The spring boot version is in the <parent> element of the project object model file.

Following is an example of <parent> element of the POM file:

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.4.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository →
</parent>

 

Gradle Projects

The spring boot version in Gradle projects is found in the plugins section. Inside the plugins sections, you will find two different versions; the spring boot version is the one found by the id name of org.springframework.boot.

Following is an example of plugins section in the POM file:

plugins {
  id 'org.springframework.boot' version '1.3.7.RELEASE'
  id 'io.spring.dependency-management' version '1.1.6.RELEASE'
  id 'java'
}

 

Review log aggregation solution

Check whether and what log aggregation solutions are present in the application you want to migrate. 

Identify APM agents

Determine the APM (application performance management) agents associated with your project/application. Azure Spring Apps provides strong integration with Azure Monitor and real-time response to aberrations.  

List External resources 

Identify all the external resources associated with your application. Such resources can be JMS message brokers, data sources, and URLs of other services. You can go to the src/main/directory folder to find the external resources in the spring boot application. Inside this folder, you can look for application.properties or application.yml file containing the external resources associated with your application. 

Databases

You must identify the connection string for any SQL database integrated with your application. It is typically found in the configuration files. There are two files in the src/main/directory folder: application.properties and application.yml file. 

JMS message brokers

Another external resource to be identified is JSM message brokers. You can look in the build manifest to find the brokers in your application. Two files contain this information; they are pom.xml or build.gradle file.

Following is an example of finding a broker in pom.xml file:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-activemq</artifactId>
</dependency>

 

Following is an example of finding commercial brokers in build.gradle file:

dependencies {
      ...
      compile("com.ibm.mq:com.ibm.mq.allclient:9.0.4.0")
      ...
    }

 

The next step is to find the corresponding settings. It can be found in the application.properties and application.yml files.  

Following is an example of IBM MQ from application.yaml file:

ibm:
  mq:
    queueManager: qm1
    channel: dev.ORDERS
    connName: localhost(14)
    user: admin
    password: big$ecr3t

 

External Caches

Yet another external resource is the external cache. You need to identify the external cache in use by your application beforehand. Redis is used through Spring Data Redis. Search for the relevant configuration to determine whether Session data is cached through Spring Session.

Identity and Authorization 

Identify whether your spring boot application requires authentication and authorization. Also, identify all the identity providers. 

Following are the resources you can use to understand how to configure different identity providers:

 

Find any clients using a non-standard port

The server.port property in the deployed application is overridden by Azure Spring Apps. You must change any clients of the clients who depend on the application being accessible on a port other than 443 if they do.

All other remaining External Resources

There are a lot of external dependencies, and it is not possible to mention every single one of them. Your responsibility is to look out for your application and handle each external dependency explicitly and carefully. 

List the configuration sources

List passwords or secret strings

Check the application.properties or application.yml file for any secret strings or passwords inside your application. You must check the configurations, properties, and environment variables for any passwords or secret strings.

List Certificates 

Record every certificate for communication with backend databases and other systems or with public SSL endpoints. To view the list of all certificates on the production server(s), you can run the following command:

keytool -list -v -keystore <path to keystore>

 

Look over the deployment architecture

For each Service, document the hardware requirements

Document the following hardware requirements for your application before moving it to Azure Spring Apps:

  • Count of running instances.
  • Count of CPUs allocated to each instance.
  • Amount of RAM assigned to each instance.

 

Document distribution/geo-replication

Find out if the instances of your Spring Boot application are currently dispersed across several locations or data centers. Record the SLA and uptime requirements for the migrating application.

Migration 

Now that you have done the pre-migration procedures and understand all the essential factors, it’s time to move ahead with the migration process of the spring boot application to Azure Spring Apps. All the information collected earlier will be handy when moving the application.

Create an Azure Spring Apps Instance

The first thing you need to do in Azure Spring Apps is to create an instance under your Azure subscription if you don't already have one. Next, you need to create applications inside your Azure Spring Apps instance. 

Make sure console logging is enabled and set up diagnostics

You must configure the console logging to log in to the console and not the files directly. Add diagnostics settings once an application is deployed on Azure Spring Apps to monitor the log events. 

You can use one of the two log aggregation:

  • LogStash/ELK Stack
  • Splunk

Configure Persistent Storage

If your application requires persistent non-volatile storage, you must configure the Azure Persistent Volumes. The persistent volume can be provisioned statically and dynamically as per the needs. In case of any read and write operations to the local state, you must move the data to persistent volumes; otherwise, you can lose it.

To ensure that the temporary data is not lost, you should move the temporary files to the /tmp directory.

Migrate all certificates to KeyVault

You have to migrate all the certificates listed in the pre-migration stage to KeyVault because Azure Spring Apps does not provide access to the JRE Keystore. You will also need to change the application code to be able to access certificates in KeyVault.

Remove APM integrations

You must eliminate any integrations with APM (application performance management) agents associated with your application. 

Disable Metrics Clients and Endpoints

If your application has metric clients or metric endpoints, you need to disable them.

Deploy on Azure Spring Apps

Deploy your application to the Azure Spring Apps. You must deploy each migrated microservices except for the Spring Cloud Config and Registry servers.

Setup Externalised Settings and per-service secrets

To set up externalized settings and per-service secrets, you must have Azure Portal. Following the below steps on the Azure portal to do so:

  • Go to the Azure Spring Apps Instance and click on Apps.
  • Select the service you want to configure.
  • Click Configuration.
  • Enter the variable you want to configure
  • Click Save.

 

Migrate and enable the identity provider

Use the inventory created in the pre-migration stage and ensure that all the authorization and authentication services are configured per the requirements. 

Make your Application Public

Expose your application to everyone. By default, the applications on Azure Spring Apps are not available externally, but you can run the following commands and expose your application.

The following command will make your application public.

az spring-cloud app update -n <application_name> --is-public true

 

If you are using Spring Cloud Gateway, then you can ignore this step.

Post-migration

You are done with the migration part. You have completed your spring boot application migration to Azure Spring Apps. You must ensure that the application works as expected by monitoring and maintaining the application. We have provided some suggestions you can apply to your application to ensure smooth working.  

  • As the applications are by default not available externally, you are required to make them public. Instead of doing this, you can use Spring Cloud gateway. There are certain advantages of using the Spring Cloud gateway. For example, Each application installed in your Azure Spring Apps instance has a single endpoint.
     
  • For automatic, dependable deployments, take into account building a deployment pipeline.
     
  • Consider adding an Azure Application Gateway to offer SSL offloading and a Web Application Firewall with DDoS protection if geo-replication is not required.
     
  • Consider activating Spring Cloud Registry support for your application. By doing this, other deployed Spring apps and clients can dynamically discover your application.

Interview Preparation

Do check out our YouTube video to Ace your DSA interview

In this video, our experts have discussed the best ways to do well in Data structures and algorithm interviews. 

Data structures is one of the most favorite topics of interviewers and if you have mentioned it in your resume or introduction then it is important to also back it up with your answers. 

Frequently Asked Questions

What is Microsoft Azure?

Microsoft Azure is a leading cloud platform that lets you access the cloud services and resources provided by Microsoft. It provides various services, including computation, storage, analytics, and networking. 

What is Azure Kubernetes Services?

Azure Kubernetes Service(AKS) is a fully managed container management service. It ensures container orchestration. It is provided by Microsoft Azure which is the leading cloud service provider. 

What are Azure Spring Apps?

Azure Spring apps were formerly known as Azure Spring Cloud services. It is an open-source platform to integrate spring with Azure services. It is easy to use as it requires menial code changes and a few configuration lines. 

How do you handle OS-specific codes when migrating from Spring boot application to Azure Spring Apps?

If your application contains OS-specific codes that have dependencies on the host OS, it becomes crucial to remove these dependencies. One such way is by removing the / or \ symbols with paths.get or File.Separator in the file system.  

How can you find the external resources in the spring boot application?

To find the external resources in the spring boot application, you can go to the src/main/directory folder, and inside this folder, you can look for application.properties or application.yml file that contains the external resources associated with your application. 

Conclusion

This article discussed migrating a Spring Boot application to Azure Spring Apps. We discussed in detail the pre-migration, migration, and post-migrations steps to migrate your spring boot application to Azure Spring Apps. 

Must Read Spring Tool Suite and STS Download.

I hope you would have gained a better understanding of these topics now! Are you planning to ace the interviews of reputed product-based companies like AmazonGoogleMicrosoft, and more? 

Happy Coding!

Live masterclass