Azure uploaded jar but doesn't run it (Spring boot)

前端 未结 1 1696
不知归路
不知归路 2021-01-28 07:59

I\'ve got myself an Azure Web App Service and a SQL database to go with it. I\'m using Azures Intellij plugin to \"Run On Web App\". Issue is, it doesn\'t run anything, however

相关标签:
1条回答
  • 2021-01-28 08:29

    It sounds like your SpringBoot project lacked a web.config file which will be deployed at the path wwwroot for helping to handle your ROOT.jar.

    Here is a sample web.config file for SpringBoot runnable jar.

    <?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 &quot;%HOME%\site\wwwroot\ROOT.jar&quot;">
        </httpPlatform>
      </system.webServer>
    </configuration>
    

    As above, it comes from my answer of a similar SO thread Deploying Springboot to Azure App Service which you can refer to.

    0 讨论(0)
提交回复
热议问题