When running a Java application from a .Jar file within an Azure Web app, the application runs but fails to bind to port 80.
Having followed the instructions in the link below: https://blogs.msdn.microsoft.com/azureossds/2015/12/28/running-java-jar-file-to-serve-web-requests-on-azure-app-service-web-apps/
The application starts up, but throws an error when attempting to bind:
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_60] at sun.nio.ch.Net.bind(Net.java:433) ~[na:1.8.0_60] at sun.nio.ch.Net.bind(Net.java:425) ~[na:1.8.0_60] at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[na:1.8.0_60] at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.8.0_60]
I expect it will be a w3wp process that is already bound to port 80, so does not allow the java application to bind to the same port.
Here is what the web.config for the Web App looks like:
<?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=%HTTP_PLATFORM_PORT% -jar "%HOME%\site\wwwroot\bin\demojar.jar""
stdoutLogEnabled="true"
startupRetryCount='10'>
</httpPlatform>
</system.webServer>
</configuration>
Is there a way of convincing the Azure Web App platform to allow the Java application bind to port 80?