每次调试启动时,耐用功能的编排功能会自动触发

发布于 2025-02-08 23:22:26 字数 1037 浏览 2 评论 0原文

我正在尝试实现具有少数顺序和并行活动函数的耐用函数。

这是我的编排器

    [FunctionName("Orchestration")]
    public static async Task<List<string>> RunOrchestrator(
        [OrchestrationTrigger] IDurableOrchestrationContext context)
    {
        var outputs = new List<string>();
        var data = context.GetInput<OrchestrationInput>();
        // Replace "hello" with the name of your Durable Activity Function.
        outputs.Add(await context.CallActivityAsync<string>("ConfigMetadata", data.Payload));
        outputs.Add(await context.CallActivityAsync<string>("ObjectMetadata", "Seattle"));
        outputs.Add(await context.CallActivityAsync<string>("Versioning", "London"));

        // returns ["Hello Tokyo!", "Hello Seattle!", "Hello London!"]
        return outputs;
    }

最初是如此,当我调用Postman的HTTP触发功能时,很明显受到打击,但是由于某些错误,我停止了调试。

然后,每当我再次执行(调试)函数时,在策划器函数触发器上方触发并调用活动函数,而无需调用HTTP触发器。

所以我想这是因为历史上的一些队列。因此,每次我开始调试时,都有任何方法可以摆脱这个问题。因此,当我开始时,它一定是新的队列。

请帮忙

I am trying to implement a durable function with few sequential and parallel activity functions.

Here is my Orchestrator is

    [FunctionName("Orchestration")]
    public static async Task<List<string>> RunOrchestrator(
        [OrchestrationTrigger] IDurableOrchestrationContext context)
    {
        var outputs = new List<string>();
        var data = context.GetInput<OrchestrationInput>();
        // Replace "hello" with the name of your Durable Activity Function.
        outputs.Add(await context.CallActivityAsync<string>("ConfigMetadata", data.Payload));
        outputs.Add(await context.CallActivityAsync<string>("ObjectMetadata", "Seattle"));
        outputs.Add(await context.CallActivityAsync<string>("Versioning", "London"));

        // returns ["Hello Tokyo!", "Hello Seattle!", "Hello London!"]
        return outputs;
    }

So initially when I call the http trigger function from postman it got hit obviously, but due to some error I stopped the debugging.

Then whenever I execute (Debug) the function again, above orchestrator function triggers and calling the activity functions without even calling the http trigger.

So I guess its because of some queue in history. So is there is any way to get rid of this issue every time I start the debugging. So when I start it must be a fresh queue.

Please help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温馨耳语 2025-02-15 23:22:26
  • @user1672994建议使用新的队列启动管弦乐器函数,您可以使用 azure core 用于清除编排实例状态的工具。

  • 首先安装azure core工具您的特定Azure功能版本,下面是用于安装Azure Core Tools

    的NPM软件包管理器

npm install -g azure-functions-core-tools@3
  • 需要您的功能host.json
func durable 
  • >文件在root目录中打开命令
func durable purge-history
  • As suggested by @user1672994 to start orchestrator function with a fresh queue you can use Azure Core tools for purging the orchestration instance state.

  • Install the Azure core tools first in your particular Azure function version, below is the NPM package manager for installing Azure Core tools

npm install -g azure-functions-core-tools@3
  • As azure core tools require your function host.json file open the command prompt in root directory to identify your orchestration functions.
func durable 
  • Below is the command for purging instance history
func durable purge-history
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文