Serverless in Context
Getting the Most From Azure Functions
The course is part of these learning pathsSee 1 more
An Introduction to Azure Functions
Serverless Computing has emerged as a capable and low-friction means to execute custom logic in the public cloud. Whether you're using Amazon Lambda, Google Cloud Functions, or Azure Functions, you have a wide variety of target languages, ecosystem integrations, and deployment mechanisms to choose from. All this while leaving the heavy lifting of server provisioning and maintenance to the experts, which gives you plenty of time to focus on your differentiated application functionality.
In this "Introduction to Azure Functions" course, you’ll learn how to build Azure Function applications in the cloud. You'll discover the core feature set of Functions and see how to integrate with a variety of sibling Azure services. You'll explore Function topics like security, monitoring, deployment, and testing best practices. You'll also learn about ideal Functions use cases and the pricing model. Finally, you'll learn about how we've arrived at the serverless computing model, and where serverless is likely to go in the future. By the end of this course, you’ll have a solid foundation to continue exploring Functions on your own, and incorporating Azure Functions capability into your work.
An Introduction to Azure Functions: What You'll Learn
|Lecture||What you'll learn|
|Intro||What to expect from this course|
|Serverless Computing In Context||Understanding what serverless computing is, and how we got here|
|Core Features||A high-level overview of what Azure Functions is, and its basic capabilities|
|Creating Your First Function||A demo of creating your first function in the Azure portal|
|Security||A review of security features in Azure Functions|
|Using API Key Management||A demo of configuring an Azure Function to require API key use|
|HTTP Proxies||A discussion of lightweight HTTP Proxy support|
|Proxying Azure Blob Storage||A demo of using Functions' HTTP Proxy support to front Azure blob storage|
|Triggers and Bindings||Event-based triggering of functions and declarative binding of inputs and outputs|
|Triggering on Queues and Binding to DocumentDB||A demo of Triggering with Azure Queues and Binding Function Output to DocumentDB|
|Testing and Debugging||Tools and techniques for working with Functions during the development cycle|
|Deployment||Options for deploying Azure Function apps into production|
|Deploying From a Local Git Repo||A demo of deploying a complete Azure Function app to the cloud, from a local Git repository|
|Monitoring||Tools for monitoring Azure Functions during dev, test, and release|
|Use Cases||A discussion of ideal use cases for serverless compute and Azure Functions|
|Pricing||A review of how Functions are priced, and a demo of determining price using the Azure Pricing Calculator|
|Serverless in the Future||A short discussion on the future of serverless in the cloud|
|Summary||Course wrap up|
If you have thoughts or suggestions for this course, please contact Cloud Academy at email@example.com.
Azure Functions support a variety of trigger mechanisms for invocation.
The simplest of these is manual invocation from inside the Azure portal. This is good for manual ad-hoc testing, and occasionally for one-off function use, but it isn't too practical in most cases.
HTTP triggers invoke functions as the result of a web request to a known public URL. This behavior is useful for implementing web-based APIs. A related type is webhook triggers. These are event-based triggers that use the HTTP webhook pseudo-standard to invoke Azure functions as a result of some external event. Since webhooks are widely supported in many SaaS applications, and web development platforms, you can use the webhook trigger to invoke functions from a nearly limitless range of custom events, devops pipeline activity, messages posted in your favorite chat application, you can even invoke a function as new orders are submitted to your company's ERP system.
There are also event-based triggers for Azure storage and messaging services. You can trigger functions as storage blobs are created or updated, or when new messages arrive in a storage queue. Similarly, you can trigger off of new messages arriving in an Azure service bus queue or topic, or an Azure event hub.
The last trigger type is the timer-based trigger which supports cron-style configuration of timer invocations in durations ranging from seconds to weeks, or even months. This can be useful for periodic maintenance tasks, like say bulk data import or success or failure notification of overnight batch jobs.
Since Azure Functions logic so frequently interacts with other data and services in the Azure ecosystem it would be tedious to manually write code to reference say a queue message that triggered a function to execute. To make these kinds of tasks simpler, function binding provides a declarative mapping of input and output data for your function logic.
There are several types of bindings available for use in Azure functions.
Data-orientated bindings for DocumentDB and storage blobs, tables and queues allow you to reference data elements as input or output arguments. This makes it very easier to, for instance, update the value of a property in a DocumentDB document, and save that change back to the database without writing lots of boilerplate code for creating a connection, saving changes, and so.
Messaging-related bindings for event hubs and service bus provide direct access to messages that trigger function invocation.
The notification hub output binding lets you build a notification message in function code, and when the function exits successfully, the notification will be automatically sent to intended recipients.
And finally, the HTTP and webhook bindings give you easy access to incoming request objects so that you can interrogate them for query string arguments, HTTP headers and body payloads.
Let's look at how to use function bindings with triggers to make it easy to write functions that integrate with surrounding Azure services.
About the Author
Josh Lane is a Microsoft Azure MVP and Azure Trainer and Researcher at Cloud Academy. He’s spent almost twenty years architecting and building enterprise software for companies around the world, in industries as diverse as financial services, insurance, energy, education, and telecom. He loves the challenges that come with designing, building, and running software at scale. Away from the keyboard you'll find him crashing his mountain bike, drumming quasi-rythmically, spending time outdoors with his wife and daughters, or drinking good beer with good friends.