5
votes

I have a Java Spring Boot application which is deployed on an Azure Webservice, it's all working. What I really want to do at this moment is the following:

"java -jar -Dspring.profiles.active=test app.jar", I want to run the application based on that command via the imput field (startup command) on Azure Cloud, see next image:

enter image description here

The problem is that it gives me the following error: Unable to access jarfile app.jar, I find this information in the logs.

1
I encountered a similar problem, is there any solution? - user12163310

1 Answers

2
votes

I had to set the Startup Command to

java -jar /home/site/wwwroot/app.jar --server.port=80

for my Linux based WebApp service to pick up the jar properly and start my Spring Boot 2.2 application. Note the path is absolute and starts from /home, I found that info here: https://docs.microsoft.com/en-us/azure/app-service/faq-app-service-linux#built-in-images.