Azure Function Triggers Quick Start

Azure Functions allow you to trigger the execution of code based on a wealth of events. This course will teach you how to create, configure, and test all the essential trigger types.
Course info
Rating
(38)
Level
Intermediate
Updated
Mar 3, 2017
Duration
1h 44m
Table of contents
Description
Course info
Rating
(38)
Level
Intermediate
Updated
Mar 3, 2017
Duration
1h 44m
Description

Serverless computing and Azure Functions enable the easy development and execution of C# code in the cloud. Serverless computing is the next evolution of Platform as a Service (PaaS). In this course, Azure Function Triggers Quick Start, you'll learn how to create Azure functions that are triggered by a wide variety of inputs. First, you'll discover how to periodically execute a trigger on a timer. Next, you'll explore how to take input from and write to Azure Blob Storage, Queue Storage, event hubs, and service bus queues and topics. Finally, you'll learn how to create webhook functions to easily integrate with 3rd party systems such as GitHub. By the end of this course, you'll understand how to create, configure, and write code in functions that are triggered by a variety of inputs such as HTTP and queues.

About the author
About the author

With over 15 years experience, Jason Roberts is a Microsoft .NET MVP, freelance developer, and author.

More from the author
Working with Files and Streams in C#
Intermediate
3h 13m
Oct 12, 2018
Error Handling in C# with Exceptions
Intermediate
1h 37m
Aug 6, 2018
More courses by Jason Roberts
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone. My name is Jason Roberts. Welcome to my course, Azure Function Triggers Quick Start. I'm a Microsoft. NET MVP, freelance developer, and author. In this course, we're going to learn how to create Azure functions that are triggered by a wide variety of inputs. Some of the major topics that we'll cover in this course include how to create triggers that respond to HTTP requests, how to periodically execute a trigger on a timer, and how to take input from and write to Azure blob storage, key storage, event hubs, and service bus queues and topics. We'll also learn how to create webhook functions to easily integrate with third-party systems such as GitHub. By the end of this course, you'll understand how to create, configure, and write code in functions that are triggered by a variety of inputs, such as HTTP and queues. Before beginning the course, you should be familiar writing basic C# code. I hope you'll join me on this journey with the Azure Function Triggers Quick Start course, at Pluralsight.

Using Blob Triggers and Timer Triggers
Hi. Welcome back. In the previous module, we learned how to create a manual trigger that wrote a message to a queue, and then also a queue trigger which notices that this message has been written, and then write some output into blob storage. In this module, we're going to learn how we can take the input from that blob container while using a blob trigger that will automatically notice when a new blob is written. We'll also learn how to execute a function on a specified schedule using a timer trigger. So in this module, we'll start off by creating a blob-triggered function in the Azure portal, and inside this function, we're going to read the blob from the blob container, and we'll also learn how to access the blob metadata. In the body of our blob-triggered function, we'll go and perform some processing, and as part of this processing, we'll write a new blob out to a different blob container. When we're using blob triggers, we can also specify different paths. So for example, we could trigger the function only if a new blob is added with a specified extension. We'll then go and create a new function, this time a timer-triggered function. We'll learn how to specify how often the function executes by using CRON expressions, so we'll learn the different components of CRON expressions. We're going to use this timer-triggered function to perform housekeeping, and in the example, we're going to delete blobs in blob storage that are older than a specified time range. So let's head over to the portal and we'll go and create a blob-triggered function.

Using HTTP Triggers
In addition to triggering functions manually on a timer or in response to queue or blob events, we can also trigger them via HTTP calls. In this module, we're going to go and create some HTTP triggered functions. We'll learn that when we create a HTTP trigger, we can limit the HTTP verbs that the trigger will respond to. So we'll go and create a new function that uses an HTTP trigger, but only allows POST verbs, and as part of the code in this function, will write out to our message queue. We'll then go and create another HTTP triggered function this time that responds to GET verbs, and inside this function, we're going to read out our SMS receipt blob data. In this module, we'll also learn how we can configure HTTP authorization for our triggers and we'll learn about specifying custom HTTP trigger roots. So for example, rather than getting a piece of data from the query string, we can instead get it from the URL as part of a route template. So let's head over to the portal and we'll go and create our first HTTP triggered function.

Using Webhook Triggers
Hi. Welcome back. In the previous module, we learned how to use HTTP triggers. Webhooks are a special kind of HTTP trigger that allow us to integrate with other third-party systems. In this module, we'll start off by getting a brief overview of the concept of webhooks, and we'll learn that, in the portal, we can go and create generic webhook triggers or webhook triggers specially designed for GitHub or slack. Well head over to the portal and we'll go and create our first webhook trigger. This trigger will be a generic webhook trigger and we're going to go and use it to integrate with a third-party system, in this case, an eBook publishing service called Leanpub. So we'll see how to configure the webhook in Leanpub and then respond to it in our Azure function app every time a new preview is generated for a specific eBook. Next, we'll learn how to create one of the special types of webhook, so we'll learn how to create as GitHub webhook trigger, and we'll see how we can use this to receive notifications from GitHub every time a new issue is added to a repository. So let's kick off this module by getting a brief overview of the concept of webhooks.

Using Service Bus Triggers and Event Hub Triggers
Hi. Welcome back to this final module. In this module, we're going to learn how to use Event Hub triggers, and also, how to create triggers for Service Bus queue messages, and also, topics. So we'll kick off this module by creating a new function in the portal and configuring an Event Hub trigger. We'll see how we can modify the code to read in POCO objects. So we'll learn how we can change the type of the function parameters to receive a CreateGreetingRequest object. We'll then head over to Visual Studio, and we'll see a console application that's going to write a number of test messages to an Event Hub. Next, we're going to learn how to create Service Bus triggers. We'll learn how to configure a trigger to respond to messages added to a Service Bus queue, and we'll also learn how we can configure a trigger to respond to subscriptions on a topic. Once again, we'll see example console applications that send messages to both Service Bus queues and topics. Finally, we'll see how we can get access to the BrokeredMessage metadata when we're using Service Bus triggers. So let's head over to the portal and get started.