Azure: Durable Function on Linux Consumption Plan

Azure Durable Functions is a convenient way to create workflows in the cloud. "Pay as you go" is the perfect type to leave the scaling to the cloud while not paying anything if there's no work to do.

According to this, Linux Consumption Plans have a cold-start-time which is less than 50% of a Windows Consumption Plan. Therefore, one has to wait less time until the function wakes up when cold starting.

Here are the steps with Azure CLI:

  1. Create a Functions App. Be aware, that .NET 5.0 and isolated process does not support Durable Functions. In this case you have to set "netcoreapp3.1" as your TargetFramework in the csproj File.

    If you want to keep it simple to create such an app:
    1. func init funcapptest
    2. cd funcapptest    
    3. func new --name MyHttpTrigger --template "Http Trigger"
  2. Create a Resource-Group: az group create --name "some_resource_group_name" --location "westeurope"
  3. Create a Storage-Account: az storage account create --name some_storage_name --location westeurope --resource-group some_resource_group_name --sku Standard_LRS
  4. Create th Function-App: az functionapp create --resource-group some_resource_group_name --consumption-plan-location westeurope" --os-type Linux --name some_functions_app_name --storage-account some_storage_name --runtime dotnet
  5. Deploy the Function-App: func azure functionapp publish some_functions_app_name --csharp

While most of the commands seem quite naturally and understandable, there is the --consumption-plan-location on the Create-Function command which must not be missing, otherwise it just does not work. There is no error message, there are no logs.

The name of the Consumption Plan cannot be set if deployed by Azure CLI. It is automatically concatenated out of the Location and the OS-Type.