Is Azure App Service suitable for web application that mostly runs background tasks?

Tijmen 0 Reputation points
2024-05-28T09:32:45.2+00:00

A bit of context to go with the title:

We are currently in the process of upgrading our legacy .NET applications (.NET Framework 4.8) to modern .NET and with this change we are looking to also improve the hosting model. At this moment we run two dedicated VMs in Azure which host our applications. Some of our web applications already run as Azure App Services and we are very satisfied with the simplicity of it: deployment is easy and the configuration options are limited to what we actually need. Recently we have started hosting worker services (.NET 6) in Azure Container Apps and once running it works great but they come with a lot of configuration and deployment quirks.

Hence the question: is it actively discouraged or even a bad idea to use Azure App Services instead for these applications that mostly run background tasks (i.e. consumers attached to an event bus)?

Nothing seems to discourage it, only the documentation encourages using Container Apps but for reasons that are not of interest to us (microservices, scaling, platform agnostic, ...). Switching to only Azure App Services would greatly simplify our deployment and administration processes, but we are unsure whether Azure App Services (for linux and set to always on) are meant for this.

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
324 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,259 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. akinbade abiola 6,735 Reputation points
    2024-05-28T10:03:42.17+00:00

    Hello Tijmen,

    Thanks for your question.

    Using App services for background tasks is not actively discouraged, but it may be the most optimal solution. This is mainly due to cost and scaling.

    Generally, for background tasks, I will recommend Azure Functions as it scales automatically and is perfect for event-driven architecture.

    You can view the recommendations for this in the Architecture center for Background jobs here:

    https://video2.skills-academy.com/en-us/azure/architecture/best-practices/background-jobs

    Please let me know if you have further questions

    You can mark it 'Accept Answer' if this helped.


  2. SnehaAgrawal-MSFT 19,676 Reputation points
    2024-05-31T08:55:53.6066667+00:00

    @Tijmen As suggested by akinbade to add further- Azure Functions are well-suited for this purpose because they automatically scale based on demand, ensuring efficient resource utilization. Additionally, Azure Functions are designed for event-driven architectures, making them an excellent choice for applications that need to respond to events and execute tasks asynchronously. This combination of automatic scaling and event-driven capabilities often makes Azure Functions a more cost-effective and scalable solution compared to App Services for handling background tasks.

    Please let us know if further query or issue remains.

    Please accept as "Yes" if the answer provided is useful , so that you can help others in the community looking for remediation for similar issues.

    0 comments No comments