When deploying an app service there is the ability to specify a start command, but there is no way AFAIK to specify a stop command for an app service. We really have the need for a proper graceful shutdown for our web application that is deployed based on SpringBoot. We need the ability to delay the shutdown until certain tasks have completed and currently we experience when we perform a redeployment that the existing web app is taken offline without shutting down. Based on logging via application insights it just seems to be gone at some point. Adding a shutdown hooks to the Java VM don't indicate a shutdown is even initiated.
I understand that a graceful shutdown should not prevent from shutting down the web app altogether. However I can imagine the option to specify a stop command and a timeout parameter that represents the maximum time in ms that it might take the web app process to stop/shutdown before the web app instance is taken offline.