Azure / azure-functions-durable-extension

Durable Task Framework extension for Azure Functions
MIT License
713 stars 268 forks source link

Durable function created in Isolated worker in a separate project throwing binding type not registered error #2825

Closed arunmk-ms closed 4 months ago

arunmk-ms commented 4 months ago

Description

A durable function created in Isolated worker in a separate project is throwing the below error. I am able to reproduce this issue and a sample project is attached.

The 'HelloCitiesOutside' function is in error: The binding type(s) 'orchestrationTrigger' are not registered. Please ensure the type is correct and the binding extension is installed.
The 'SayHelloOutside' function is in error: The binding type(s) 'activityTrigger' are not registered. Please ensure the type is correct and the binding extension is installed.
The 'StartHelloCitiesOutside' function is in error: The binding type(s) 'durableClient' are not registered. Please ensure the type is correct and the binding extension is installed.

Expected behavior

Isolated worker has to be started and the new activity and orchestration function should be available.

Actual behavior

Isolated worker is started with the above error.

Relevant source code snippets

TestApp.zip

Known workarounds

All the functions have to be moved to startup project for the activity and orchestration trigger to be enabled.

App Details

Screenshots

image
bachuv commented 4 months ago

Hi @arunmk-ms , it looks like the Durable Functions extension isn't installed or properly configured. Can you check if the project dependencies are getting resolved correctly?

image

Also, in Visual Studio, you can check under "Project" > "Manage NuGet Packages" if the correct Durable Functions Isolated project is installed.

arunmk-ms commented 4 months ago

Hi @bachuv , the DurableTask extension is already present. You can see the same in the sample project attached as well.

image
davidmrdavid commented 4 months ago

@arunmk-ms: Can you please clarify what you mean by the following workaround

All the functions have to be moved to startup project for the activity and orchestration trigger to be enabled.

A quick explanation of the before and after would help.

davidmrdavid commented 4 months ago

I downloaded the zip, and I think I understand the set up now - your orchestrator functions are registered in a csproj outside of the main Azure Functions app project. I', not fully certain if this is supported.

@liliankasem - is this something we support in the .NET isolated worker? To split your functions across several projects? Not sure if the function indexing works in this case.

satvu commented 4 months ago

@davidmrdavid We do support indexing functions in dependencies (see here), and I see that the functions in the dependency are are included in the generated metadata for this repro. I wonder if the extension package needs to be installed on the "main" app and not just the dependency?

The error comes from this part of the host, and I'm not super familiar with it, but is there a chance the extension loader does not take into consideration extensions in dependencies?

satvu commented 4 months ago

Actually, @arunmk-ms can you upgrade the worker SDK to 1.17.2 or higher? Does that fix your issue?

davidmrdavid commented 4 months ago

changing the SDK to 1.17.2, as described above, worked for me:

<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.2" PrivateAssets="All" />