Logo

dev-resources.site

for different kinds of informations.

Flex Consumption is not cheap (when in private VNET)

Published at
12/19/2024
Categories
azure
azurefunctions
flexconsumpiton
gitlab
Author
rokicool
Author
8 person written this
rokicool
open
Flex Consumption is not cheap (when in private VNET)

I have been working with Flex Consumption plan-based Azure Function Apps for several months and was super enthusiastic about the value.

The Flex Consumption plan produces stable funding for script-defined automation and costs pennies. It allows integration with your private VNET and could be used within a private network environment.

Is it really that good?

Unfortunately, there is no direct answer, and let me explain why.

Azure Function App uses Storage account

Yep. Every Azure Function App utilizes the Azure Storage account to (ha-ha) function. The code of the Function App is located on the Storage account and should be available to the Azure Function App at every moment.

Which is fine. The price of the Storage accounts is reasonable and depends on the amount of data. And that could not be a lot. So the problem is not the Storage account itself.

Private Endpoints are the problem!

Again, when you run your Azure Function App in private, that literally means all the services must run in private and cannot be accessed from the Internet.

As I explained in the previous articles (Azure Function App (Flex Consumption) in private VNET via IaC), you have to build an internal connection between the Azure Function App and the Azure Storage account.

How? You have to setup (at least) two private endpoints for the blob and file services of the Storage account. It is not difficult, but there are some details that must be addressed. That is precisely the point of the mentioned article.

Every private endpoint is billed for time. It costs 1 cent per hour. Which seems to be close to nothing... But...

1 cent per hour sums to about $7.2 per month. And there are two of them, so ~$15 per month.

Here comes Durable Functions stuff

What Durable Functions? Yep. That is another really great technology that deserves much longer article.

Basically, Durable Functions fix the natural limitations of the Azure Functions.

For example, any HTTP-triggered function must return something within 230 seconds. And what if you need more than 240 seconds to gather the results? Or, the grace period of Azure Function is 60 minutes. What if you need more time to execute your automation?

Durable Functions resolve that. They bring the 'context' term into Azure Functions. That gives the possibility of the longer run, control of the run, statuses of the run, and more good things.

But how is that related to this post?

Directly! Durable Functions libraries use the queue and the table services of the Azure Storage account!

From our ("Azure Function in the Private") standpoint, that means we have to create, support, and pay for two more private endpoints for these services!

Final calculation

So, these four private endpoints will cost you ~$7.2 x 4 = ~$30 per month.

Which is still very reasonable, but not cheap.

And don't forget that you probably need to support at least two environments: DEV and PROD. Which makes it $60.

In case you are not afraid

It is still a very robust solution.

And in this 🦊GitLab repo (azure-function-app), I created an end-to-end automated solution that deploys two infrastructures, builds the PowerShell-based Azure Function App, and deploys it to your private VNET.

And yes, the Durable Functions are supported too! Just do not forget to set CI/CD variable AZURE_IS_DURABLE_FUNCTION to 'true'.

azurefunctions Article's
30 articles in total
Favicon
Secrets of a Successful Data Engineer
Favicon
Flex Consumption is not cheap (when in private VNET)
Favicon
🚀 Azure Function App: The Technical Backbone of Modern Applications
Favicon
Azure Function App (Flex Consumption) PowerShell Modules solution
Favicon
Azure functions isolated worker HTTP trigger: custom header disappears from response.
Favicon
The importance of release testing & questionable compiler optimizations
Favicon
Azure Functions with Python: Triggers
Favicon
Catching the Bus? How a Service Bus and Azure Functions Can Help Your Integration Reliability
Favicon
How to Create Timer Trigger Azure Functions with .NET 9: Step-by-Step Guide for Beginners
Favicon
Azure Function App (Flex Consumption) in private VNET via IaC
Favicon
Migrating Azure Function Calls to Minimal API with FastEndpoints
Favicon
Serverless Functions: Unlocking the Power of AWS Lambda, Azure Functions, and More
Favicon
Why Students Should Explore Microsoft Azure: The Cloud Platform for Your Future 🚀
Favicon
Cost Management in Azure: A Student-Friendly Guide to Managing Cloud Costs
Favicon
Azure Functions in .NET (C#) — The Ultimate Fun Version 🥳
Favicon
Building Scalable Applications with Azure Functions: Best Practices and Tips
Favicon
CREATING AN AZURE RESOURCE GROUP AND CLOUD STORAGE
Favicon
Returning Correct StatusCodes in Azure Function Apps
Favicon
Unlocking the Power of Azure Functions Flex Consumption Plan with Pulumi
Favicon
Implementing a Visitor Counter on Azure Resume Challenge
Favicon
Ready to Explore AI? Start with Azure AI Fundamentals!
Favicon
Handling Missing Configuration with Fallback Values in Azure Functions
Favicon
You don't need Dockerfile to containerise Azure Functions
Favicon
Azure Functions Hosting Models: In-Process vs. Isolated Process - What's Best for Your Project?
Favicon
How to Create Custom Middleware in Azure Functions: A Step-by-Step Guide with .NET 8
Favicon
Serverless Computing with .NET Core and Azure Functions
Favicon
Azure | Azure Functions By Example
Favicon
Improving Azure Functions Cold Boot
Favicon
Future-proof software development with the Azure Serverless Modulith
Favicon
Building business processes with Azure Durable Functions

Featured ones: