0

I have an Azure Durable function as follows:

       [FunctionName("Function1_HttpStart")]
        public async Task<IActionResult> HttpStart(
        [HttpTrigger(AuthorizationLevel.Anonymous, "post")]
        HttpRequest req,
        [DurableClient] IDurableOrchestrationClient starter,
        ILogger log)
    {
        
        //code to get requestBodyContent from req hidden

        var instanceId = await starter.StartNewAsync("MyOtherFunction", requestBodyContent);

        return starter.CreateCheckStatusResponse(req, instanceId);
     }

In the final line, the call to CreateCheckStatusResponse returns HTTP 202 as expected in the Azure Storage Emulator and the durable function executes with expected results.

When I run the same code within a Docker orchestration consisting of a function container and an Azurite container then the durable function still executes with expected results but CreateCheckStatusResponse returns a HTTP 500.

I would like to understand why the HTTP return code is behaving differently for the 2 different environments.

AppInsights doesn't show any issues. Reading the documentation the method is not supposed to return 500 unless we specifically set a third boolean parameter.

Using .NETCore 3.1
Azure Functions V3

Paul
  • 1,483
  • 14
  • 32

1 Answers1

0

So I was able to find a solution - the problem was not Azurite, that is irrelevant in the OP.
The problem occurs when hosting a durable function within docker.
I came across the answer in this post.

Simply add the following config:

WEBSITE_HOSTNAME=localhost:30042
Paul
  • 1,483
  • 14
  • 32