我无法让我的Spring Boot站点在Azure Web实例上响应。我遵循Java app instructions和upload instructions。看起来IIS服务器正在接收请求,但是战争中的servlet没有响应。根据文件,有几个陷阱。特别是,web.config应该部署到wwwroot并指定java路径以及转发端口。我相信我已经介绍了这些基础 - 我的web.config粘贴在下面。无法将Spring Boot应用程序部署到Azure
我没有尝试从市场部署一个tomcat服务器,并且工作正常。当我替换我的war文件和web.config时,spring启动应用程序不起作用。
一个有趣的信息是HTTP_PLATFORM_PORT环境变量似乎没有被定义。
应用程序设置:
Azure的控制台信息(环境变量和Web.config文件):
D:\home\site\wwwroot
> dir
D:\home\site\wwwroot
Volume in drive D is Windows
Volume Serial Number is 789E-197B
Directory of D:\home\site\wwwroot
03/01/2016 02:14 AM <DIR> .
03/01/2016 02:14 AM <DIR> ..
02/29/2016 08:15 PM <DIR> bin
03/01/2016 01:49 AM 8,771,899 web-0.0.1-SNAPSHOT.war
03/01/2016 02:10 AM 496 web.config
03/01/2016 02:08 AM 496 web.custom.config
03/01/2016 01:54 AM 4,868 web.tomcat.config
03/01/2016 02:14 AM <DIR> webapps
> echo %java_home%
D:\home\site\wwwroot
D:\Program Files\Java\jdk1.8.0_60
> echo %http_platform_port%
D:\home\site\wwwroot
%http_platform_port%
> cat web.config
D:\home\site\wwwroot
<?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 "%HOME%\site\wwwroot\web-0.0.1-SNAPSHOT.war"">
</httpPlatform>
</system.webServer>
</configuration>
嗨,抱歉,但你能帮我吗? ,我上传了一个jar文件到/ webapp文件夹,但没有任何改变..我错过了一部分?我在哪里可以找到这个web.config文件?提前致谢 ! –
正确的路径是网站/ wwwroot。在Azure门户中使用从Web App配置的ftp凭据。 web.config在这里解释:https://azure.microsoft.com/en-us/documentation/articles/web-sites-java-custom-upload/我的web.config基本上与springboot应用程序中的一样显示在该页面上。会发生什么是您启动运行您的jar的自定义Http模块。 – Brett
非常感谢!另一个问题,我没有得到启动一个自定义的Http模块的一部分,我是Azure和这些东西的新手,顺便说一句,我也有一个SpringBoot应用程序..对不起,发送垃圾评论:( –