0

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

Sandeep Thomas
  • 4,303
  • 14
  • 61
  • 132
  • Does this answer your question? [Azure Durable Function Invoke without HttpTrigger (Autostart)](https://stackoverflow.com/questions/54608103/azure-durable-function-invoke-without-httptrigger-autostart) – Ecstasy Jun 21 '22 at 04:24
  • [Durable orchestrations](https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-orchestrations?tabs=csharp) – Ecstasy Jun 21 '22 at 04:25
  • 2
    Does this answer your question? [Clearing history while debugging azure durable functions](https://stackoverflow.com/questions/59011788/clearing-history-while-debugging-azure-durable-functions) – user1672994 Jun 21 '22 at 04:26
  • @user1672994 Perfect... That solved the issue – Sandeep Thomas Jun 23 '22 at 04:37

1 Answers1

1
  • 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
SaiSakethGuduru
  • 2,218
  • 1
  • 5
  • 15