The decision to use serverless and Azure Functions
Even with the benefits presented during this chapter, there is always a question about why one would use a serverless function over having it as part of a bigger web application.
If you think exclusively about HTTP Trigger functions, this question is more difficult to answer because you can create a Web API application that generally solves the problems in this scenario.
However, there are some use cases where an Azure Function is truly the best option. Let’s list them to help you with this decision in your scenario:
- When you need to execute a periodic task: Azure Functions with Timer Trigger is, for sure, a great option. Using Cron expressions, you will be able to set different periods to have your function running. You can check out more details at https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer.
- When you want to execute a task after some data changes: By using triggers...