2

I'm creating an Azure Durable function app where the orchestrator run for a while but I need an option to cancel the orchestrator if needed. I'm trying to use the "terminatePostUri" from Postman but it gives me a 404 response.

Other instance management uris like statusQueryGetUri are working as expected.

Here's a code snippet of my Terminate Function.

[FunctionName("klaviyo_terminate_instance")]
public static Task Run([DurableClient(TaskHub = "%KlaviyoTaskHub%")] IDurableOrchestrationClient client,
    [QueueTrigger("terminate-queue")] string instanceId)
{
    return client.TerminateAsync(instanceId, "Called for terminate instance");
}

Here's the postman response.

enter image description here

Pratik
  • 204
  • 2
  • 14

1 Answers1

4

So apparently the terminate uri works as a POST request (but not GET) despite not having any payload. Not sure what the reason for that is.

Source: https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-http-api

Pratik
  • 204
  • 2
  • 14
  • 1
    It’s a best practice in REST API design that GET should be idempotent and not have side effects. Terminate does not meet this criteria, which is why it is instead POST. – Chris Gillum Apr 12 '21 at 13:38