i am facing a weird issue. Searched for multiple question but didn't really get the real fix for this. I have below default template code.
[FunctionName("OrchFunction_HttpStart")]
public async Task<HttpResponseMessage> HttpStart(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestMessage req,
[DurableClient] IDurableOrchestrationClient starter,
ILogger log)
{
// Function input comes from the request content.
string instanceId = await starter.StartNewAsync("OrchFunction", null);
log.LogInformation($"Started orchestration with ID = '{instanceId}'.");
return starter.CreateCheckStatusResponse(req, instanceId);
}
In Orchstrator function i have below code
[FunctionName("OrchFunction")]
public async Task<List<string>> RunOrchestrator(
[OrchestrationTrigger] IDurableOrchestrationContext context)
{
var outputs = new List<string>();
var data = context.GetInput<JobPayload>();
var inst=context.InstanceId;
// returns ["Hello Tokyo!", "Hello Seattle!", "Hello London!"]
return outputs;
}
Issue here is i am getting NULL
in var data = context.GetInput<JobPayload>();
. Not sure why, as its the T type i am passing in the HttpRequestMessage
. i know its wrong but tried with var data = context.GetInput<HttpResponseMessage>();
, stil its null. What is wrong here? i am getting context.InstanceId
value.