Azure Functions: What are they good for? – Part 1

The focus of this article is for you to learn some of the use cases for Azure Functions. Before we dive into those details, let’s do a quick review of what exactly are Azure Functions.

Azure Functions are an Azure compute service that allows you to run code with no concern for any of the underlying infrastructure. They are event-driven and are usually small, focused workloads that execute quickly. With Functions being event-driven, that means something must initiate the event to occur, and in this case, the initiator is referred to as a Trigger. To give you a better understanding of Azure Function usage, you will need a better understanding of the events that cause a function to run. An Azure Function will be executed by one of the following triggers:

As you can see, there is no shortage of triggers to react to different events or Azure services. Because of the numerous triggers to choose from, it might not always be obvious what the best use cases are for each Azure Function. I would like to help ease that concern for you as well as hopefully provide some new use cases for Azure Functions. For this article, we will be exploring just a subset of those triggers: HTTP/WebHook, Timer, Azure Storage Blobs, and queue.

HTTP/WebHook Trigger

HTTP/WebHook triggers execute whenever an HTTP request is received, responding based on data in the body or query string:

Timer Trigger

Functions that use the Timer trigger will run on a specified schedule. This means that this trigger is handy for executing timer-based processing tasks.

As stated earlier, it can be challenging for you to know the best scenarios for using Azure Functions. To make matters a little more complicated, knowledge of each functions’ trigger needs to be considered. For instance, while discussing the use cases for the timer trigger, it was mentioned that a timer could be used to poll Azure Blob Storage. This approach will technically work; however, a more direct trigger exists that interacts with Blob Storage, and that is the Azure Blob Storage trigger, which will be discussed next.

Azure Blob Storage Trigger

The Blob Storage trigger is designed to run whenever a blob is added to a specified storage container.

  • Uncompress zip files that are uploaded to Blob Storage (view some code)
  • Resizing image files uploaded to Blob Storage (view some code)
  • Extracting data from files based upon file type

Azure Storage Queue Trigger

The final trigger we will discuss runs whenever a message is added to a specified Azure Storage queue.

Azure Functions allow for a wide range of scenarios to be handled while simplifying the process of deploying code to Azure. In most cases, as can be seen from the referenced code, a complete solution for a problem can be achieved by combining several Azure Functions! This article serves as part 1 in a series of articles discussing the uses of Azure Functions.

Stay Informed

Sign up for the latest blogs, events, and insights.

We deliver solutions that accelerate the value of Azure.
Ready to experience the full power of Microsoft Azure?

Atmosera is thrilled to announce that we have been named GitHub AI Partner of the Year.

X