I'm trying to deploy and run a spring boot app on azure linux web app using azure devops pipeline. The container is getting deployed on web app however it is not responding to health checks after it starts. In deployment, az-pipeline yml file build's jar package using Maven then builds image and pushes to ACR. Webhook deploys latest image to web app.
Errors
- docker run -d -p 8440:8000 --name myapp-backend-dev_0_2b7b9f65 -e
WEBSITE_CORS_ALLOWED_ORIGINS=* -e
WEBSITE_CORS_SUPPORT_CREDENTIALS=False -e
WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITES_PORT=8000 -e
WEBSITE_SITE_NAME=myapp-backend-dev -e WEBSITE_AUTH_ENABLED=False -e
WEBSITE_ROLE_INSTANCE_ID=0 -e
WEBSITE_HOSTNAME=myapp-backend-dev.azurewebsites.net -e
WEBSITE_INSTANCE_ID=0d7eaa93ccf04e2494816f0f168f4e2170cd80b95a36687e39877b27289
-e HTTP_LOGGING_ENABLED=1 myappdevacr.azurecr.io/dev:latest
2. Starting container for site
3. docker run -d -p 9268:8081 --name myapp-backend-dev_0_2b7b9f65_middleware -e
WEBSITE_CORS_ALLOWED_ORIGINS=* -e
WEBSITE_CORS_SUPPORT_CREDENTIALS=False -e
WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITES_PORT=8000 -e
WEBSITE_SITE_NAME=myapp-backend-dev -e WEBSITE_AUTH_ENABLED=False -e
WEBSITE_ROLE_INSTANCE_ID=0 -e
WEBSITE_HOSTNAME=myapp-backend-dev.azurewebsites.net -e
WEBSITE_INSTANCE_ID=0d7eaa93ccf04e2494816f0f168f4e2170cd80b95a36687e39877b27289
-e HTTP_LOGGING_ENABLED=1 appsvc/middleware:1907112318 /Host.ListenUrl=http://0.0.0.0:8081
/Host.DestinationHostUrl=http://172.16.1.2:8000
/Host.UseFileLogging=true
4. Container myapp_0_de5443dd didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.
5. home/LogFiles/webssh/pm2.log (https://myapp.scm.azurewebsites.net/api/vfs/LogFiles/webssh/pm2.log)Host:
undefinedwebssh2 Login: user=root from=127.0.0.1 host=undefined
port=2222 sessionID=undefined allowreplay=undefinedHeaders:
{"connection":"close","accept":"text/html, application/xhtml+xml,
application/xml; q=0.9, /;
q=0.8","accept-encoding":"br, gzip,
deflate","accept-language":"en-gb","cookie":"ARRAffinity=0d7eaa93ccf04e2494816f0f168f4e2170cd80b95a36687e39877b2728981272","host":"127.0.0.1:3000","max-forwards":"10","referer":"https://myapp.scm.azurewebsites.net/","user-agent":"Mozilla/5.0
(Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like
Gecko) Version/12.1.2
Safari/605.1.15","x-client-ip":"111.11.111.111","x-client-port":"57208","x-waws-unencoded-url":"/webssh/host","client-ip":"111.11.111.111:57208","x-arr-log-id":"SOMETHING-ee62-48cf-813a-724c9acb0ca0","disguised-host":"myapp.scm.azurewebsites.net","x-site-deployment-id":"myapp","was-default-hostname":"myapp.scm.azurewebsites.net","x-original-url":"/webssh/host","x-ms-client-principal-name":"EMAIL@SOMETHING.onmicrosoft.com","x-ms-client-display-name":"SOME
NAME","x-forwarded-for":"111.11.111.111:57208","x-arr-ssl":"2048|256|C=US, S=Washington, L=Redmond, O=Microsoft Corporation, OU=Microsoft IT,
CN=Microsoft IT TLS CA
5|CN=*.azurewebsites.net","x-forwarded-proto":"https","x-appservice-proto":"https"}Host
from file: 172.16.1.2DEBUG: Local ident:
'SSH-2.0-ssh2js0.1.16'on.error - Error: connect ECONNREFUSED
172.16.1.2:2222Status_WatchFile :: Error Error: ENOENT: no such file or directory, open '/appsvctmp/status.txt'
Dockerfile
FROM adoptopenjdk/openjdk11:ubi
ARG PROFILE
ENV spring.profiles.active=$PROFILE
ENV ACCEPT_EULA=Y ENV WEBSITES_PORT=8000 ENV WEBSITE_HTTPLOGGING_RETENTION_DAYS=7 ENV WEBSITES_CONTAINER_START_TIME_LIMIT=1800
ARG JAR_FILE=target/*.jar COPY ${JAR_FILE} app.jar
EXPOSE 8000 8000
ENTRYPOINT ["java","-jar","/app.jar"]
NOTE: Tried solution provided by Charles Xu and beerzy on this post but the error didn't resolve.