Some facts on Azure Functions

A few weeks ago Azure Functions where released during Build 2016. This really wasn’t announced as a big thing. But if you start looking at what you can do with Azure Functions it really is something awesome.

Occurring to Microsoft Azure Functions is the following:

“Azure functions is a solution for easily running small pieces of code, or “functions,” in the cloud. You can write just the code you need for the problem at hand, without worrying about a whole application or the infrastructure to run it. This can make development even more productive, and you can get started with your first function in just minutes.

For now Azure Functions is hosted in three locations:

  • West Europe
  • Southeast Asia
  • West US

Managing and creating Azure Functions can be done from two locations:

The Functions application is completely build upon Azure App Services which means you can use all functions that Azure App Services provide as: Deployment Slots, Web Configuration, Hybrid Connections and Continuous Integration.

Some other key features are:

  • Choice of language – Write functions using C#, Node.js, Python, F#, PHP, batch, bash, Java, or any executable.
  • Pay-per-use pricing model – Pay only for the time spent running your code. See the Dynamic App Service Plan option in the pricing section below.
  • Bring your own dependencies – Functions supports NuGet and NPM, so you can use your favorite libraries.
  • Integrated security – Protect HTTP-triggered functions with OAuth providers such as Azure Active Directory, Facebook, Google, Twitter, and Microsoft Account.
  • Code-less integration – Easily leverage Azure services and software-as-a-service (SaaS) offerings. See the integrations section below for some examples.
  • Flexible development – Modify your functions with an in-portal editor, or set up continuous integration and deploy your code through GitHub, Visual Studio Team Services, and more.
  • Open-source – Functions is open-source and available on GitHub.

The Azure Functions team is working on the supported languages but for know these are the supported languages:

1st class support

  • Node / JavaScript
  • C#

Experimental

  • Python
  • F#
  • PowerShell
  • PHP
  • Bash
  • Batch

By default Azure Functions contains a lot of Triggers, Inputs and Outputs you can use to process information. The below table gives you an idea of what can be used in what kind of situation.

Type Service Trigger Input Output
Schedule Azure Functions
HTTP (REST or webhook) Azure Functions ✔*
Blob Storage Azure Storage
Queues Azure Storage
Tables Azure Storage
Tables Mobile Apps Easy Tables
No-SQL DB Azure DocumentDB
Push Notifications Azure Notification Hubs

What you maybe are wondering is, can I use NuGet packages or maybe custom assemblies? Yes you can! NuGet packages can be added by adjusting the project.json file and uploading it trough the KUDU UI or FTP. Besides that you can also reference your own assemblies. If you need to reference a private assembly, you can upload the assembly file into a bin folder relative to your function and reference it by using the file name.

#r "MyAssembly.dll"

More information on working with “External Assemblies” can be found here:

https://azure.microsoft.com/en-us/documentation/articles/functions-reference-csharp/#referencing-external-assemblies

On of the things I found when working with Azure Functions that get triggered by a scheduler you will have to use Cron Expressions:

http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-06.html

Cron expressions is another kind of time expression that Azure Functions uses. In time a UI will be created to set the scheduler but for know you will have to use this format:

Run every 5 seconds: 0/5 * * * * *

The best thing of Azure Functions is that you do not have to implement logic for getting and saving the information. You only have to implement the logic for the actions you want to perform. If you for example want to resize images you can build a Azure Function that is triggered by Azure Blob Storage, and outputs the resized images to Azure Blob Storage. The implementation you need to make is only the logic for resizing the images.

Besides all these great features it can also use Dynamic Compute what means it will use up no resources when it isn’t triggered or running and it will scale up when the functions needs to.

Related Posts

Listing Azure Services within a CSV file In some situations you will look into a current Azure Environment and the setup/governance of it and need to migrate or move resources around. The ...
Azure Event Grid with Custom Events As of yesterday (16-8-2017) the public preview of Azure Event Grid is live. Azure Event Grid is a fully managed event routing service. Azure Event Gri...
Removing the Classis Hybrid Connections from Azure (Azure BizTalk Service) As you know the classic hybrid connections that are build upon Azure BizTalk Services are deprecated. These connection will have to be replaced by the...
Restricting access to your Azure Web Application As you may know almost everything that is deployed to Azure is publicly available. As with Azure SQL Database you do not have a firewall available for...
Configure access to a private network for a Azure App Services On-Premise connections for Azure App Services can be created by using Hybrid Connections. Hybrid connections do not need any development or re-configu...
Extensions and Tips for deploying with Azure Resource Templates Working with Azure Services in different subscriptions means that the Azure Services need to run in different subscriptions. This often occurs when we...

2 comments

  • Hi Maik,
    I am writing an Azure Function that is linked to VSTS both ways. It is linked as a receiver of service hook for an event of work item created. Then through the Azure Function I want to call a REST API of VSTS to do some changes to work item. Does Azure Function support OAuth so that I can use it as a service for a specific account of VSTS?

Leave a Reply

Your email address will not be published. Required fields are marked *