Hi @Ad Gaasbeek
Thanks for the question and using MS Q&A platform.
Unfortunately, Azure App Service does not provide a built-in mechanism to extend the shutdown timeout beyond the default behavior, which may lead to immediate termination of your application. Therefore, you may need to handle the shutdown logic within your application to minimize the impact of abrupt terminations.
Additionally for smooth shut down your Azure App Service on Linux, make sure to handle the TERM signal properly. Keep in mind that Azure App Service doesn't automatically wait for your app to finish shutting down before it terminates.
Set up health probes to manage the app's state during the shutdown. By returning a 503-status code from your health checks when you get a shutdown signal, you can stop new requests while letting ongoing tasks wrap up. But note, Azure might still enforce a timeout period and forcibly terminate your app if it exceeds this period.
1.Implement signal handling to catch the TERM signal.
2.Use health probes to show when the app isn't ready for new traffic.
3.Ensure the app finishes ongoing transactions before the timeout hits.
references:
https://learn.microsoft.com/en-us/azure/spring-apps/basic-standard/how-to-configure-health-probes-graceful-termination?tabs=azure-portal#health-probe-properties
Please accept as "Yes" if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.