Azure / Azure/azure-functions-durable-js

Workaround for issue with hosting Durable Functions app on preview Flex Consumption plan

Open
#606 0 comments 0 reactions 0 assignees View on GitHub
known-regression
Dominant language
TypeScript
Stars
142
Forks
66
Avg merge
3d 19h
Merged PRs (30d)
4

Description

## Problem today
If you deploy a Node.js Durable Functions app to the Flex Consumption plan (currently in preview), you'll see the following error message on Portal when the app starts:

Microsoft.Extensions.DependencyInjection: Unable to activate type 'DurableTask.Netherite.AzureFunctions.NetheriteProviderFactory'. The following constructors are ambiguous: Void .ctor(Microsoft.Extensions.Options.IOptions`1[Microsoft.Azure.WebJobs.Extensions.DurableTask.DurableTaskOptions], Microsoft.Extensions.Logging.ILoggerFactory, Microsoft.Azure.WebJobs.Host.Executors.IHostIdProvider, Microsoft.Azure.WebJobs.INameResolver, System.IServiceProvider, DurableTask.Netherite.ConnectionResolver, Microsoft.Azure.WebJobs.Extensions.DurableTask.IPlatformInformation) Void .ctor(Microsoft.Extensions.Options.IOptions`1[Microsoft.Azure.WebJobs.Extensions.DurableTask.DurableTaskOptions], Microsoft.Extensions.Logging.ILoggerFactory, Microsoft.Azure.WebJobs.Extensions.DurableTask.IConnectionStringResolver, Microsoft.Azure.WebJobs.Host.Executors.IHostIdProvider, Microsoft.Azure.WebJobs.INameResolver, Microsoft.Azure.WebJobs.Extensions.DurableTask.IPlatformInformation).

## Workaround
1. Remove the reference to Extension Bundles in `host.json`.
2. Instead of using bundles, [manually install](https://learn.microsoft.com/azure/azure-functions/durable/durable-functions-extension-upgrade#manually-upgrade-the-durable-functions-extension) the latest stable version of [Durable Functions extension](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask/2.13.4) to your function app:

```
func extensions install -p Microsoft.Azure.WebJobs.Extensions.DurableTask -v 2.13.4
```
This should add an `extensions.csproj` file to your app directory.

3. If you're using other Azure Functions extensions, you'll also need to manually install them.
4. Run your app locally to make sure it's working as expected.
5. Redeploy app to Azure and you should no longer see the error message.

## Notes

Use this workaround only if you need to deploy your app to the Flex Consumption plan.

We're fixing this issue now so customers can continue to use the Extension Bundles, which is the recommended approach, instead of manually installing extension(s). The reason is bundles will ensure that you're automatically on the latest version of extensions, which often contain critical bug and security fixes. Moreover, all extensions in bundles are tested to ensure that they're compatible with each other, saving you from having to deal with .NET errors when extensions you use are incompatible.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Node.js Durable Functions app on the preview Flex Consumption plan and inspect its host.json extension-bundle configuration. Compare the documented manual installation using extensions.csproj and Microsoft.Azure.WebJobs.Extensions.DurableTask 2.13.4; the issue is done when the app deploys and starts without the ambiguous-constructor error while retaining a supported extension setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, node.js
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.