1
votes

If I lost the terminate uri for an active Azure Durable function run, is there a way to recover it? I also don't have the instance id.

2
Thanks @BowmanZhu, but I didn't have the instance id either. Sorry, I should've specified that.Joey Eng

2 Answers

1
votes

In case you don't have the instance ID of the orchestration you can first call this API of your deployed function app:

GET /runtime/webhooks/durableTask/instances?
    taskHub={taskHub}
    &code={systemKey}
    &createdTimeFrom={timestamp}
    &createdTimeTo={timestamp}
    &runtimeStatus={runtimeStatus1,runtimeStatus2,...}
    &showInput=[true|false]
    &top={integer}

Where:

This returns a collection of orchestrations and one of these is the instance you want to terminate. Extract the instanceId and perform the following POST method to terminate the instance:

POST /runtime/webhooks/durabletask/instances/{instanceId}/terminate
    ?taskHub={taskHub}
    &connection={connectionName}
    &code={systemKey}
    &reason={text}

More info: https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-http-api#terminate-instance

1
votes
{
        "id": "d3b72dddefce4e758d92f4d411567177",
        "sendEventPostUri": "http://localhost:7071/runtime/webhooks/durabletask/instances/d3b72dddefce4e758d92f4d411567177/raiseEvent/{eventName}?taskHub={taskHub}&connection={connection}&code={systemKey}",
        "statusQueryGetUri": "http://localhost:7071/runtime/webhooks/durabletask/instances/d3b72dddefce4e758d92f4d411567177?taskHub={taskHub}&connection={connection}&code={systemKey}",
        "terminatePostUri": "http://localhost:7071/runtime/webhooks/durabletask/instances/d3b72dddefce4e758d92f4d411567177/terminate?reason={text}&taskHub={taskHub}&connection={connection}&code={systemKey}"
    }

PS: get the ID from your Azure Table