question

BoopathyElango-7282 avatar image
0 Votes"
BoopathyElango-7282 asked ·

Azure web apps spring boot not deployed

Hi

I have created a sample spring boot application and try to deploy using Azure App service.
I have used Github for source code and Kudu script for auto deployment into Azure platform. I have chosen Java 8 and Tomcat 8.5 as my platform.

When i started the deployment, Script ran successfully and deployed the app. But all my code was not in Webapps folder. What I presumed , it will place jar/war file into Webapps folder. But all my files are residing inside a folder: "/home/site/repository"

I also pasted the snapshot for your reference. Kindly have a look,

8744-capture-4.jpg


azure-webapps
capture-4.jpg (104.3 KiB)
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JoaquinVano avatar image
0 Votes"
JoaquinVano answered ·

Are you using GitHub actions? Here we have more info about github actions for building java web apps and publishing to Azure App Service:
https://azure.github.io/AppService/2019/08/10/Github-actions-for-webapps.html#java

If you are trying to build the java Web App using kudu, we don't have the JDK in Kudu and we recommend to try GitHub actions instead.

· 4 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@JoaquinVano ,

I have used Github actions and try to deploy java web apps and publishing to Azure App Service. Github actions pipeline script was successfully executed ,build and deployed the spring boot app.

However it was not running. It has been not published into Webapps folder. I have attached screenshot for more reference.

8708-capture-5.jpg


0 Votes 0 ·
capture-5.jpg (252.6 KiB)

You don't need to have it in the /webapps folder. /webapps folder is only used for Tomcat deployments.

Since you are deploying an executable jar, please make sure your Azure App Service Web App has "Java SE" configured as the stack under "General settings" from the "Configuration" menu option. There are two "Java SE" options, one for "Java 8" and another for "Java 11".

Having your jar with name "app.jar" is perfect, since we will automatically call it. If your jar has a different name, please add a startup.sh under /site/wwwroot and add your java command launch your Java app.

I recommend to delete all the content in your /site/wwroot folder and just leave the app.jar file

I hope this solves the issue

0 Votes 0 ·

@JoaquinVano ,

Thank you very much.. its working as expected. after making the changes in "General settings" from the "Configuration" menu option.
One question: How to make this automatically set to "Java SE" stack for all spring boot apps. Instead set it manually.

Is there a way to do it ?

Thanks.

0 Votes 0 ·

Since your are using Maven, you can see the configuration details for maven Azure plug-in here:

https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Web-App:-Configuration-Details

0 Votes 0 ·