【发布时间】:2021-12-10 22:18:54
【问题描述】:
我创建了一个 blob 触发 azure 函数,每当将新文件(在我的情况下为 excel 文件)添加到 blob 存储时都会调用该函数。谁能建议如何从blob存储中获取文件数据并使用epplus将其转换为excel。
public void Run([BlobTrigger("myblobcontainer/{name}", Connection = "AzureStorage")]CloudBlockBlob myBlob, string name, ILogger log)
{
try
{
ProcessData(myBlob,name);
}
catch (Exception ex)
{
}
}
public int ProcessData(CloudBlockBlob myBlob, string name)
{
CloudStorageAccount IMAccount;
IMAccount = CloudStorageAccount.Parse("my azure storage connection");
var blobReference= //Get the path of file in blob
//Basically here I want to read 'myBlob' and convert it back into excel
}
我有点困惑如何在 blob 中获取文件的路径(在 var blobReference 中)并使用 epplus 将其转换为 excel。
任何人,请建议如何做到这一点。
【问题讨论】:
-
以下内容可能会有所帮助:stackoverflow.com/questions/68982086/…
标签: c# azure-functions blob export-to-excel epplus