I do believe that serverless hosting is capable of covering most of the needs for the most of web applications. Serverless architecture is great in relieving us from the pain of managing the computation resources and infrastructure, being surprisingly cost-efficient at the same time.

If you are an ASP.NET Core developer, I do expect that you might be well interested in an option of serverless hosting of your applications in Azure especially having 1,000,000 request executions per month for free.

Azure platform offers developers Azure functions as a serverless compute platform. While the initial purpose expected from Microsoft was to provide a quick and lightweight solution to manage various automation tasks, Azure Functions are still capable of running fully-functional ASP.NET Core applications. At the moment, such an option is not offered by existing templates, but you can apply the following instructions and samples to host your existing application inside serverless Azure Function. If you wish to skip the explanation, you may proceed straightly to the sample at GitHub.

Steps

At a high level we need to have 2 components:

ASP.NET Core application we want to be hosted in a serverless platform

Azure function application, in which we are going to host the existing app

During the following steps we will create and configure both applications: