Visitar URL original
.NET: Error running an Azure Function following samples and using NuGet packages for Microsoft.Agents.AI.Hosting.AzureFunctions and Microsoft.Agents.AI.OpenAi · Issue #2327 · microsoft/agent-framework · GitHub
Skip to content

.NET: Error running an Azure Function following samples and using NuGet packages for Microsoft.Agents.AI.Hosting.AzureFunctions and Microsoft.Agents.AI.OpenAi #2327

Closed
Azure/azure-functions-durable-extension
#3265

Description

I'm working with the dotnet samples for Azure Functions. I created a new solution with a new function setting it up just like one of the samples referencing the NuGet packages for Microsoft.Agents.AI.OpenAi and Microsoft.Agents.AI.Hosting.AzureFunctions and I'm getting an error consistently.

I took my new function, added it to the agent-framework-dotnet sample solution and changed the package references for Microsoft.Agents.AI.OpenAi and Microsoft.Agents.AI.Hosting.AzureFunctions to use the projects in that solution and my function started to work.

I tried the reverse as well and took one of the sample function apps, put it in my solution and had it get those two packages from NuGet and the sample started to fail with the same error as my function app.

Is there an issue with the NuGet packages? Has anyone else had an issue? Here is the error I see running referencing the NuGet packages.

Microsoft.DurableTask.Entities.EntityOperationFailedException: 'Operation 'RunAgentAsync' of entity '@dafx-@e86fd2952ea25d8787b81c9e14acffbd' failed: Invocation of function 'dafx-' failed with an exception.'

Activity

  1. added
    .NETUsage: [Issues, PRs], Target: .Net
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Nov 19, 2025
  2. changed the title [-]Error running an Azure Function following samples and using NuGet packages for Microsoft.Agents.AI.Hosting.AzureFunctions and Microsoft.Agents.AI.OpenAi[/-] [+].NET: Error running an Azure Function following samples and using NuGet packages for Microsoft.Agents.AI.Hosting.AzureFunctions and Microsoft.Agents.AI.OpenAi[/+] on Nov 19, 2025
  3. removed
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Nov 20, 2025
  4. alliscode commented on Nov 20, 2025

    @alliscode
    Member

    Chris Gillum (@cgillum) could someone from your team take a look at this?

  5. rwjdk commented on Nov 27, 2025

    @rwjdk

    I too can't get the Azure Durable Functions to work... It can get it to work, but get this error when trying to call it as described in the sample (if called with ):

    [2025-11-27T19:51:37.307Z] Function 'dafx-MyAgent', Invocation id 'f40315a0-a3a7-42a7-a360-b2a36f88a2ba': An exception was thrown by the invocation. [2025-11-27T19:51:37.308Z] Result: Function 'dafx-MyAgent', Invocation id 'f40315a0-a3a7-42a7-a360-b2a36f88a2ba': An exception was thrown by the invocation. Type: Exception: Microsoft.Azure.Functions.Worker.FunctionInputConverterException: Error converting 1 input parameters for Function 'dafx-MyAgent': Cannot convert input parameter 'dispatcher' to type 'Microsoft.Azure.Functions.Worker.TaskEntityDispatcher' from type 'System.String'. Error:System.Text.Json.JsonException: 'C' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.

    Based on that it looks like it expect JSON, but if some random JSON is sent you just get:

    400 Bad Request:
    Run request cannot be empty.

    Also, in 01_SingleAgent, there are no normal Azure Functions defined, but when I try that in my Azure Function I get this error:

    [2025-11-27T19:55:54.857Z] Worker failed to index functions [2025-11-27T19:55:54.858Z] Result: Failure Type: Exception: System.IO.FileNotFoundException: Function metadata file not found. File path used:X:\MicrosoftAgentFrameworkSamples\src\FunctionApp.HelloAI\bin\Debug\net10.0\functions.metadata

    Can you confirm that these Samples work?

  6. cgillum commented on Nov 28, 2025

    @cgillum
    Member

    Hi Francisco Merizalde (@FMERI001) and Rasmus Wulff Jensen (@rwjdk). Would it be possible for you to share your reproducer project so we can try it locally? Alternatively, can you share your csproj file contents?

    /cc Shyju Krishnankutty (@kshyju)

  7. cgillum commented on Nov 28, 2025

    @cgillum
    Member

    I was able to reproduce the FunctionInputConverterException issue locally. It looks like it might be a regression in the latest version(s) of the Durable Task dependencies, which are newer than the ones used by the samples in the agent framework repo.

    Can you try pinning to the following nuget package versions and see if that resolves the issue?

    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.9.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask.AzureManaged" Version="1.0.0" />

    The problem appears to be in the 1.11.0 version of Microsoft.Azure.Functions.Worker.Extensions.DurableTask. I tested and both 1.9.0 and 1.10.0 work as expected.

    /cc Tomer Rosenthal (@torosent)

  8. cgillum commented on Nov 28, 2025

    @cgillum
    Member

    To prevent further users from running into this, I've unlisted Microsoft.Azure.Functions.Worker.Extensions.DurableTask v1.11.0. You should be able to use v1.10.0 until we have a fix.

  9. rwjdk commented on Nov 28, 2025

    @rwjdk

    Chris Gillum (@cgillum) Works for me after the nuget package downgrade

  10. rwjdk commented on Nov 28, 2025

    @rwjdk

    Hi @FMERI001 and @rwjdk. Would it be possible for you to share your reproducer project so we can try it locally? Alternatively, can you share your csproj file contents?

    /cc @kshyju

    My version of the code if still interested; https://github.com/rwjdk/MicrosoftAgentFrameworkSamples/tree/main/src/FunctionApp.HelloAI

  11. moved this from In Review to Done in Agent Frameworkon Dec 19, 2025
  12. cgillum commented on Dec 19, 2025

    @cgillum
    Member

    A fix for this issue has been merged. The next release of Microsoft.Agents.AI.Hosting.AzureFunctions should be compatible with the newer Durable Functions packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

.NETUsage: [Issues, PRs], Target: .NethostingUsage: [Issues, PRs], Target: all hosting related solutions

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions