Azure App Service Linux contianer with out-scaling enabled regularly failing startup probe

Emmet 0 Reputation points
2025-02-12T16:56:10.81+00:00

I have an Node app running in a Linux container on Azure app service. I recently enabled Automatic -Scaling. However now whenever there is a scale event new containers sometimes 70% fail Site Startup probe. Also this will affect app restart as well, with no change to docker image. When app was working before.
Are the probes for app service the same as described for container apps? If so how can I customize these probes if I want to use HTTP or delay them?
I also have health check currently disabled for app service.

I can see from my logs in these cases that the app is starting up, just not responding to probe. User's image

User's image

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

1 answer

Sort by: Most helpful
  1. Sirra Sneha 160 Reputation points Microsoft External Staff
    2025-03-10T11:27:53.3366667+00:00

    Hi @Anonymous ,

    Thank you for reaching out to Microsoft Q&A!

    The reason containers fail the Site Startup Probe when scaling events occurs is,

    • The application may take longer to initialize, causing the probe to fail before it is ready to accept traffic.
    • If the application is not bound to the correct port ($PORT), Azure will not detect it as running
    • Insufficient CPU or memory may cause delays in starting new instances.
    • If the application is bound to localhost instead of 0.0.0.0, it won’t be accessible by the probe.

    To resolve the issue,

    • Make sure the container listens to $PORT (typically 8080). Ensure that the app is correctly configured:
    
    const PORT = process.env.PORT || 8080;
    
    app.listen(PORT, "0.0.0.0", () => console.log(`Server running on port ${PORT}`));
    
    
    • Increase Startup Time Limit Set the following environment variable in Azure Portal → App Service → Configuration → Application Settings: WEBSITES_CONTAINER_START_TIME_LIMIT = 300 or more

    enter image description here

    • Choose a higher SKU (P1V3 or higher) for better performance.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment


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.