image
Use of Orchestrator and Activity Functions
Start course
Difficulty
Intermediate
Duration
46m
Students
3714
Ratings
4.5/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

There are currently four durable function types in Azure Functions, Activity, Orchestrator, Entity, and Client. But we'll start by looking at just the first two, Activity and Orchestrator. 

Activity Functions are pretty much basic Azure Functions written more or less as usual with the one important difference being the requirement of an ActivityTrigger attribute that indicates that this function can be triggered from your Orchestrator function.

Your Orchestrator orchestrates the various Activity Functions by executing them as you specify. The Orchestrator function type requires an OrchestrationTrigger as we'll soon see.

When you start your Durable function, it creates the necessary control queues for each of the Activity Functions that it finds, and one worker item queue. Take note that although your Orchestrator looks like it is directly calling the function, under the covers it is instead actually sending a message to that work-item queue.

Your Activity Functions will receive a message from the queue through implementation of your ActivityTrigger and then execute any of its internal logic. When the Activity Function completes its execution, the function sends a response message to the control queue. The Orchestrator function then receives that response message via its OrchestrationTrigger, and the full behavior of the Durable Function is complete.

So an example might be you have a total of order items that you need to pass to another function to get taxes, or you have area parameters for something that then you need to calculate the total volume. Basically, any situation in which you have a value that you would like to pass on to another separate function to return a dependent value would be a use case for Durable Functions orchestrating your Azure Functions.

So let's take a look at how this works in code by jumping back into our Visual Studio project.

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.