[NoBrainer] Deploy a Spring Boot Application to an Azure App Service

After my technology switch from Java to C#/.NET about seven years ago, I still tried to stay in touch with Java and spring – at least a little bit. Back in 2015 I therefore started implementing a small spring boot based web application in Java that consumes the REST API of the swiss floorball association and generates PDF game schedules (GitHub repository can be found here). The last few years I hosted the application on a free Heroku Dyno. Now as Heroku announced to stop the free Heroku Dynos and because I didn’t want to go for a Heroku paid plan, I decided to move my application to my Azure tenant.

Spoiler: Creating the Azure resources took longer than setting up the automated deployment.

For moving my application to Azure, I proceeded as follows:

  1. Login to the Azure portal
  2. Switch to the tenant you want to work in
  3. Ensure that the selected tenant has at least one subscription
  4. Create a new resource group
  5. Create a new app service plan in the before created resource group
    • Operating system: Linux
  6. Create a new web app
    Configure the web app as follows:
    • Publish: Code
    • Runtime stack: select the desired Java version
    • Java web server stack: Java SE (Embedded Web Server)
    • Operating system: Linux
    • Linux Plan: select before created app service plan

When I continued to the Deployment tab of the web app creation wizard, I was again impressed by Azure – especially from the support in setting up automated deployments. I just enabled Continuous deployment option, selected the GitHub organization, repository and branch and during creation of the web app (Azure App Service) resource, a GitHub Actions workflow got set up by Azure that automatically builds and deploys the Java spring boot application to the corresponding Azure App Service on every commit to the selected branch!

Create Web App wizard – Deployment tab

The GitHub Actions workflow that gets added to the selected branch of the specified repository during resource creation can be inspected by clicking on Preview file button:

GitHub Actions workflow configuration

It was amazingly easy to deploy my Java application to Azure and the support from the Azure Portal was just terrific.

There is an alternative service provided by Azure called Azure Spring Apps. I didn’t consider that service since the prices are quite a bit higher compared to Azure App Services.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Website Powered by WordPress.com.

Up ↑

%d bloggers like this: