Serverless — Azure Function and Logic Apps

vishal gupta
3 min readOct 22, 2020

--

Serverless

1. Azure Functions — have easy direct access to other Azure services like queues, events, and storage.

2. Event-triggered stateless containers to host your application or part of your application.

Azure Functions and Logic Apps (Serverless)

Deploying the function is scripted using Azure Resource Manager (ARM) templates and the Azure CLI.

What scenarios are appropriate for serverless?

1. Ideal for processing background tasks. For example, send an email. Instead of sending the email as part of handling the web request, the details of the email could be placed onto a queue and an Azure Function could be used to pick up the message and send the email.

2. Publisher/Subscriber pattern between applications and Azure Functions is the most common pattern

3. Azure Functions can be triggered by other events, such as changes to Azure Blob Storage.

An application that supported image uploads could have an Azure Function responsible for creating thumbnail images, or resizing uploaded images to consistent dimensions, or optimizing image size. All of this functionality could be triggered directly by inserts to Azure Blob Storage, keeping the complexity and the workload out of the application itself.

4. Serverless computing provides a great way to perform slower tasks outside of the user interaction loop, and these tasks can easily scale with demand without requiring the entire application to scale.

When should you avoid serverless?

1. Serverless computing is best-used for tasks that don’t block the user interface.

This means they’re not ideal for hosting web applications or web APIs directly. When a new instance of a function is needed, referred to as a cold start, it takes time to provision.

A single instance can often be kept alive indefinitely (for instance, by periodically making a request to it), but the cold start issue remains if the number of instances ever needs to scale up.

If you need to avoid cold starts entirely, you can choose to switch from a consumption plan to a dedicated plan.

You can also configure one or more pre-warmed instances with the premium plan so when you need to add another instance, it’s already up and ready to go. These options can mitigate one of the key concerns associated with serverless computing

2. You should also typically avoid serverless for long-running tasks.

Most serverless platforms require individual functions to complete within a few minutes

3. Finally, leveraging serverless for certain tasks within your application adds complexity.

It’s often best to architect your application in a modular, loosely coupled manner first, and then identify if there are benefits serverless would offer that make the additional complexity worthwhile

Scaling Azure Functions

Azure Functions automatically supports scaling out.

COST

You’re only charged for compute resources being used when your functions are running based on the number of executions, execution time, and memory used..

Cloud-native communication patterns

1. Across the cluster, microservices communicate with each other through APIs and messaging technologies.

Each microservice must communicate over a network protocol, which adds complexity to your system:

• Network congestion, latency.

• Resiliency (that is, retrying failed requests) is essential.

• Each microservice must authenticate and authorize calls.

• Each message must be serialized and then deserialized — which can be expensive.

• Message encryption/decryption becomes important

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

vishal gupta
vishal gupta

Written by vishal gupta

Software Architect, Author, Trainer

No responses yet

Write a response