Sim*_*ter 3 azure azure-storage-blobs azure-functions
I have the following Azure function triggered when a file is uploaded to Blob Storage
[FunctionName("ImageAnalysis")]
public static async void Run(
[BlobTrigger("imageanalysis/{name}", Connection = "AzureWebJobsStorage")] Stream myBlob,
string name,
TraceWriter log)
{
log.Info($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
}
Run Code Online (Sandbox Code Playgroud)
I want to process the Blob that has been uploaded so ideally I would like it as a CloudBlockBlob instead of a Stream. Then I can just do some work and then delete the blob.
myBlob.DeleteIfExists()
Run Code Online (Sandbox Code Playgroud)
是否有一种简单的方法可以将Stream转换或转换为CloudBlockBlob,还是需要使用输入/输出绑定或其他方法?
查看文档,我看到了使用CloudBlockBlob的示例,但似乎无法正常运行,因此认为我缺少了什么?
使用此语法进行绑定。技巧是FileAccess.ReadWrite在属性中指定。出于某种原因,这些文档相当混乱地将其称为“ inout”。
[Blob("imageanalysis/{name}", FileAccess.ReadWrite, Connection = "AzureWebJobsStorage")] CloudBlockBlob blob, string name
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2005 次 |
| 最近记录: |