Search code examples
azurewarweb-deployment

Problem when trying to deploy war to Azure


I tried to deploy a war file to Azure but failed, here's what I do.

First I tried to deploy the war by dragging the war file under D:\home\site\wwwroot\webapps and then restarted the app service but the .war file didn't decompress.

Second I tried to deploy using power shell using these steps, but I got this error message:

Invoke-RestMethod: You do not have permission to view this directory or page.

Can anybody explain what I'm doing wrong!

By the way, I have web.config file under wwwroot:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <system.webServer>
      <security>
         <requestFiltering>
            <requestLimits maxAllowedContentLength="4294967295" />
         </requestFiltering>
      </security>
      <httpPlatform processPath="%AZURE_TOMCAT85_HOME%\bin\startup.bat"> <!-- arguments="-config D:\home\site\wwwroot\conf\server.xml start"> -->
         <environmentVariables>
            <environmentVariable name="CATALINA_OPTS" value="-Dport.http=%HTTP_PLATFORM_PORT% -Xms512m -Xmx2048m" />
            <environmentVariable name="CATALINA_HOME" value="%AZURE_TOMCAT85_HOME%" />
         </environmentVariables>
      </httpPlatform>
   </system.webServer>
</configuration>

Solution

  • The war didn't decompress because tomcat is not running, so inside Application settings make sure that Java is activated and Java web container is Tomcat.

    enter image description here

    Also make sure that you have a deployement slot ( look the above pic ) if not create a new one.

    Hope it helps.