如何将输入参数传递给 Start-NewOrchestration powershell 命令让

How to pass input parameters to Start-NewOrchestration powershell command let

我被要求在我的项目工作中使用持久函数。我们的开发堆栈是 powershell,我必须从定时器触发器函数中触发协调器函数。为了触发,我发现使用了 Start-NewOrchestration 命令 let 但我需要将输入传递给它。我无法找到此命令的文档。有人可以帮忙吗?

尝试使用以下 PowerShell Cmdlet:

# 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

或者

$OrchestratorInput = @{
    'TriggeringTime' = Set-Date '2021-01-01'
}
$InstanceId = Start-NewOrchestration -FunctionName $FunctionName -InputObject $OrchestratorInput

更多详细信息请参考Azure Durable Functions with PowerShell blog and the GitHub article