AZ900 - Azure Serverless Services
Azure offers a couple of different Serverless computing services. Serverless computing is a term for a managed cloud-hosted execution environment where the service provider manages and maintains the underlying infrastructure. All hardware concerns around high availability, scaling are looked after by Azure. You only have to worry about your code and then pay for the usage.
Although the term used is "Serverless", this can be a bit misleading. There is a server or multiple servers involved in executing your code.
"Serverless doesn't mean there are no servers, it means let's think about servers...less."
- Jeff Hollan via Scott Hanselman's Twitter
The key idea behind Serverless Computing is that you aren't responsible for configuring, scaling or maintaining the servers. Serverless computing is ideal for backend systems to send or process messages to or from other services.
Azure Logic Apps
Azure offers the Serverless service Logic Apps. It is designed as a low-code/no-code platform, allowing users to automate business workflows and processes. It can be used to simplify standard system and data integrations.
Azure Logic Apps uses a web-based designer to produce a graphic design of your logic workflow. This designer uses a set of standard components and actions, allowing you to create enterprise integrations solutions without writing large amounts of code. These actions can be linked together with triggers and connectors to produce execution steps. These steps could also contain variables, loops, or decision logic to model complex workflows.
Azure Functions
Azure Functions are a second Serverless offering from Azure, which host a single method or function in the cloud. They are designed to respond to specific events, typically written in a range of common programming languages, including C#, Python, TypeScript, PowerShell and overs.
Azure Functions can scale automatically, and you are only charged when functions are triggered. This can make Azure Functions an ideal solution when demand is variable. Azure functions run in a stateless environment. If state is required between function runs, then it can be stored within an Azure storage account.
You can also extend Azure Functions with the feature Durable Functions. These additional features enable Functions to perform orchestration tasks. It allows developers to chain functions together while maintaining a state. Azure Functions are ideal when you do not want to worry about infrastructure, and your service is event-driven using messages, REST requests or similar events.
When to use the services
You can use Azure Functions and Azure Logic Apps together, and they can call each other. Azure Functions can also be used for orchestration. However, this is not how they were initially designed. Azure Functions is essentially a serverless compute service, while Azure Logic Apps are used as an orchestration service. Both services charge on the number of executions, but Function Apps considers running time, and Logic Apps considers the system connectors used.
Azure Functions can be created using a range of programming languages. It lets you build complex bespoke algorithms where only the code's design, creation, and maintenance is your responsibility. Suppose you have pre-existing functions and code containing your business logic. In that case, it might be easier to port to Azure Functions than to Logic Apps due to their support of popular programming languages.
Azure Logic Apps can also perform logic intensive operations, but such algorithms' creation and maintenance could be verbose and visually intense as the algorithms become more complex.
Summary
In this post, we looked at Azure Functions and Logic Apps, the Serverless services available on Azure. Logic Apps provide low-code connectors to manage workflows between systems, while Functions provides a platform to run custom code within Azure without managing the underlying infrastructure.
—Matt Boyd