Deploy the Spring Boot web app to Azure App Service.
Deploy what you created as a Spring starter project in Eclipse + Gradle.
-Match the Tomcat and Java versions with the web application. -If the OS is Windows, it is convenient because the App Service Editor can be used.
Create a Deployable War File https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-create-a-deployable-war-file
Create a deployable war file according to the above procedure.
Make the class with @SpringBootApplication
inheritSpringBootServletInitializer
.
Also, add the war plugin to build.gradle and set Tomcat to providedRuntime
.
build.gradle
apply plugin: 'war'
dependencies {
//Don't include tomcat in war
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
}
Execute the'bootWar' task and create a war file.
Easy with the App Service Editor. App Service Editor is a tool that allows you to directly edit files on App Service with a GUI like Visual Studio Code. It can be used only when the OS of App Service is Windows.
If there is already a ROOT folder, delete it.
Drag and drop the created WAR file to the Explorer part of the App Service Editor and upload it.
You can also upload by right-clicking in the upload destination folder or in the margin of Explorer → "Upload File". After waiting for a while, the WAR file will be expanded.
Spring Boot Deployment On Azure App Service — Zero Code Approach https://medium.com/@k32y/spring-boot-deployment-on-azure-app-service-zero-code-approach-88305c8d0818
Recommended Posts