There’s a new kid in town and it is called Azure Functions
A lot of stuff has been announced during the Build Conference this year. A lot of exciting stuff for developers, especially if you are into everything Azure. One of the things I am pretty psyched about is Azure Functions. It seems so arbitrary, but it’s something I – as an integrator – use daily. Just think of all your helper functions (methods) you use in BizTalk, or any other application for that matter. Just to get the little stuff done as well.
Instead of having to build a custom API app to get some little piece of work done – by the way… how circuitous was that?! – you can now just build one function and deploy it to Azure. Or even edit it in the Azure Portal and get it up and running immediately. And it is all as scalable as any App Service. It’s in fact web jobs made easy!
I am a fan of a (well governed) microservice architecture. If you chop your stuff up into little peaces, it’s so much easier to develop and fix your stuff. Instead of having to do a full-blown deployment, you can just settle with deploying this little piece of code with minimal impact. How good does it make you feel if you can patch something with nearly zero impact for your customer(s)?
What are Azure Functions?
Azure Functions are basically little pieces of code that can be triggered by an event – hence the name: Function Apps. From transforming a date to writing to your blob storage, or even call into your ERP system (ok, that’s getting big). It can all be done in Function Apps. Even better: you can use any NuGet package or upload your 3rd party binaries and use them in your function! Now that sounds pretty cool!
Since it’s all event driven, you can obviously use Azure Functions to catch events from your mobile and IoT devices. But it goes further than that. Your function works like an API app on App Services. So you can also use them anywhere, also across your other Azure Apps.
And because it is built on top of App Services, it brings all the functionality from those same App Services. Things like scaling, security and integration with GitHub and BitBucket are just there. Azure Functions also introduce the ability to scale to 0 [zero, nada]. Yes. That’s true. That means your service can actually shut down and you – I guess – don’t have to pay anything for compute anymore if your service is idle.
From Node.JS to Powershell
Right now you can use Node/Javascript and C# for your Azure Function App, but the team is committed to get other languages in there as well. So if you are a PHP web developer or a Linux Bash fan, it just doesn’t matter.
Here’s the list of languages that will be supported for Azure Functions:
- Node/Javascript
- C#
- F#
- Python
- PHP
- Batch
- Bash
- Powershell
And what about costs?
Until May 2nd it’s free to use, after that the pricing will be composed of memory per second. So now it actually pays off to optimize your code 😉 But of course there’s a drawback. How in gods name do you calculate the amount of usage? But I guess that’s with everything in the cloud, since it’s all so mindblowingly scalable. There will be a free tier (AWS offers the same functionality and has a free tier), but pricing is still something Microsoft has to sort out.
Azure Portal, Visual Studio and Continuous Integration
So many ways to develop these days. Right now you can only develop your Azure Function right there in the web portal. But Visual Studio support (I guess a project template and deployment sceme) is coming next month and you can already use continuous integration with GitHub. So you can just use any tool you want for this.
How to get started?
Just browse to https://functions.azure.com/ and get started. There’s a wizard there and you’ll get a guided tour 🙂
No navigating from blade to blade and getting lost. Instead you get a very easy and intuitive interface. It’s very easy to start developing, test your code and integrate with other services and even define your inputs and outputs. This functionality just got into Preview, so expect some glitches here and there and IntelliSence is also missing for now, but will be added later. Just copy and paste your code from Visual Studio to the portal if you really need the intellisence. And it’s not like you already did this if you are a BizTalk developer…
Support for Logic Apps is also coming this week, along with some other new features in Logic Apps, so I will surely be testing this and posting my findings! It’s an exciting time for developers.