Hi @Aml Abbas Thank you for sharing additional information on this. I have looked deeper into this issue and you are correct that you would not need an explicit Task<string>
returned from the orchestrator function. The method call ScheduleNewOrchestrationInstanceAsync
on the DurableTaskClient
returns a Task<String>
which has the value for the Instance ID.
Even though the function signatures look same in the cases where the migration is successful vs unsuccessful, I see that in the initial function, you are using WebhookResponse object and JSON serialization. I would like to note that the isolated worker model uses System.Text.Json by default whereas the in-process model uses Newtonsoft.Json
You can modify this behavior by reassigning the Serializer
property on the WorkerOptions
configuration. The following example shows this using ConfigureFunctionsWebApplication
var host = new HostBuilder()
.ConfigureFunctionsWebApplication((IFunctionsWorkerApplicationBuilder builder) =>
{
builder.Services.Configure<WorkerOptions>(workerOptions =>
{
var settings = NewtonsoftJsonObjectSerializer.CreateJsonSerializerSettings();
settings.ContractResolver = new CamelCasePropertyNamesContractResolver();
settings.NullValueHandling = NullValueHandling.Ignore;
workerOptions.Serializer = new NewtonsoftJsonObjectSerializer(settings);
});
})
.Build();
Please refer the article section - Customizing JSON serialization for more details.
Here is another article for your reference to get more information on behavior changes when Migrating from Newtonsoft.Json to System.Text.Json
If you still encounter the issue after trying the above steps, please share the error stack from the Azure function logs to help us better understand the origination of the issue.
If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.