Beginner’s Guide to Deploying a Spring Boot App to Azure App Service | Hacker Noon

@dhruveshpatelDhruvesh Patel

Cloud Solution Architect and Cloud-native, hands-on backend Developer

If you are building a Java-based spring boot app, but struggling to deploy app to Azure Cloud, this blog post is for you. It will provide a brief introduction of Azure App Service and App service Plans and a 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 developers 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.

Benefit of  using Azure App Service :

1) Faster time to market to compete in modern digital transformation powered innovation and disruption

2) 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

3) 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.

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

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,

1) Install Azure CLI (Refer link – https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest)

2) Sign in to Azure Portal using below command.

az login
 

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

Once above Pre-requisite steps are completed,

1) 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).

2) Deploy your Java app to Azure using the following command

mvn package azure-webapp:deploy

3) 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.

Also published on: https://dev.to/dhruvesh_patel/how-to-deploy-spring-boot-app-to-azure-app-service-3259

Tags

read original article here