Run jar as a webapp on Azure

Deadly 提交于 2019-12-25 07:19:27

问题


I was able to run metabase.jar on my machine (W10), and now I need to try on Azure, because it's where I have SQL Server.

Metabase.jar: metabase.com/start/

I couldn't do it by myself (closure and jetty are new to me).

On Azure, I tried:

  • Create a web app;
  • Set to Java 8 and Jetty 9.1;
  • Failed to run metabase.jar.

回答1:


Based on my understanding, I think you want to deploy the metabase.jar file as a web application on Azure WebApps like on local. Then I followed the article to upload the metabase.jar file into the directory wwwroot/bin which I created it via Kudu console and create & configure a wwwroot/web.config below to start up the app.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <handlers>
            <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
        </handlers>
        <httpPlatform processPath="%ProgramW6432%\Java\jdk1.8.0_60\bin\java.exe" arguments="-Djava.net.preferIPv4Stack=true -Dport.http=3000 -jar &quot;%HOME%\site\wwwroot\bin\metabase.jar&quot;" stdoutLogEnabled="true" startupRetryCount='10'>
        </httpPlatform>
    </system.webServer>
</configuration>

The result of deployment is that I can't startup it completely without any error. It seems that the app constantly restart by Azure WebApp because of some reasons, such as some resource exceeded quotes not enough memory or unable to connect to Metabase DB. While I scaled up the tier for my testing webapp from small to large, the issue still occured. Please see the figures below.

So I think that it seems to deploy metabase on Azure only via using Docker or Virtual Machine. Hope it helps.



来源:https://stackoverflow.com/questions/38840466/run-jar-as-a-webapp-on-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!