DEV Community

Cover image for How to deploy Spring Boot app to Azure App Service?
Dhruvesh Patel
Dhruvesh Patel

Posted on

How to deploy Spring Boot app to Azure App Service?

If you are building Java based spring boot app, but struggling to deploy app to Azure Cloud? This blog post is for you, It will provide brief introduction of Azure App Service and App service Plans and the step-by-step guide to deploy Java based Spring boot app to Azure App service.

What is Azure App Service?

Azure App Service is a Platform as a Service offering from Microsoft Azure Cloud, which allows developer to focus on developing new business features and not worrying about running and managing the underlying infrastructure. Azure Service Fabric provides the underlying magic for App Service including all good things that comes with cloud - scaling, availability and redundancy.

Azure App Service - Diagram

Benefit of  using Azure App Service :

  • Faster time to market to compete in modern digital transformation powered innovation and disruption
  • Deployment slots are live apps with their own host names. App content and configurations elements can be swapped between two deployment slots, including the production slot. Allows to test deployment in staging before moving to production and then swap staging to be production without additional cost
  • Security is integrated within App Service - offers layered security like Multi-factor authentication (MFA) and other security features like authentication.

App Service Plans:

An App Service Plan is like a container in which your web applications run. it is used to determine the computing resources (CPU, RAM, Cache, disk space, etc.) available to your application.

Following image shows comparison of various App service Plans such as Free/Shared, Basis, Standard, Premium and Isolated & their pricing.

App service Plan - Comparison

Maven Plug-in for Azure App Service:

The Maven Plugin for Azure App Service helps Java developers to deploy Maven projects to Azure App Service.

Pre-requisites before using this maven plug-in,

  • Install Azure CLI ( Refer this link )
  • Sign in to Azure Portal using below command.

az login command

Deploy Spring Boot app (Java based) to Azure App service:

Once above Pre-requisite steps are completed,

  • Using IDE (Eclipse/ IntelliJ) for Spring boot maven project, add azure maven plug-in in pom.xml file.

Typical configuration for Azure Maven plug-in for Java based spring boot app is as below (You can select an existing Azure Web App or create a new one on prompt. Below snippet is for using existing App service Plan and App Service).

Azure App Service - Maven Plugin configuration

  • Deploy your Java app to Azure using the following command

Azure App Service - maven deploy

  • Finally, Navigate to Azure Portal -> Resource Group -> App Service which was used to deploy Java application and verify the App is running.

Conclusion

Azure App Service provides fully managed platform for building, deploying and scaling your web apps - Platform-as-a-Service. It greatly speeds up deployment of Spring boot based Java application to Azure App Service.

Happy coding !

Please like, share and comment your views/ opinion.

Disclaimer - This post is my personal opinion and does not reflect those of any of my past, present or future employers or affiliations.

Top comments (10)

Collapse
 
shreya1310 profile image
Shreya1310 • Edited

This is very helpful article for deploying my Spring boot application to Azure!!! Keep posting this types of Articles buddy

Collapse
 
dhruvesh_patel profile image
Dhruvesh Patel

Happy to help.

Collapse
 
prabhat36539454 profile image
Prabhat Kumar

This helped in understanding how to deploy Spring Boot app to Azure App Service.
Thanks

Collapse
 
dhruvesh_patel profile image
Dhruvesh Patel

Happy to help.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.