After adding more detailed shutdown reason logging as described here,
I found the following details logged:
"Shutdown message: Change Notification for critical directories.
File Change Notification Error in App_LocalResources
HostingEnvironment initiated shutdown
Change Notification for critical directories.
File Change Notification Error in App_LocalResources
Change Notification for critical directories.
File Change Notification Error in App_LocalResources
Change Notification for critical directories.
File Change Notification Error in App_LocalResources
Change Notification for critical directories.
File Change Notification Error in App_LocalResources
Change Notification for critical directories.
File Change Notification Error in App_LocalResources
Change Notification for critical directories.
File Change Notification Error in App_LocalResources
Change Notification for critical directories.
File Change Notification Error in App_LocalResources
CONFIG change
CONFIG change
This leads me to believe that there are some transient issues happening in Azure causing ASP.NET change notification to fail, thus triggering the application to restart. A similar issue is described in this question.
As a work-around I have added fcnMode = "disabled"
to the httpRuntime
element in the web.config. The root cause remains unknown. The accepted answer in the linked question indicates the cause in that case was an SMB bug in the Northern Europe data center. There must be other causes, because I experienced this issue in the US East datacenter almost 3 years later.