How to deploy spring boot application with azure app service?

2 min readAug 15, 2020


In the last article we have created the MySQL server and configured it. Let’s see how to configure the azure MySQL server in our spring boot app and deploy it on azure cloud with azure web app service.

First let’s see about What is azure app services?

Azure App Service is a HTTP-based service for hosting web applications, REST APIs, and mobile back ends. You can develop in your preferred language, be it Java, Ruby, Node.js, PHP, .NET, .NET Core,or Python. Applications run and scale with ease on both Windows and Linux based environments.

some key features of App Service:

Multiple languages and frameworks support

Security and compliance

Managed production environment

Serverless code

Visual Studio and Visual Studio Code integration

Let’s go to the deployment…….

I’m going to deploy my spring boot application as .jar in java runtime.

  1. In our sample project we have to do some configurations in file.

Replace the values for yourMySQLHost, yourMySQLServerName, yourMySQLServer password with your MySQL server values.And replace the database name also.

2. Next we have to configure our spring boot application to integrate with azure. Copy the below code and change the resource group name and app name with your respective values and add to pom.xml file under plugins configurations.

<!-- Begin of App Settings -->
<!-- End of App Settings -->

You can change also region and pricingTier according to your preferrence.

3. After configuration we have to build the jar file and deploy it to the Azure. Open terminal and execute mvn clean package to build jar file for deploy.

4.After successful build we are ready to deploy our web app to Azure. Excecute mvn azure-webapp:deploy command in terminal.Maven will deploy your web app to the Azure, if the web app or web app plan does not already exist, it will be created for you.

5.After the successful deployment you can find the deployed web app under the resources in azure portal. Once you click on the deployed web app you can see the details and the url . When you navigate to the url you can see your deployed app is running.

Next topic:.Configuring Azure Redis Cache to boost Spring Boot performance