Home > front end >  How to pass input parameters to Start-NewOrchestration powershell command let
How to pass input parameters to Start-NewOrchestration powershell command let

Time:12-23

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?

CodePudding user response:

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.

How to pass a POST parameter to a Durable Function and then pass this param to a Timer Triggered function

  • Related