I have a simple Azure Functions app, which includes HTTP trigger and a durable orchestration function, which the trigger invokes. This app runs fine when tested locally, but fails when it runs on Azure. The error coming from the orchestrator function is:
07-df83-4d2d-8023-ad4da1eed437, Duration=107ms)Unable to cast object of type 'System.String' to type 'Microsoft.Azure.WebJobs.Extensions.DurableTask.IDurableOrchestrationContext'.
Here is the code for the HTTP trigger:
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.DurableTask;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
public static class DurableHttpStart
{
[FunctionName("DurableHttpStart")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequest req,
[DurableClient] IDurableOrchestrationClient starter,
ILogger log)
{
// Function input comes from the request content.
string instanceId = await starter.StartNewAsync("OrchestratorFunction", null);
log.LogInformation($"Started orchestration with ID = '{instanceId}'.");
return starter.CreateCheckStatusResponse(req, instanceId);
}
}
And here is the code for the orchestrator function:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.DurableTask;
using Microsoft.Extensions.Logging;
using SpreadsheetGear;
public static class OrchestratorFunction
{
[FunctionName("OrchestratorFunction")]
public static async Task<List<string>> RunOrchestrator(
[OrchestrationTrigger] IDurableOrchestrationContext context)
{
var finalResult = new List<string>();
return finalResult;
}
}
This app is configured as “–dotnet-isolated”
Any ideas how this can be fixed?