Java Spring Boot (Part 2)

Deploying from GitHub to Azure

Spring Framework logo by Pivotal Software is licensed under Apache License 2.0

Deploying from GitHub to Azure

I used https://start.spring.io, Visual Studio Code, GitHub and Microsoft Azure to generate an Spring application, to run the Spring application on my laptop and to deploy the Spring application to Microsoft Azure

I created a new GitHub repository (haddley-java) 

I clicked the Open with GitHub Desktop menu item

I used the Open in Visual Studio Code (Insiders) button to open the repository in Visual Studio Code 

I needed some sample code

https://spring.io/quickstart explains how to create a sample project

I logged into the Azure Portal to see what versions of Java were supported

I clicked the Web App Create link

The latest version of Java supported was 17

I navigated to https://start.spring.io/ and updated Group to "com.haddley" and added the Spring Web dependency

I clicked the GENERATE button

I copied the generated file to my local copy of the haddley-java repository

I updated the code to include support for the /hello path and ran using ./mvnw spring-boot:run

Tomcat initialized with port 8080

I navigated to http://localhost:8080/hello

I checked my changes

I clicked Push origin to upload my changes to GitHub

The changes were uploaded

I added an Azure Resource Group (haddley-java-rg)

I selected the Java 17 runtime

I changed the Pricing plan to "Free" and clicked the Next: Deployment button

The Continuous deployment option was disabled so I clicked the Previous button

I selected the Basic B1 pricing plan

I enabled Continuous deployment and clicked the Authorize button

I clicked the Authorize AzureAppService button

I entered an Authorization code

I selected organization Haddley. I selected the haddley-java repository

I selected the main branch

I reviewed the GitHub Actions configuration

I clicked the Create button

I waited

When deployment was complete I clicked the Go to resource button

I reviewed the Web App overview and clicked on the https://haddley-java.azurewebsites.net link

I reviewed the Azure deployed application

I returned to the GitHub repository and reviewed the GitHub Actions workflow history

I reviewed the workflow summary

I reviewed the workflow file

I updated the source code adding a home page

I ran the updated code locally

I accessed the home page at http://localhost:8080

I commited the update (to the main branch)

I pulled changes from the GitHub repository

I pushed my change to GitHub

There were no conflicts/issues

I returned to GitHub and saw that the Merge branch workflow had started

The Merge branch workflow completed with no errors

I navigated to https://haddley-java.azurewebsites.net to view the new home page