Blog Post

Apps on Azure Blog
4 MIN READ

Announcing Public Preview of Azure Functions Flex Consumption

nzthiago's avatar
nzthiago
Icon for Microsoft rankMicrosoft
May 21, 2024

Azure Functions is the go-to service for you to implement event-driven, serverless based solutions. Based on your feedback we're thrilled to announce the Public Preview of Azure Functions Flex Consumption, a new Linux-based hosting plan which offers the features in Consumption that you have been waiting for: networking and fast scaling features on a serverless billing model!

 

Flex Consumption is built on the latest Functions host especially optimized for scale, a brand-new backend infrastructure called Legion, and a new version of our internal scaling service. It is now available in preview in 12 regions and supports .NET 8 Isolated, Python 3.11 and Python 3.10, Java 17 and Java 11, Node 20 LTS, and PowerShell 7.4 (Preview).

 

You can use the Azure Portal, Azure CLI, Visual Studio Code, and Maven to create and edit your Flex Consumption apps, with support for Visual Studio coming soon.

 

Flexibility of Scale

Flex Consumption represent a significant leap forward, offering a comprehensive range of scaling capabilities. Some of the key scaling features are:

  • Instance memory choice – In Flex Consumption we offer multiple choices for instance memory size. The preview will start with 2048 MB, and 4096 MB, and more instance sizes added in the future. The larger the memory, the more each instance can handle - heavier executions or more concurrency - depending on your workload.
  • Per instance concurrency - Concurrency is the number of parallel requests (executions) to be handled by each instance of your app. Your Flex Consumption app instances will scale based on this, both for HTTP and non-HTTP workloads. While you can control and fine tune the concurrency, we’ll provide defaults that work for most cases.
  • Per function scaling – We are introducing per function scaling, which scales function groups and individual functions independently without changes required in your code. This is an important feature that ensures deterministic scaling of your app. You don't need to change your code or configuration, per function scale will work as a platform feature.
  • Always ready instances - Flex Consumption includes an optional Always Ready feature, that allow you to select instances to be always running and assigned to each of your per-function scale groups or individual functions. This is a great option for scenarios where you need to have a minimum number of instances always ready to handle requests, for example, to reduce your application's cold start latency.
  • Scale out further – The default scale limit set by client tools is 100, but this can be changed up to 1000 instances per app. Currently, each region in a given subscription has a memory limit of 512,000 MB for all instances of apps running on Flex Consumption plans in that region. If your apps require a larger quota, raise a support ticket to request a quota increase.

 

In a recent large-scale test, GitHub was able to sustain nearly 1.6 million events processed per second using one Flex Consumption app triggering from a network restricted Event Hub:

 

Networking Support

Flex Consumption allows you to reach VNet secured services from your function app and also to secure it to your VNet. All while still allowing you to take advantage of serverless billing and scale to zero, together with the other scale and throughput benefits of the Flex Consumption plan.

 

There is no extra cost for VNet support in Flex Consumption. While the subnet used for VNet integration can't already be in use for other purposes like private or service endpoints, or delegated to any other hosting plan or service, you can share the same subnet between multiple Flex Consumption apps.

 

Serverless Billing

Flex Consumption has a competitive billing model that is truly serverless and follows the current Consumption based pricing. You will be charged for on demand instances when they are actively execution your functions, and for any optional Always Ready number of instances for a baseline and when actively executing.

 

The Flex consumption plan pricing also includes a monthly free grant of 250,000 requests and 100,000 GB-s of resource consumption per month per subscription in pay-as-you-go on-demand pricing across all Flex Consumption function apps in that subscription.

 

For more information about Flex Consumption billing head to the Azure Functions pricing page.

 

More Features

Besides the scaling and networking features of Flex Consumption, check out these great features and integrations we have enabled for it:

  • Azure Load Testing integration – For all Function apps you should see a Performance section in the Azure portal, with a Load Testing option that lets you easily set up a load tests against your HTTP based functions. This is a great option for you to test your HTTP workloads for Flex Consumption. Soon there will be a Performance Tuner feature specific for Flex Consumption. Learn more about Azure Load Testing and Functions integration.
  • Open Telemetry opt in – Flex consumption apps can opt in to emit platform logs, metrics, and traces using Open Telemetry semantics to Azure Application Insights or other OLTP-compliant endpoints. It is also easy to configure your Function worker code to do the same. Learn more about Open Telemetry opt in for Flex Consumption.
  • Long execution times – in Flex Consumption the functions host does not enforce an execution time limit. Note that there is no execution time guarantees during public preview and the platform can still cancel function executions so ensure to write robust functions.

 

Get Started Today!

Empower your serverless solutions with Flex Consumption. Whether you're a startup looking to kickstart your serverless apps, or an established enterprise seeking enhanced scalability and security, Flex Consumption is here to support your journey.

 

Check out the links below to get up to speed on the Flex Consumption preview:

Updated May 21, 2024
Version 3.0
  • Stefan_Eissens - apologies we missed replying to you. The plan for the foreseeable future is to keep it as a linux only plan. GA work is under way, between now and the beginning of next year.

  • mellonjasper's avatar
    mellonjasper
    Copper Contributor

    Great news! I have a question. Will this plan support the zone redundant option? The Azure update news item mention support for availability zones, but I can't find it documented elsewhere.

  • Stefan_Eissens's avatar
    Stefan_Eissens
    Copper Contributor

    Great to see VNET integration into this plan.

     

    some questions:

    • Will the Flex consumption stay a linux only plan or will it also come available for windows? 
    • And do you have a timeframe when it the flex consumption plan will become GA?

    Thank you.

  • Stefan_Eissens's avatar
    Stefan_Eissens
    Copper Contributor

    nzthiago Thank you for your reply. Good to here that you are busy with the GA of the Flex consumption plan. I now have an estimate of when it will be available as GA. thx.

  • Well0549's avatar
    Well0549
    Copper Contributor

    I have a question......

     

    I was really exited to take part in the preview. But now I have some questions regarding configuration.

     

    I have the same setup in Windows Consumption/ Linux Consumption/ Flex Consumption. (Compiled sources are identical.)

    I have a program that does the following:

     

    1. Message is sumitted to a queue
    2. Queue Trigger will create Orchestration
    3. Orchestration will have 3 to 5 activities
    4. Last activioty will write the mesage to a queue (effectively step 2 but then for another orchestration)

    Now on Windows this runs Super !

    On Linux Slower (a lot) but it runs!

    On FlexPlan it is extremely slow!.

     

    The messages get picked up from the queue and then waits 30 seconds to 5 minutes before the activity starts.

    It also seems the function immediately shuts itself down after processing  a couple of messages... (So there is another wait for 30 seconds)

     

    Not sure if it's something ion the host.JSON or a configuration of some sort.

     

    Where can i go with questions regarding the flex plan.

     

     

     

  • tomaustin's avatar
    tomaustin
    Copper Contributor

    Does this mean we can use hybrid connections with a consumption plan now?