尝试使用以下代码上传文件时出现以下异常:
string encodedUrl = "videos/Sample.mp4"
CloudBlockBlob encodedVideoBlob = blobClient.GetBlockBlobReference(encodedUrl);
Log(string.Format("Got blob reference for {0}", encodedUrl), EventLogEntryType.Information);
encodedVideoBlob.Properties.ContentType = contentType;
encodedVideoBlob.Metadata[BlobProperty.Description] = description;
encodedVideoBlob.UploadFile(localEncodedBlobPath);
我看到“得到 blob 引用”消息,所以我认为引用正确解析。
Void Run() C:\Inter\Projects\PoC\WorkerRole\WorkerRole.cs (40)
System.ArgumentNullException: Value cannot be null.
Parameter name: value
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
at Microsoft.WindowsAzure.StorageClient.CloudBlob.UploadFromStream(Stream source, BlobRequestOptions options)
at Microsoft.WindowsAzure.StorageClient.CloudBlob.UploadFile(String fileName, BlobRequestOptions options)
at EncoderWorkerRole.WorkerRole.ProcessJobOutput(IJob job, String videoBlobToEncodeUrl) in C:\Inter\Projects\PoC\WorkerRole\WorkerRole.cs:line 144
at EncoderWorkerRole.WorkerRole.Run() in C:\Inter\Projects\PoC\WorkerRole\WorkerRole.cs:line 40
有趣的是,我正在从本地服务器(即在 Azure 之外)运行相同的代码段,并且它可以正常工作。
欢迎提出想法,谢谢!