我终于用下面的代码重现了这个问题。我只是用 blob 触发器触发了一个持久函数,并且在其中一个活动函数中我读取了 blob。但是...当我阅读 blob 时,我收到一个错误,即 blob 不存在。
有人可以解释我在这里做错了什么吗?
代码:
[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();
}