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
- 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