0

I'm developing a simple web app that i need to deploy to Azure as an App Service.

It's a Spring Boot project and i've followed the instructions from this website: https://learn.microsoft.com/en-us/java/azure/spring-framework/deploy-spring-boot-java-app-with-maven-plugin

I've done few changes, like adding some configuration to pom.xml so that the right subscription is chosen. When i run mvn azure-webapp:deploy it completes without errors and i see a bunch of stuff is uploaded. But when i visit my site at the given url xxx.azurewebsites.net all i get is a Error 404. I even tried the Azure Toolkit for Intellij, it completes successfully but site still gives error.

I've watched hours of youtube videos and lots of tutorials on this and i can't see that i've missed any steps.

jared
  • 473
  • 3
  • 16

1 Answers1

1

Combining the steps in the official tutorials and my deployment procedure, I provide the following check points for you:

Point 1: Please use mvn package to bulid the JAR package in the directory under which the pom.xml file is located.

enter image description here]

Point 2: Please make sure that the jar package name configured in web.config is the same as the uploaded jar package name.

enter image description here

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 &quot;%HOME%\site\wwwroot\<your project name>&quot;">
    </httpPlatform>
  </system.webServer>
</configuration>

Point 3: Please use FTP to publish jar files and web.config to D:\home\site\wwwroot\ directory on KUDU.

Point 4: Please make sure ApplicationSettings matches your project such as jdk version,tomcat version.

enter image description here

If you want to deploy a war file, you need to configure the ApplicationSettings of your app service on Azure portal, then upload the war file into the path D:\home\site\wwwroot\webapps.

In addition, you could check the log files on KUDU : https://<your project name>.scm.azurewebsites.net/DebugConsole.

As references, please refer to the documents and threads below.

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.

Hope it helps you.

Jay Gong
  • 23,163
  • 2
  • 27
  • 32