Microsoft flings open Azure Functions to Java workloads
TypeScript tooling tweaks too, you lucky people
The Azure Functions gang has been busy while their HoloLens counterparts have been sunning themselves in Barcelona. Java workloads are now ready for production while TypeScript tools have seen an overhaul. We took both for a spin to see how they looked.
Java in Azure goes GA
Azure Functions is Microsoft's pitch at the serverless world, with devs able to take advantage of the benefits of sending portions of their apps cloudwards without having to worry about pesky infrastructure like Virtual Machines and their ilk. Or, er, performance.
The convenience afforded by the likes of Azure Functions (and AWS's Lambda) is hard to resist, however, and Microsoft is keen to emphasise that devs can build using the languages and tools of "their choice".
Testing and debugging locally is also possible, so with gritted teeth we slung a copy of the Java Developer Kit on to a handy workstation. Version 8 is supported – don't be silly and try version 11 like we did. It didn't go at all well for us and eventually required a second, shamefaced download.
We then inflicted version 3.6 of Apache Maven onto our quivering Windows 10 machine, added the Azure Command Line and the Azure Functions Core Tools (which necessitated a recent .NET Core SDK) and were good to go. After fiddling with the environment variables, of course.
After tinkering with the
LocalHost version of the function, and debugging some of Microsoft's helpful "Getting Started" instructions (because, after all, working out why something broke is the best way of learning how it works), deployment of the function to Azure via Maven was straightforward thanks to the Azure Functions Maven plugin.
Once deployed to Azure Functions, the Java can be invoked via a HTTP request or scheduled as an event. Data can be written back to the calling source without the dev having to deal with the underlying Java SDK.
TypeScript in Azure Functions
The gang at Redmond have updated the Azure Functions Core Tools and Azure Functions Extension for Visual Studio Code to make things a little easier, effectively supporting TypeScript "out of the box".
We fired up version 1.31.1 of Visual Studio Code to take a look at how it worked.
The answer is, pretty well. After our Java experience, we were well prepared for the URI funnies that awaited us, but the implementation in Visual Studio Code does an admirable job of simplifying things. Selecting TypeScript as the language for a new Function App gives the user a number of TypeScript specific function templates, each representing one possible trigger.
Credit where credit is due, once the code is in, firing up the function for local debugging and then deploying to Azure is a simple button click, or a command line function for those not keen on the GUI delights of Visual Studio Code.
The latter will, of course, be more of interest to those looking to put together a DevOps pipeline rather than the occasional Visual Studio Code user. ®