Azure-functions-durable-extension: Cannot bind parameter 'starter' to type DurableOrchestrationClient.

Created on 24 Sep 2019  路  7Comments  路  Source: Azure/azure-functions-durable-extension

Description

Launching the function locally or publishing from Visual Studio works fine, however when deploying from the Azure DevOps task I get this message on start:

Microsoft.Azure.WebJobs.Host: Error indexing method 'MyFunction'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'starter' to type DurableOrchestrationClient. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).

I think it may be related to the fact that VS publishes using a Web Deploy profile while Azure uses Zip Package, but I'm not sure about that.

Expected behavior

Function must start correctly even when deploying from Azure DevOps

Actual behavior

Function fails to start only when deploying from Azure DevOps

Relevant source code snippets

// insert code snippet here

Known workarounds

Provide a description of any known workarounds you used.

App Details

  • Durable Functions extension version (v1.8.3):
  • Azure Functions runtime version (2.0):
  • Programming language used (C#):

Screenshots

If applicable, add screenshots to help explain your problem.

If deployed to Azure

I can't share these details, and I can't even provide the orchestration instance ID as the function is not even starting.

  • Timeframe issue observed:
  • Function App name:
  • Function name(s):
  • Azure region:
  • Orchestration instance ID(s):
  • Azure storage account name:
Needs

Most helpful comment

Could it be related to the extensions.json file?
Seems like this file is created when publishing locally but it's missing in the DevOps build.
It's contents have references to this type: Microsoft.Azure.WebJobs.Extensions.DurableTask.DurableTaskWebJobsStartup

EDIT:
Got it working by adding

dotnet add MyProject package Microsoft.Azure.Webjobs.Script.ExtensionsMetadataGenerator

to my DevOps build definition.
I don't really like this solution, but at least it's working for now.
This makes me think that the issue can be closed as it's not an issue with Durable Functions but rather with dotnet build command not generating the extensions.json file.

All 7 comments

Hi @SS-TT,

Can you share the signature of the function method?

My guess is you've got the parameter typed to DurableOrchestrationClient instead of IDurableOrchestrationClient and may be missing the DurableClient attribute on the parameter.

Thanks for your reply.

Here's the requested signature:

public async Task<IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequest req,
            [OrchestrationClient] DurableOrchestrationClient starter)

If this is a coding issue, I don't understand why it works locally (and also when publishing from VS) while it doesn't work when publishing from Azure DevOps.

Thanks for sharing the function signature. IDurableOrchestrationClient is new in Durable Functions 2.0, so I think @SS-TT's code is correct.

I usually see this error message when the Functions host fails to load the Durable Functions extension. That would imply that its being loaded correctly in your local environment but not after being deployed via Azure DevOps. Can you try to compare the file system artifacts between your local and Azure deployments to see if they are the same?

Could it be related to the extensions.json file?
Seems like this file is created when publishing locally but it's missing in the DevOps build.
It's contents have references to this type: Microsoft.Azure.WebJobs.Extensions.DurableTask.DurableTaskWebJobsStartup

EDIT:
Got it working by adding

dotnet add MyProject package Microsoft.Azure.Webjobs.Script.ExtensionsMetadataGenerator

to my DevOps build definition.
I don't really like this solution, but at least it's working for now.
This makes me think that the issue can be closed as it's not an issue with Durable Functions but rather with dotnet build command not generating the extensions.json file.

I am having this issue as well...

I have had the same issue with an HTTP triggered Azure Function v2, putting strings into a Queue.
The fix proposed by SS-TT worked for me implemented as a Command Line step right after the dotnet build step in CI pipeline.

having the same issue. works perfectly fine locally once deployed I get this error message.

Was this page helpful?
0 / 5 - 0 ratings