I finally reproduced this issue with the code below. I am simply triggering a durable function with a blob trigger, and in one of the activity functions I read the blob. BUT... when I read the blob I get an error that the blob doesn't exist.
Can someone explain what I am doing wrong here?
Code:
[FunctionName("BlobTrigger")]
public static async void Trigger(
[BlobTrigger("incoming-blob/{filename}", Connection = "")]Stream myBlob,
[OrchestrationClient]DurableOrchestrationClient starter,
string filename,
ILogger log)
{
var instanceId = await starter.StartNewAsync("Orchestrator", filename);
}
[FunctionName("Orchestrator")]
public static async Task RunOrchestrator(
[OrchestrationTrigger] DurableOrchestrationContext context)
{
var filename = context.GetInput<string>();
await context.CallActivityAsync("Read_Blob", filename);
}
[FunctionName("Read_Blob")]
public static async Task Activity(
[ActivityTrigger] string filename,
[Blob("incoming-blob")] CloudBlobContainer container,
ILogger log)
{
var stream = new MemoryStream();
var blob = container.GetBlockBlobReference(filename);
await blob.DownloadToStreamAsync(stream);
//EXCEPTION THROWN AT ABOVE LINE.
stream.Dispose();
}