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

标签 azure powershell azure-functions azure-powershell azure-durable-functions

我需要在我的项目工作中使用持久功能。我们的开发堆栈是 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/

相关文章:

azure - 修改 PowerShell 脚本以更改 Outlook 的默认字体类型和大小

具有 MSDN 优惠的 Azure Visual Studio Professional

azure - 单个 Azure Function 可以有多大?

powershell - 命令未找到异常 : get-windowsoptionalfeature

azure - Azure Function App 的 Visual Studio 2022 和 .net 更新问题

asp.net-core - Azure SignalR Serverless OnConnected-trigger with Azure-functions(传统模型)

Azure Function 详细记录内部服务器错误

Azure 应用程序网关受源 IP 和服务器名称限制

powershell - 无法调用此函数,因为当前主机没有实现它

powershell - 在 Powershell 脚本中翻译逻辑