Are SIGTERM/SIGINT signals sent on scale-in events for App Service?

Matt 0 Reputation points
2025-08-27T04:40:36.27+00:00

We're using a Linux container on Azure App Services to run a node app. This app implements graceful shutdown via process.on('SIGINT') and process.on('SIGTERM') to do some cleanup before things are shutdown ( close connections, stop processes, etc ). This seems to work fine when manually stopping or restarting the app, however these signals do not appear to be sent when an instance is removed via scale-in events, both manually scaling in and from autoscale rules.

We've verified this by adding some logs and can verify that these logs are never written under the above circumstances. When we restart or stop the app, they are logged, when scale-in events happen, they are not.

Does anyone know:

  • Whether this type of behaviour is expected?
  • If so, what is the intended way to run cleanup when scale-in happens?
  • If not, how to debug why these signals are not being sent.

Super basic repro example:

const shutdown = () => {
	console.log('SHUTDOWN')
}
process.on('SIGINT', shutdown)
process.on('SIGTERM', shutdown)
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
{count} votes

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.