Book Image

Azure Serverless Computing Cookbook - Second Edition

By : Praveen Kumar Sreeram, Jason Marston
Book Image

Azure Serverless Computing Cookbook - Second Edition

By: Praveen Kumar Sreeram, Jason Marston

Overview of this book

Microsoft provides a solution for easily running small segments of code in the cloud with Azure Functions. The second edition of Azure Serverless Computing Cookbook starts with intermediate-level recipes on serverless computing along with some use cases demonstrating the benefits and key features of Azure Functions. You’ll explore the core aspects of Azure Functions, such as the services it provides, how you can develop and write Azure Functions, and how to monitor and troubleshoot them. As you make your way through the chapters, you’ll get practical recipes on integrating DevOps with Azure Functions, and providing continuous integration and continuous deployment with Azure DevOps. This book also provides hands-on, step-by-step tutorials based on real-world serverless use cases to guide you through configuring and setting up your serverless environments with ease. You will also learn how to build solutions for complex, real-world, workflow-based scenarios quickly and with minimal code using Durable Functions. In the concluding chapters, you will ensure enterprise-level security within your serverless environment. The most common tips and tricks that you need to be aware of when working with Azure Functions on production environments will also be covered in this book. By the end of this book, you will have all the skills required for working with serverless code architecture, providing continuous delivery to your users.
Table of Contents (13 chapters)

Avoiding cold starts by warming the app at regular intervals

By now, you might be aware of the fact that you can create Azure functions in the following two hosting plans:

  • App Service plan
  • Consumption plan

You will only get all the benefits of serverless architecture when you create the function app using the consumption plan. However, one of the concerns that developers report about using the consumption plan is something called cold starting, which refers to spinning up an Azure function to serve the requests when there have been no requests for quite some time. You can learn more about this topic at https://blogs.msdn.microsoft.com/appserviceteam/2018/02/07/understanding-serverless-cold-start/.

In this recipe, we will learn about a technique that could be used to always keep the instance live and warm so that all requests are served properly.

The App Service plan is a dedicated...