Cloud computing is one of the trending technologies in the current world. On the other hand, Azure is one cloud platform that offers various cloud services. Today, I will discuss one of the popular Azure services in the Microsoft Azure Functions that we used to develop a solution for Save A Lot, one of our clients.

One of Microsoft Azure's most popular services is the Azure Function. More developers opt for this service before creating any APIs because it is less expensive and takes less time to develop.

Serverless:

Before deep diving into Azure Functions, we need to know what Serverless is.

Due to a cloud-native development paradigm called serverless, developers may construct and run applications without worrying about managing servers.

What is an Azure Function?

  • An Azure Function is a cloud-native serverless idea that allows a piece of code to be deployed and executed without requiring server infrastructure, web server, or any customizations. The cloud infrastructure provides all the resources necessary to maintain the functionality of your apps. (Or)
  • An Azure Function is a cloud-based serverless solution that enables the scalable execution of event-triggered code without the provisioning or management of infrastructure. It allows you to execute a script or code in response to various events and does not have to run continuously.

predict

Key Features in Azure Function:

  • Scalability: Azure functions scale up and down, automatically, depending on the amount of traffic. As a result, when code execution needs rise, the requisite resources are automatically allocated, and vice versa.
  • Pay-Per-Use Pricing Model: The consumption plan is invoiced based on resource use and executions per second (different plans offer features for special needs). The image provided below indicates the price for the consumption model.

    predict

  • Flexible Development: We can develop in portal, visual studio, or any other tool.
    • Before we develop any function, we must create a function app to host the execution of our functions.
    • When creating a function app, you must create or link to a general-purpose Azure Storage account that supports Blob, Queue, and Table storage. Functions depend on Azure Storage for tasks like managing triggers and monitoring function executions.
    • While creating a function app, we must choose a runtime stack for the functions we need to develop. We must also select the operating system and pricing plan while creating the function app.

      predict

    • One Azure Function App can scale out to at max 200 instances per Microsoft.

      predict

    • If we opt to develop a function in the portal, the second step states, ”Use a template to create a function. Triggers describe the type of events that involve your functions”.

      predict

    • We can write the code, and trace information is recorded in the logs as soon as your function executes.

      predict

  • Troubleshooting: We can use monitoring tools to gain insights into functions.
  • Multiple Languages: Azure Functions are language independent.
  • Faster and Easier: Azure functions are quicker to perform and easier to write and publish.
  • Azure Durable Functions: Are the extension of Azure Functions that helps us write stateful functions in a serverless compute environment, explained briefly in the section below.

Why Do We Use Durable Functions?

Azure Functions are stateless as it processes the code when it triggers, but we can construct stateful functions using Durable Functions.

Stateless: Stateless systems have no history of prior interactions and must respond to each interaction request solely based on the data it receives. The terms "stateful" and "stateless" come from the definition of "state" as a collection of circumstances existing at a particular time.

What Are Durable Functions?

Durable Functions are an enhancement of Azure Functions. The add-on enables you to create stateful entities using the Azure Functions programming model and stateful workflows utilizing orchestrator functions. The add-on takes care of managing state, checkpoints, and restarts in the background so you can concentrate on your business logic.

Durable Functions' primary purpose is to simplify serverless systems' burdensome, stateful coordination requirements. Typical application patterns that can profit from stable functions are listed below:

  • Function chaining
  • Fan-Out/fan-In
  • Async HTTP APIs
  • Monitoring
  • Human interaction
  • Aggregator (Stateful Entities)

Function Chaining:

predict

As the flow indicates, functions are executed in a pattern where the input will be the output of the previous function.

Fan-Out/Fan-In:

predict

In fan-out/fan-in, we can execute multiple functions parallelly, and aggregation work is done on the results returned from the functions.

Async HTTP APIs

predict

Coordinating the status of long-running activities with external clients is handled via the async HTTP API pattern. An HTTP endpoint is frequently used to start the long-running movement in this design. The client will then be sent to a status endpoint where it will poll to determine when the operation is complete.

Monitor

predict

The term "monitor pattern" describes a flexible, recurrent workflow process. Durable Functions allow you to manage task lifetimes, generate multiple monitor processes from a single orchestration, and construct configurable recurrence intervals.

Human interaction

predict

There is usually some human interaction in automated procedures. Integrating humans into an automated process can be challenging because they aren't as responsive and readily available as cloud services. This interaction might be supported by an automatic process that uses timeouts and compensating algorithms.

Aggregator (Stateful Entities)

predict

In the final pattern, event data is combined over time into a single, addressable entity. The data aggregated in this pattern could be provided in batches, from many sources, or dispersed over a long period. External clients may need to query the aggregated data, and the aggregator may need to respond to event data as it arrives.

Conclusion:

The goal of Microsoft Azure Functions is to streamline and accelerate the development of applications. This is very different from the development of typical applications since it calls for complicated IT infrastructure, which is frequently cumbersome, expensive, and time-consuming. Although serverless computing, the newest buzzword in the world of app development, improved matters somewhat, but there was a significant shift in how things functioned.

Using Azure Functions serverless architecture, you can stop worrying about all the infrastructure concerns you once had, allowing you to concentrate solely on writing and publishing effective code. This can be followed by specifying the events and triggers that will cause the code to run.

Subscribe to our email Newsletter

Popular Posts

Tags

About the Author

profile image

Pavan Kumar Reddy

Senior Associate Software Engineer, Cloud ADM – Microsoft

Pavan is a Senior Associate Software Engineer performing as a full-stack .NET developer specializing in C#, React, and Azure technologies. He has creatively designed, developed, and executed several SharePoint, Angular, Azure, and React applications for clients and internal projects (JEX).

How Can We Help You?