gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 05:23:43 25 4
gpt4 key购买 nike

我需要在我的项目工作中使用持久功能。我们的开发堆栈是 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博客和 GitHub article了解更多详细信息。

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

关于azure - 如何将输入参数传递给 Start-NewOrchestration powershell 命令 let,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70447507/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com