结合official tutorials中的步骤和我的部署过程,我为你提供以下检查点:
第1点:请使用mvn package在pom.xml文件所在目录下构建JAR包。
]
第二点:请确保web.config中配置的jar包名与上传的jar包名一致。
web.config
<?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\<your project name>"">
</httpPlatform>
</system.webServer>
</configuration>
第3点:请使用FTP将jar files和web.config发布到KUDU上的D:\home\site\wwwroot\目录。
第 4 点:请确保ApplicationSettings 与您的项目相匹配,例如jdk version,tomcat version。
如果要部署war文件,需要在Azure门户配置应用服务的ApplicationSettings,然后将war文件上传到D:\home\site\wwwroot\webapps路径。
此外,您可以查看 KUDU 上的日志文件:https://<your project name>.scm.azurewebsites.net/DebugConsole.
作为参考,请参阅下面的文档和线程。
1.Configure web apps in Azure App Service
2.Create a Java web app in Azure App Service
3.Deploying Springboot to Azure App Service.
希望对你有帮助。