Azure - 启动命令 - 无法访问 jarfile app.jar [英] Azure - Startup command - Unable to access jarfile app.jar

查看:91
本文介绍了Azure - 启动命令 - 无法访问 jarfile app.jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个部署在 Azure Web 服务上的 Java Spring Boot 应用程序,一切正常.此刻我真正想做的是:

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",我想通过 Azure Cloud 上的输入字段(启动命令)运行基于该命令的应用程序,见下图:

"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:

问题是它给了我以下错误:无法访问 jarfile app.jar,我在日志中找到了此信息.

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

推荐答案

我必须将启动命令设置为

I had to set the Startup Command to

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

让我的基于 Linux 的 WebApp 服务正确获取 jar 并启动我的 Spring Boot 2.2 应用程序.请注意,路径是绝对路径并从/home 开始,我在这里找到了该信息:https://docs.microsoft.com/en-us/azure/app-service/faq-app-service-linux#built-in-images.

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.

这篇关于Azure - 启动命令 - 无法访问 jarfile app.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆