-
Notifications
You must be signed in to change notification settings - Fork 0
Description
I have several ASP.NET Core APIs that run on Azure App Service on Linux. These applications perform important work on shutdown (using IHostApplicationLifetime.ApplicationStopping). This work takes just a couple of seconds to complete, so shutdown timeouts should not be relevant.
When I run the APIs locally and use Ctrl-C to shutdown the API, this work is performed correctly. However, when restarting the APIs in Azure, whether by deploying new versions or manually restarting the app service through the Azure Portal, the shutdown tasks seem to never run. It is almost as if Azure App Service just kills the container or process something when I click "Stop" or "Restart" in the Azure Portal.
Is this intended?
Note that this problem does not exist on Azure App Service for Windows. There, the shutdown work is performed correctly.
Possibly related: