Forum Discussion
Today on Azure Friday: Durable Functions in Azure Functions
Just few things that should be done before durable functions can be used (at least created in the Portal): https://markheath.net/post/create-durable-functions-azure-portal
Moreover, the documentation currently is pretty poor. For example, I cannot understand how I can upgrade my existing function that is triggered by BlobTrigger (as soon as new file is uploaded to the specific container) and does basically some computation of the contents of uploaded CSV file. That is a good candidate for rewriting to the durable fan-out fan-in function. So, challenge for me is to understand how to trigger orchestrator by BlobTrigger.
Trying to find the way, appreciate any information :)
You can use the samples in the GitHub repository as a reference. For example, there are two sample functions that show how you can trigger new orchestration instances:
HttpTrigger: https://github.com/Azure/azure-functions-durable-extension/blob/master/samples/csx/HttpStart/run.csx
ManualTrigger: https://github.com/Azure/azure-functions-durable-extension/blob/master/samples/csx/ManualStart/run.csx
From these samples, you should be able to figure out how to use other trigger types. Here is an example of how you might start an orchestration from a blob trigger:
run.csx
#r "Microsoft.Azure.WebJobs.Extensions.DurableTask"
using System;
public static async Task Run(string blobData, DurableOrchestrationClient starter, TraceWriter log)
{
log.Info("Starting orchestration.");
string instanceId = await starter.StartNewAsync("MyOrchestrator", blobData);
log.Info($"Started orchestration with ID = '{instanceId}'.");
}
function.json
{
"bindings": [
{
"type": "blobTrigger",
"direction": "in",
"name": "blobData"
},
{
"name": "starter",
"type": "orchestrationClient",
"direction": "in"
}
],
"disabled": false
}