/// <summary> /// Invoke an orchestration function. /// </summary> private Hashtable InvokeOrchestrationFunction( PowerShellManager psManager, AzFunctionInfo functionInfo, InvocationRequest invocationRequest, FunctionInvocationPerformanceStopwatch stopwatch) { if (!Utils.AreDurableFunctionsEnabled()) { throw new NotImplementedException(PowerShellWorkerStrings.DurableFunctionNotSupported); } // Quote from https://docs.microsoft.com/en-us/azure/azure-functions/durable-functions-bindings: // // "Orchestrator functions should never use any input or output bindings other than the orchestration trigger binding. // Doing so has the potential to cause problems with the Durable Task extension because those bindings may not obey the single-threading and I/O rules." // // Therefore, it's by design that 'InputData' contains only one item, which is the metadata of the orchestration context. var context = invocationRequest.InputData[0]; var durableFuncContext = JsonConvert.DeserializeObject <OrchestrationContext>(context.Data.String); return(psManager.InvokeOrchestrationFunction(functionInfo, context.Name, durableFuncContext)); }