The terminology is a little unclear around horizontal scaling in Azure.
When it creates multiple instances of an application, I understand that these run in separate VMs, so when such horizontal scaling happens, this should cause entirely new AppDomains with their own set of static variables to be created.
If that's the case, then is it true that Application_Start event would be called for each instance?
We have a "cache flush" feature that involves setting up a listener to subscribe to a "topic" in a message queue, so that it will flush a static cache when a message is received. We used to think we had to set up the listener in the HttpApplication.Init event, which would be called for each instance, but that no longer makes sense, after realizing that all HttpApplication instances within the AppDomain share the same set of static variables.
My new understanding is that multiple HttpApplication instances (and therefore multiple calls to HttpApplication.Init) will occur in a web app even without horizontal scaling. In other words, it's a normal feature of how an asp.net web app handles requests even in a single AppDomain. Azure's horizontal scaling is completely different, and involves instantiating entirely separate AppDomains. Does that sound right?