Serverless computing might be the flavor of the month, but it’s really nothing new. Developes have been using its underlying technology for a long time now, because it has powered much of the public cloud’s platform-as-a-service features. Fire up a S3 instance on Amazon Web Services or a website on Microsoft Azure, and you’re using serverless technologies; all that’s different from an AWS Lambda or an Azure Function is what’s running and what it’s called.
On Azure, one of the key serverless technologies is WebJobs, an independent process that handles back-end services for Azure’s web application platform. WebJobs has given the Microsoft team building and running Azure a lot of experience in creating and managing server instances that run stateless code. A server can be stood up in milliseconds and torn down as quickly. Yes, there’s some latency, but the economic benefits of near-on-demand compute work well both for Azure and for its users.
That same technology underpins one of Azure’s lesser known features, Logic Apps. Part of Azure’s core PaaS features, Logic Apps gives you a no-code development environment for basic workflow-driven application integration. You can think of it as an If This Then That (IFTTT) for your enterprise applications, using triggers from one app to deliver an input to another.
Business process automation in action
Process automation tools are nothing new; they’ve been around since the days of 4GLs, linking mainframes and desktops. Now they’re tools for integrating existing enterprise platforms and cloud services, with a focus on delivering the outputs users need to solve a specific business problem. There’s a lot to be said for being able to give developers of all skills access to these tools, so they can deliver either temporary or permanent solutions.
Logic Apps is part of a spectrum of Microsoft tools: Dynamics 365 and Office 365 users get access to the more line-of-business focused Microsoft Flows, while more complex applications can be built on top of Azure’s serverless Azure Functions (which can run on-premises and in other public clouds, using a containerized runtime). While much of what’s in Microsoft Flows is accessible from Logic Apps, it also offers more in the way of integration with Azure platform services, helping link services like storage, machine learning, and internet of things.
What’s perhaps most interesting about Logic Apps is its relationship to the wider API economy. Triggers are at heart familiar constructs like webhooks or remote procedure calls, so you can subscribe to existing services quickly and add new triggers as necessary. Event sinks can be a mix of webhooks, existing API calls, and messaging services. Again, it’s easy enough to build your own, but in practice you’re working with existing endpoints. That combination makes it simple to bring together very different applications, using Logic Apps as a message processing and transformation layer to bring together enterprise applications that might not normally be used together.
Building apps with Logic Apps
Like most event-driven programming, Logic Apps apps require a trigger to run. Each trigger launches a separate instance of your workflow that’s destroyed once its run. There’s no saved state (unless of course you explicitly call out to an external store), and no link between running instances. But unlike simpler no-code programing environments, Logic Apps apps offer more complex programming constructs, including loops, conditional statements, switches, and branches.
Apps are built in a visual programming environment that’s part of the Azure portal. You can also use it from Visual Studio, so you can work on your Logic Apps apps in a familiar development environment as part of a more complex solution that mixes custom code and workflows. You can also switch to a code view that gives you access to the underlying JSON app definitions, letting you customize existing apps or add new features.
Microsoft provides a library of templates to help get you started. These include common workflows that link popular services, including many that aren’t part of Azure. Templates are easy to modify, and they give you a quick route into building and running your first Logic Apps app. You can take any existing Logic Apps app and convert it into a template for use either inside or outside your organization, so the same code can run in different regions connected to different endpoints.
Constructing an app from scratch is easy enough. Each step is a separate block in the visual Logic App designer. Start with a trigger, from a large library of event sources or using a scheduled trigger. You can then connect your trigger to any APIs you want to use; either launching a query or passing information to the API. Data returned from an API can be added to a variable for additional processing or for delivery to output APIs. You can use Excel-like functions to process data; for example, taking a time in seconds and formatting it as a more readable hours and minutes.
Outputs can be triggered only when specific conditions are met, either using conditional statements to offer different options, or only delivering data when a boundary condition is exceeded. Data is delivered from your Logic Apps app to another connector, this time as an action that pushed the appropriate output. That might be sending an alert to a marketing team when social media sentiment for a product shifts or warning a field service engineer that traffic conditions may mean changes to an appointment schedule.
Working with complex messages and custom code
If you need custom code in a Logic Apps app, you can call out to an existing Azure Function. That may add some latency to your workflow, but in most cases, it won’t be a problem. Alternatively, you can push events out into Event Grid to trigger actions in other applications and services. Microsoft uses the same messaging and event routing service to handle connections into and out of Logic Apps apps and in its other serverless offerings, making integration simply a matter of raising the appropriate event.
Microsoft also offers the Enterprise Integration Pack (EIP) for Logic Apps that adds messaging support for other, more complex protocols. Using the EIP you can connect Logic Apps apps to existing EDI workflows, among others. Bridging older, entrenched enterprise protocols into cloud services can reduce the cost of modernizing your existing enterprise applications, especially if you’re using them as part of a “lift and shift then rebuild” process. It also lets you link Logic Apps apps to other Azure services and to work with XML data as well as JSON.
Using Logic Apps can also reduce costs, because you pay for usage per action. Thus, different trigger types can mean different costs, as can Logic Apps apps that support loops, because each pass through a loop counts as a separate action. Even so, costs are low; actions and triggers cost fractions of a cent, with processor intensive connectors the most expensive at $0.001 a trigger. Integration accounts for EDI add additional cost, although these can be as low as $0.42 per hour.
The result is a quick-to-build, quick-to-deploy tool that requires minimal code to get working and very little development expertise. If you can use IFTTT to control a lightbulb and know how to write an Excel formula, you can build serverless apps on Azure. It’s a shortcut for both the experienced developer and for the team that has an itch that needs scratching right now—and that’s something that’s not been available since the days of Quick Basic.