【发布时间】:2018-03-24 06:38:02
【问题描述】:
我在一个 azure blob 中有一个 json,我需要对其进行反序列化并从中获取一个字符串。该字符串是 blob 的名称。然后,我需要将作为此函数输入的 blob 使用我刚刚提取的名称复制到存储容器中。
public static void Run([BlobTrigger("output/{name}", Connection = "AzureWebJobsStorage")]Stream myBlob, string name, TraceWriter log)
using (var sr = new StreamReader(myBlob))
using (var jsonTextReader = new JsonTextReader(sr))
{
var transcript = (someobject)serializer.Deserialize(jsonTextReader, typeof(Transcript));
string blobname = (someobject.Results[0].FileName).Substring(0, name.LastIndexOf('.'));
以上是我当前函数的定义以及我用来从 json.xml 中提取文件名的方法。这可能与 blob 输入和输出绑定有关吗?如果是这样,有没有办法动态分配输出 blob 的名称?
【问题讨论】:
标签: c# azure visual-studio-2017 azure-functions azure-blob-storage