CHAPTER 12Deploy an Azure Function Trigger by a Timer

Suppose you were tasked to develop a mobile e-commerce app to support your employer's omnichannel approach to engaging with customers. Like most e-commerce apps, customers can view products, make purchases, and manage their customer profile. Depending on how a customer engages with the app, a workflow is triggered, whether that's writing data to a data table or providing a notification to the warehouse to kick off the supply chain workflow. You can anticipate app usage to dynamically change and would, therefore, need a hosting solution to scale to meet customer demand. Not to mention, spending less time managing servers and configuring the flow of data would be ideal so that you can focus more on the business logic. Serverless computing provides such a solution.

With serverless computing, servers are still used; however, a cloud provider such as Azure manages the infrastructure. Furthermore, you're only charged based on usage. The mobile e-commerce app example represents several event-based triggers, which could be managed with Azure Functions. Azure Functions provides a serverless solution for executing snippets of code (referred to as a function) with an event-based trigger. There are various use cases for functions such as executing code at a scheduled time, responding to database changes, and even real-time bot messaging to name a few. As requests increase, Azure Functions adjusts to the demand by providing as many ...

Get Visual Studio Code for Python Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.