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

Introduction to Output Bindings

The course is part of these learning paths

play-arrow
Start course
Overview
DifficultyIntermediate
Duration46m
Students505
Ratings
4.3/5
starstarstarstarstar-half

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

Creating and then deploying your Azure Function to the cloud in your usual way in Visual Studio automatically creates and deploys that function.json file we talked about earlier that contains the configuration/metadata information for your Azure Function that it requires based on the code you just wrote. The cloud runtime environment reads the file when it spins up your Azure Function and then runs the logic in the function itself. All in response to the activated trigger.

Triggers are one kind of binding. But Azure Functions also make use of input and output bindings to allow you to easily connect to your related cloud resources such as data and other resources. Azure Functions 2.0 and later supports a variety of bindings that you can use for inbound or outbound connection to those resources.

Note quickly that all bindings except HTTP and Timer must be registered. .NET functions can access and register bindings just by using NuGet packages. Other functions can use extension bundles to access bindings through configuration settings.

Notice in the function.json file that input and output bindings can use directions both in and out, depending on the type of the binding. And some bindings even support a special direction InOut that is available using the Advanced editor in the Azure portal, but we won't be talking about InOut bindings in this opening course on Azure Functions.

So what kinds of resource bindings are supported in Azure Functions? Well, for input you've got Blob Storage, Cosmos DB, IoT Hub, Microsoft Graph Excel tables, Microsoft Graph OneDrive files, Microsoft Graph events, Microsoft Graph Auth tokens, mobile apps, SignalR, Table storage and even Twilio. And for output bindings, it's all of the above except for the Graph Auth tokens, IoT Hub and SignalR. Plus, Event Grid, Event Hubs, HTTP and webhooks, Microsoft Graph Outlook email, Notification Hubs, Queue Storage, SendGrid, and Service Bus. 

In other words, your ability to create interactions in your Azure Functions between the various parts of your cloud architecture is nearly limitless through the use of input and output bindings.

So let's continue our code example by adding an Output binding to our Azure Function. Suppose that we have a scenario in which whenever our current Timer triggered Azure Function goes off, we want to send a message to our Queue. Let's just hop back into Visual Studio to implement that code.

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.