azure-functions-durable-extension: Host startup fails under certain conditions if both Durable Task and Storage extensions are referenced.
Description
Host startup will fail when all of the conditions below are met:
- Function app is deployed to a Linux Consumption plan (Premium and App Service plans untested).
- App project references both
Microsoft.Azure.WebJobs.Extensions.DurableTask
andMicrosoft.Azure.WebJobs.Extensions.Storage
packages. - Output cleaning is disabled by setting
_FunctionsSkipCleanOutput
totrue
in csproj file.
Expected behavior
The function app should startup and run normally.
Actual behavior
Function startup will fail. Error message:
Microsoft.Extensions.Hosting.Abstractions: Value cannot be null. (Parameter ‘hostingEnvironment’).
Relevant source code snippets
csproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
<RootNamespace>linux_test</RootNamespace>
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="2.4.1" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="4.0.4" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.11" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>
See here for a minimum reproduce project I created.
Known workarounds
- Switch to a Windows plan.
- Enable output cleaning. Due to the aggressive cleaning behavior, this might not be viable in some scenarios.
App Details
- Durable Functions extension version (e.g. v1.8.3): 2.4.1
- Azure Functions runtime version (1.0 or 2.0): v3
- Programming language used: C#
- Storage extension version: 4.0.4
Screenshots
N/A
If deployed to Azure
- Timeframe issue observed: Since at least 2021-01-27.
- Function App name:
ucqu-linux-test
- Function name(s): N/A as durable functions are not required to present to trigger the issue.
- Azure region: East Asia
- Orchestration instance ID(s): N/A as host cannot start.
- Azure storage account name:
ucqulinuxtest
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (6 by maintainers)
This is an issue on Linux right now – we’re working on rolling out the hotfix. The other workaround is to pin back to version 3.0.15815 (I’ll write back with exact steps for this… gotta find them).
PR that fixed it is here: https://github.com/Azure/azure-functions-host/pull/7113
I can confirm this no longer affects me by now.