Azure / Azure/azure-functions-dotnet-worker

CreateCheckStatusResponse does not work when `HttpRequestMessage` is used (no built-in Function HTTP types)

Open
#2,361 4 comments 1 reaction 0 assignees View on GitHub
area: http extensions: durable-functions needs-investigation potential-bug
Dominant language
C#
Stars
466
Forks
215
Avg merge
3d 10h
Merged PRs (30d)
7

Description

### Description

When using ` .ConfigureFunctionsWebApplication()` instead of `.ConfigureFunctionsWorkerDefaults()` (following https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide?tabs=windows#aspnet-core-integration) and we have an http trigger endpoint to start an orchestration like the following:

```csharp
[Function(nameof(HttpStart))]
public static async Task HttpStart(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequest req,
[DurableClient] DurableTaskClient client,
FunctionContext executionContext)
{
ILogger logger = executionContext.GetLogger(nameof(HttpStart));

// Function input comes from the request content.
string instanceId = await client.ScheduleNewOrchestrationInstanceAsync(
nameof(RunOrchestrator));

logger.LogDebug("Started orchestration with ID = '{instanceId}'.", instanceId);

// Returns an HTTP 202 response with an instance management payload.
// See https://learn.microsoft.com/azure/azure-functions/durable/durable-functions-http-api#start-orchestration
return client.CreateCheckStatusResponse(req, instanceId);
}
```
The line ` return client.CreateCheckStatusResponse(req, instanceId);` gives a compile error, because `req` is not an `HttpRequestData` type.
We would really love to use the ASP.NET Core integration to use normal .NET 8 types instead of using the built-in Function HTTP (`HttpRequestData` and `HttpResponseData`) types.

Looking forward to hear from you guys,
Regards,

Tom

_If this is not the right repository to mention the issue, my apologies_

### Steps to reproduce

Use the Durable Functions template in Visual Studio 2022 Preview to create the durable functions (isolated) and change the line in the startup to use the ASP.NET core .NET8 http types instead of the built-in function http types.
Then in the HTTP-trigger to start the orchestration change the `HttpRequestData` type in `HttpRequestMessage` will fail the `CreateCheckStatusResponse(...)` function to compile.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Durable Functions template and the HTTP-trigger example described in the issue, comparing ConfigureFunctionsWebApplication() with ConfigureFunctionsWorkerDefaults(). Reproduce the compile error at CreateCheckStatusResponse(req, instanceId) when the trigger uses ASP.NET Core HTTP types. Done means the ASP.NET Core integration scenario can create the orchestration status response without requiring the built-in Function HTTP types.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
api, backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.