Reputation: 7049
Is it possible to deploy a custom .NET module to my own "App Service Plan" (the machines that run my Azure Web Apps)?
The following problem led me to this question: I'm thinking about doing some fancy caching to speed up a web application. The caching logic I have in mind will be in-process, but cache a rather large amount of data that is slow to build up. Since the build-up must happen before any request can be served, that gives my web app a long warm-up time after each app pool recycling.
The caching code itself will be updated infrequently, so factoring that part out in an IIS module may be advantageous, as a recycling of the app pool would leave the cached data in-memory.
However, I strongly suspect that this isn't possible with Azure Web Apps - but I thought it prudent to ask the community to make sure.
Upvotes: 0
Views: 632
Reputation: 15042
It's definitely possible to create custom IIS modules and deploy them with your individual web apps. You can bundle the module with your web app code (i.e. a DLL file in the /bin directory) and configure it in your application's web.config. More info here: https://msdn.microsoft.com/en-us/library/vstudio/ms227673(v=vs.100).aspx
Of course, you would need to do this bundling for all your individual web apps. In your question, you specifically mentioned app service plans, and there isn't a way to automatically include and register them independent of your web apps.
Upvotes: 1
Reputation: 24636
Generally speaking, if you want a cache you'll be better of storing the cached data somewhere like on a Redis cache or even in Azure Table storage (which is really fast if you're just using the primary key to find data).
Heck, you could even store the cache a file on local disk.
Azure Web Apps can be moved to another machine at any point in time for a variety of reasons, including OS updates, Azure Web App upgrades, etc. And when that happens you'll loose whatever cache you stored in memory, meaning you'll need to regenerate everything.
If generating your cache will take a while and will block your users then you probably don't want to go the in-memory cache route.
Upvotes: 0