Spring Container on App Service takes a long time to start

Aravind Rajasekharan Pillai 21 Reputation points
2022-02-21T22:03:19.177+00:00

HI

I am trying to deploy a spring boot docker container on OpenJDK image into APP service on Azure. What baffles me is the time the web app takes on the initial run (only during the initial run). I also see on the KUDU console that the container started up in less than 6 seconds but the APP service ran for more than 200 seconds and fails. Please see the attached screenshot. Has someone faced this issue before? 176520-screen-shot-2022-02-21-at-34655-pm.png

Regards
Aravind

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,758 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Aravind Rajasekharan Pillai 21 Reputation points
    2022-03-16T17:15:59.953+00:00

    So after long research and help from MS support, Finally figured out the issue. As I said before, it is not related to how the container starts up as the container was starting up in less than 6 seconds. The issue we noticed is that when the start-up fails due to HTTP health-check timeout, the app is starting up with port 80 as the listening port. When it is successful, it starts up with port 8080.

    Spring-Boot default listening port is 8080. The fix is to manually add the configuration for the APP service

    App Setting Name: WEBSITES_PORT
    Value: 8080

    The above configuration seems to have fixed the issue and now the time to start is the time taken by the docker container within the app service.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.