Little bit new to azure durable function. I am trying out fanout/fanin Concept within the azure function.
[FunctionName("MasterListUpdate")]
public async Task<List<Task<string>>> RunOrchestrator(
[OrchestrationTrigger] IDurableOrchestrationContext context)
{
var outputs = new List<Task<string>>();
var datalist = context.GetInput<List<string>>();
foreach (var state in StateList.States)
{
outputs.Add(context.CallActivityAsync<string>("UpdatingTheDataSet", state));
}
await Task.WhenAll(outputs.ToArray());
return outputs.ToList();
}
[FunctionName("UpdatingTheDataSet")]
public async Task<string> AddData([ActivityTrigger]string state,ILogger log)
{
await _insertingAllData.UpdatingReleventData(state, log);
return state;
}
[FunctionName("DurableFunctionStart")]
public async Task HttpStart(
[TimerTrigger("0 */60 * * * *"
#if DEBUG
,RunOnStartup =true
#endif
)]
TimerInfo myTimer,
[DurableClient] IDurableOrchestrationClient starter,
ILogger log)
{
// Function input comes from the request content.
string instanceId = await starter.StartNewAsync("MasterListUpdate", StateList.States);
log.LogInformation($"Started orchestration with ID = '{instanceId}'.");
}
try to trigger a timer function Using azure durable function.Locally this work fine. When try to host in azure portal
it throw a error like this. Could not able to find out where I am doing wrong here.
** Note:- StateList.States this is a static list.
Locally this work fine**
2
Answers
We tried to reproduced the same scenario and its working fine.
Here you are facing the issue and it may be cause for the error.
So, rewriting this code as below example and it’s working as expected.
Example Code :-
Output : –
Kudo output :-
I was getting the same cryptic error message along with a FunctionInvocationException (related to the Orchestrator) when trying to invoke the Orchestrator function from the Azure portal (in my case, I as testing it through the Code + Test section).
After lots of researching, I found out invoking the Orchestrator through the Azure portal is not allowed. Invoking it through a tool like Postman worked without any issues. I hope this saves others some time.