10

I would like to know if it's possible to deploy a spring boot application with MySQL database to the azure cloud. I couldn't find any instructions or tutorials.

Daniel Pinkpank
  • 350
  • 1
  • 6
  • 18
  • Here is you can find detail steps : -- **- https://stackoverflow.com/questions/47700526/deploy-spring-boot-jar-on-azure-app-service/50557789#50557789** – vaquar khan Jun 04 '18 at 19:14

4 Answers4

5

Yes;

  • Create the web-app on the azure portal (tomcat or Jetty) (info)

  • create the war file from spring boot using your gradle/maven build scripts (info)

  • upload to Azure using the FTP options (info) & this

And you are done - it will be served on the default URL..

Community
  • 1
  • 1
Mannie
  • 1,608
  • 1
  • 21
  • 33
3

In additional to general information about java web apps, there's some Spring Boot-specific info in the Azure documentation:

https://azure.microsoft.com/en-us/documentation/articles/web-sites-java-custom-upload/#springboot

In order to get a Springboot application running you need to upload your JAR or WAR file and add the following web.config file. The web.config file goes into the wwwroot folder. In the web.config adjust the arguments to point to your JAR file, in the following example the JAR file is located in the wwwroot folder as well.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
    </handlers>
    <httpPlatform processPath="%JAVA_HOME%\bin\java.exe"
        arguments="-Djava.net.preferIPv4Stack=true -Dserver.port=%HTTP_PLATFORM_PORT% -jar &quot;%HOME%\site\wwwroot\my-web-project.jar&quot;">
    </httpPlatform>
  </system.webServer>
</configuration> 
herman
  • 11,740
  • 5
  • 47
  • 58
1

This worked for me with an Azure API-App:

  • Create the API-App in Azure
  • Create the war file from Spring Tool Suite (File -> Export -> Web -> War-File) or via maven build
  • Name the war file "ROOT.war"
  • Put it in a folder "webapps"
  • Push the webapps-folder and the containing war to a git repository
  • Add the git repository to the Api-App Deployment Options in Azure

If the App is setup correctly (correct Java and Tomcat version selected), the war should be extracted automatically.

Additionally you can add a web.config file (parallel to the webapps folder), for more configuration options.

If the ROOT.war is not extracted, try removing the existing ROOT folder.

Max 23
  • 183
  • 9
0

If you are looking at general Azure IAAS (Infrastructure as a service) part, then this question should not arise, since it is as good as any other IAAS offerring from other cloud service providers like Amazon. It can pretty much run anything, and yes, including Spring boot applications

If you are talking about a micro-service based hosting through Service fabric, question will be interesting, since Service fabric in itself provides the micro service hosting part and a plug and play there will be interesting.

Anoop Halgeri
  • 662
  • 3
  • 8
  • 17