Skip to main content

Go Go Azure Functions!

11 min read

 

 Azure Functions are cool.  Functions are conceptually similar to WebJobs in that they are event-driven (triggered) and can be easily integrated with other Azure resources.  Functions are a lightweight alternative to rapidly building and deploying event-driven microservices (several jump start templates are available - see the list at the bottom of this post).  Like most microservices, Functions should be stateless and idempotent.

 With Azure Functions, your applications scale based on demand and you pay only for the resources you consume (e.g. "serverless"). It’s important to note here that the Consumption Pricing Tier (which is the default) imposes a 5 minute time limit on your Functions. If your Function needs more than 5 min to execute you’ll need to host your Function on an App Service VM (although you probably shouldn’t be using Functions if your process needs more than 5 minutes to execute - check out Functions Best Practices).  

 Azure Functions can be implemented in multiple programming lanugages and all the code is available on GitHub:

 To learn more about Azure Functions, see the Azure Functions Overview.

 Function Proxies

 Azure Function Proxies were announced as a preview last week.  Function Proxies enable you to define a single API across multiple Functions. You can learn more about Azure Function Proxies here.

Function Proxies vs. API Management - What to Use When?

I've had a few people express confusion about what to use when: Azure Proxies vs. Azure API Management (APIM).  Azure Function Proxies and APIM can both be used to map a single API to one or more endpoints. Function Proxies make it easier to manage and expose multiple Functions through a simple API while APIM is a full service gateway for documenting, securing, logging and governing the use of your APIs.

 

 

A List of all Function Templates

These templates are available in the Azure Functions Portal.

Core Templates:

BlobTrigger-CSharp - A C# function that will be run whenever a blob is added to a specified container

BlobTrigger-FSharp - An F# function that will be run whenever a blob is added to a specified container

BlobTrigger-JavaScript - A JavaScript function that will be run whenever a blob is added to a specified container

EventHubTrigger-CSharp - A C# function that will be run whenever an event hub receives a new event

EventHubTrigger-FSharp - An F# function that will be run whenever an event hub receives a new event

EventHubTrigger-JavaScript - A JavaScript function that will be run whenever an event hub receives a new event

GenericWebHook-CSharp - A C# function that will be run whenever it receives a webhook request

GenericWebHook-FSharp - An F# function that will be run whenever it receives a webhook request

GenericWebHook-JavaScript - A JavaScript function that will be run whenever it receives a webhook request

GitHubWebHook-CSharp - A C# function that will be run whenever it receives a GitHub webhook request

GitHubWebHook-FSharp - An F# function that will be run whenever it receives a GitHub webhook request

GitHubWebHook-JavaScript - A JavaScript function that will be run whenever it receives a GitHub webhook request

HttpTrigger-CSharp - A C# function that will be run whenever it receives an HTTP request

HttpTrigger-FSharp - An F# function that will be run whenever it receives an HTTP request

HttpTrigger-JavaScript - A JavaScript function that will be run whenever it receives an HTTP request

ManualTrigger-CSharp - A C# function that is triggered manually via the portal "Run" button

ManualTrigger-FSharp - An F# function that is triggered manually via the portal "Run" button

ManualTrigger-JavaScript - A JavaScript function that is triggered manually via the portal "Run" button

QueueTrigger-CSharp - A C# function that will be run whenever a message is added to a specified Azure Queue Storage

QueueTrigger-FSharp - An F# function that will be run whenever a message is added to a specified Azure Queue Storage

QueueTrigger-JavaScript - A JavaScript function that will be run whenever a message is added to a specified Azure Queue Storage

ServiceBusQueueTrigger-CSharp - A C# function that will be run whenever a message is added to a specified Service Bus queue

ServiceBusQueueTrigger-FSharp - An F# function that will be run whenever a message is added to a specified Service Bus queue

ServiceBusQueueTrigger-JavaScript - A JavaScript function that will be run whenever a message is added to a specified Service Bus queue

ServiceBusTopicTrigger-CSharp - A C# function that will be run whenever a message is added to the specified Service Bus topic

ServiceBusTopicTrigger-FSharp - An F# function that will be run whenever a message is added to the specified Service Bus topic

ServiceBusTopicTrigger-JavaScript - A JavaScript function that will be run whenever a message is added to the specified Service Bus topic

TimerTrigger-CSharp - A C# function that will be run on a specified schedule

TimerTrigger-FSharp - An F# function that will be run on a specified schedule

TimerTrigger-JavaScript - A JavaScript function that will be run on a specified schedule

API and Webhooks Templates:

GenericWebHook-CSharp - A C# function that will be run whenever it receives a webhook request

GenericWebHook-FSharp - An F# function that will be run whenever it receives a webhook request

GenericWebHook-JavaScript - A JavaScript function that will be run whenever it receives a webhook request

GitHubWebHook-CSharp - A C# function that will be run whenever it receives a GitHub webhook request

GitHubWebHook-FSharp - An F# function that will be run whenever it receives a GitHub webhook request

GitHubWebHook-JavaScript - A JavaScript function that will be run whenever it receives a GitHub webhook request

HttpTrigger-CSharp - A C# function that will be run whenever it receives an HTTP request

HttpTrigger-FSharp - An F# function that will be run whenever it receives an HTTP request

HttpTrigger-JavaScript - A JavaScript function that will be run whenever it receives an HTTP request

Data Processing Templates:

BlobTrigger-CSharp  - A C# function that will be run whenever a blob is added to a specified container

BlobTrigger-FSharp - An F# function that will be run whenever a blob is added to a specified container

BlobTrigger-JavaScript - A JavaScript function that will be run whenever a blob is added to a specified container

EventHubTrigger-CSharp - A C# function that will be run whenever an event hub receives a new event

EventHubTrigger-FSharp - An F# function that will be run whenever an event hub receives a new event

EventHubTrigger-JavaScript - A JavaScript function that will be run whenever an event hub receives a new event

QueueTrigger-CSharp - A C# function that will be run whenever a message is added to a specified Azure Queue Storage

QueueTrigger-FSharp - An F# function that will be run whenever a message is added to a specified Azure Queue Storage

QueueTrigger-JavaScript - A JavaScript function that will be run whenever a message is added to a specified Azure Queue Storage

SendGrid-CSharp - (Preview) A C# function that sends a confirmation e-mail when a new item is added to a particular queue

SendGrid-JavaScript - (Preview) A JavaScript function that sends a confirmation e-mail when a new item is added to a particular queue

ServiceBusQueueTrigger-CSharp - A C# function that will be run whenever a message is added to a specified Service Bus queue

ServiceBusQueueTrigger-FSharp - An F# function that will be run whenever a message is added to a specified Service Bus queue

ServiceBusQueueTrigger-JavaScript - A JavaScript function that will be run whenever a message is added to a specified Service Bus queue

ServiceBusTopicTrigger-CSharp - A C# function that will be run whenever a message is added to the specified Service Bus topic

ServiceBusTopicTrigger-FSharp - An F# function that will be run whenever a message is added to the specified Service Bus topic

ServiceBusTopicTrigger-JavaScript - A JavaScript function that will be run whenever a message is added to the specified Service Bus topic

TimerTrigger-CSharp - A C# function that will be run on a specified schedule

TimerTrigger-FSharp - An F# function that will be run on a specified schedule

TimerTrigger-JavaScript - A JavaScript function that will be run on a specified schedule

Sample Templates:

FaceLocator-CSharp - A C# function that processes images and outputs the bounding rectangle of faces

FaceLocator-FSharp - An F# function that processes images and outputs the bounding rectangle of faces

FaceLocator-JavaScript - A JavaScript function that processes images and outputs the bounding rectangle of faces

GitHubCommenter-CSharp - A C# function that will be run whenever it receives a GitHub webhook request

GitHubCommenter-FSharp - An F# function that will be run whenever it receives a GitHub webhook request

GitHubCommenter-JavaScript - A JavaScript function that will be run whenever it receives a GitHub webhook request

HttpGET(CRUD)-CSharp - A C# function that fetches entities from a Storage Table when it receives an HTTP request

HttpGET(CRUD)-FSharp - An F# function that fetches entities from a Storage Table when it receives an HTTP request

HttpGET(CRUD)-JavaScript - A JavaScript function that fetches entities from a Storage Table when it receives an HTTP request

HttpGET(CRUD)-PHP - (Experimental) A PHP function that fetches entities from a Storage Table when it receives an HTTP request

HttpPOST(CRUD)-CSharp - A C# function that adds entities to a Storage Table when it receives an HTTP request

HttpPOST(CRUD)-FSharp - An F# function that adds entities to a Storage Table when it receives an HTTP request

HttpPOST(CRUD)-JavaScript - A JavaScript function that adds entities to a Storage Table when it receives an HTTP request

HttpPUT(CRUD)-CSharp - A C# function that updates entity in a Storage Table when it receives an HTTP request

HttpPUT(CRUD)-FSharp - An F# function that updates entity in a Storage Table when it receives an HTTP request

ImageResizer-CSharp - A C# function that creates resized images whenever a blob is added to a specified container

ImageResizer-FSharp - An F# function that creates resized images whenever a blob is added to a specified container

SasToken-CSharp - A C# function that generates a SAS token for Azure Storage for a given container and blob name

SasToken-FSharp - An F# function that generates a SAS token for Azure Storage for a given container and blob name.

SasToken-JavaScript - (Preview) A JavaScript function that will be run whenever a file is added to a External File provider.

ScheduledMail-CSharp - (Preview) A C# function that will periodically send emails

SendGrid-CSharp - (Preview) A C# function that sends a confirmation e-mail when a new item is added to a particular queue

SendGrid-FSharp - (Preview) An F# function that sends a confirmation e-mail when a new item is added to a particular queue

SendGrid-JavaScript - (Preview) A JavaScript function that sends a confirmation e-mail when a new item is added to a particular queue

Experimental Templates:

BlobTrigger-Batch - (Experimental) A Batch function that will be run whenever a blob is added to a specified container

ExternalFileTrigger-Batch - (Experimental) A Batch function that will be run whenever a file is added to a External File provider.

ExternalFileTrigger-CSharp - (Preview) A C# function that will be run whenever a file is added to a External File provider.

ExternalFileTrigger-FSharp - (Preview) An F# function that will be run whenever a file is added to a External File provider.

ExternalFileTrigger-JavaScript - (Preview) A JavaScript function that will be run whenever a file is added to a External File provider.

ExternalTable-CSharp - (Experimental) A C# function that fetches entities from a External Table when it receives an HTTP request.

ExternalTable-FSharp - (Experimental) An F# function that fetches entities from a External Table when it receives an HTTP request.

HttpTrigger-Batch - (Experimental) A Batch function that will be run whenever it receives an HTTP request

HttpTrigger-Powershell - (Preview) A PowerShell function that will be run whenever it receives an HTTP request

QueueTrigger-Bash - (Experimental) A bash function that will be run whenever a message is added to a specified Azure Queue Storage

QueueTrigger-Batch - (Experimental) A Batch function that will be run whenever a message is added to a specified Azure Queue Storage

QueueTrigger-Php - (Experimental) A PHP function that will be run whenever a message is added to a specified Azure Queue Storage

QueueTrigger-Powershell - (Preview) A PowerShell function that will be run whenever a message is added to a specified Azure Queue Storage

QueueTrigger-Python - (Experimental) A Python function that will be run whenever a message is added to a specified Azure Queue Storage

TimerTrigger-Powershell - (Preview) A PowerShell function that will be run on a specified schedule