1. Home
  2. Training Library
  3. Microsoft Azure
  4. Courses
  5. Introduction to Azure Functions

DEMO: Output Bindings with Triggers

The course is part of these learning paths

play-arrow
Start course
Overview
DifficultyIntermediate
Duration46m
Students516
Ratings
4.2/5
starstarstarstarstar-border

Description

This course is an introduction to Azure Functions. It explains how Azure Functions are little bits of your application logic that live in the cloud. The course includes how to activate—or what we call trigger—your Azure Functions, how to pass data to and from them, and also how to tie different Azure Functions together using an extension of Azure Functions called Durable Functions. 

This course provides hands-on demonstrations of how to create different kinds of Azure Functions, how to create bindings to other Azure Services from those functions, and how to create a Durable Function to manage state from one Azure Function to the next.

If you have any feedback related to this course, please contact us at support@cloudacademy.com.

Learning Objectives

  • Create Azure Functions with different types of Triggers
  • Implement input and output bindings to different types of data resources
  • Create Durable Functions to orchestrate related Azure Functions
  • Log the results with Dependency Injection

Intended Audience

Software developers who want to learn how to implement Azure Functions as a part of their cloud software design.

Prerequisites

To get the most out of this course, you should have some experience will the following:

  • Event-driven programming
  • Servers and APIs
  • Coding with C# and JSON
  • Project creation in Visual Studio

Resources

The GitHub repository for this course can be found here.

Transcript

So now that we've done that, successfully added an output binding to our Azure Function. Recall that, queue can actually be a trigger as well. So we have now created a timer trigger to inject something into our queue, we could create another Azure Function that would respond to that queue entry, as a queue trigger.

So let's go ahead and add another Azure Function. We'll just go ahead and call that function two for the moment. Then when we do, we'll get the choice of trigger types that we wanna create. We select queue trigger. We go ahead and we use the same Azure web jobs storage that we have been using for our default development environment. We can even rename the queue according to the particular queue that we have been working with. And then we select OK.

Visual Studio will whip up our new as your function with a queue trigger. And this particular function, again indicated with a queue trigger binding is named properly and using our connection and all this function does is again use the dependency injection parameter for logging. Logging information that says that our queue trigger function has actually run and then it should indicate the content of the queue item when we run the function.

So we just go ahead and run all of that and it should all weave together automatically. Once again, Visual Studio pops up our console so that we can see what's going on inside of our Azure Function. And it reports back to us on its progress in the usual way. And it runs our function and we can see that everything that we wanted to happen has happened. Our timer trigger function has run and our queue trigger function has also run.

We can see that both functions succeeded. You can see the detail that our function with the queue trigger ran because a new queue message was detected. So our timer has run, our output binding has functioned in providing a message to the queue. And our queue trigger function has run in response to that.

So we have now chained together different Azure Functions with different triggers. That is one of the most valuable things that you can do with Azure Functions. You have a wide variety of these kinds of conditions that you can create. To use logical sequences in your programming a very valuable use of Azure Functions. And so you have successfully created your first function, your output binding, and your second function to respond as a trigger to that output binding.

About the Author

David Gaynes is a software and cloud architect for .NET, NodeJS, Azure and AWS. He has been developing .NET and Cloud software for more than 20 years, with some of that time spent at Microsoft, and has authored both technical and non-technical teaching materials as books and in other formats. He enjoys physics, meditation, and experiencing the natural wonders of Hawaii.