Book Image

Learning Azure Functions

Book Image

Learning Azure Functions

Overview of this book

Functions help you easily run small pieces of code in cloud with Azure functions without worrying about a whole application or the infrastructure to run it. With Azure functions, you can use triggers to execute your code and bindings to simplify the input and output of your code. This book will start with the basics of Azure Functions. You will learn the steps to set up the environment and the tools that we will be using in the further chapters. Once you have a better understanding of this, we will be creating our first hello world function app. Later you will be introduced to triggers, how they are used to activate a function, and how binding can be used to output results of a function.You will also explore the steps to create an assembly with complex functionality that can be used by functions. Next, this book will teach you to scale your functions and use them to process data, integrate systems, and build simple APIs and microservices. Finally, this book will cover some diagnostic techniques with Azure App services and best practices of working with Azure Functions. By the end of this book, you will be well-versed with the techniques of scaling your Azure functions and making the most of serverless architecture.
Table of Contents (17 chapters)
Title Page
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Customer Feedback
Dedication
Preface

Example of creating a simple scheduled trigger


Consider a simple example where we have to display a "good morning" message on screen every day in the morning at 8 AM. This situation is related to time so we need to use a schedule trigger. This is the type of trigger we will look at later in this chapter. Let's start creating a function with the schedule trigger first:

  1. Log in to the Azure Portal.

 

  1. Click on the top left + icon | Compute | Function App:
  1. Once we click on Function App, the next screen will appear, where we have to provide a unique function App name, Subscription, Resource Group, Hosting Plan, Location, Storage, and then click on the Create button:
  1. Once we click on the Create button, Azure will start to deploy this function. Once this function is deployed, it will be seen in Notifications, as shown in the following screenshot:
  1. Click on Notifications and check the Functions details and add the trigger:
  1. To add a trigger in this function, click on the + icon next to Functions and then...