I got requirement to use durable functions for my project work. Our development stack is powershell and I have to trigger orchestrator function from timer trigger function. For triggering I found Start-NewOrchestration command let is used but I have a requirement to pass inputs to it. I couldn't able to find documentation for this command. Can anyone help?
Asked
Active
Viewed 958 times
0
-
Is there any meaninful output for `get-help Start-NewOrchestration`? – Otter Dec 22 '21 at 10:39
-
I'm getting command let not found error, could you please help – Krushna Kumar Dec 22 '21 at 11:34
-
Have you imported the `Microsoft.Azure.Functions.PowerShellWorker` module yet? – Otter Dec 22 '21 at 11:38
1 Answers
2
Try using below PowerShell Cmdlets:
# Client Function - DurableFunctionsTimerTrigger/HttpStart
using namespace System.Net
param($Request, $TriggerMetadata)
$FunctionName = $Request.Params.FunctionName
$InstanceId = Start-NewOrchestration -FunctionName $FunctionName
Write-Host "Started orchestration with ID = '$InstanceId'"
$Response = New-OrchestrationCheckStatusResponse -Request $Request -InstanceId $InstanceId
Push-OutputBinding -Name Response -Value $Response
Or
$OrchestratorInput = @{
'TriggeringTime' = Set-Date '2021-01-01'
}
$InstanceId = Start-NewOrchestration -FunctionName $FunctionName -InputObject $OrchestratorInput
Please refer Azure Durable Functions with PowerShell blog and the GitHub article for more detailed information.
-
Thank you got the result as expected. For getting value in orchestrator from context I have used $value=ConvertFrom-Json $Context.Input.tostring() – Krushna Kumar Dec 22 '21 at 13:24