【发布时间】:2016-09-23 00:48:15
【问题描述】:
我已开始在我的应用程序中实现 Azure Blob 存储,但在使用开发连接字符串 ("UseDevelopmentStorage=true;") 时,很遗憾在此处尝试创建容器时失败:
例外情况是: Microsoft.WindowsAzure.Storage.StorageException 未被用户代码处理 内部异常: Message=发送请求时发生错误。 源=System.Private.CoreLib 内部异常: H结果=-2147012867 Message=无法与服务器建立连接 源=System.Private.CoreLib ....
我的代码:
public async void UploadBlob(IFormFile file, string containerReference, string blobReference)
{
var container = _blobClient.GetContainerReference(containerReference);
await container.CreateIfNotExistsAsync();
var blockBlob = container.GetBlockBlobReference(blobReference);
using (var fileStream = file.OpenReadStream())
{
await blockBlob.UploadFromStreamAsync(fileStream);
}
}
有什么我无法连接的想法吗?
谢谢,尼克
【问题讨论】:
-
你启动本地存储模拟器了吗?
-
我该如何开始呢?我可以在 VS 的 SQL Server 对象资源管理器中看到 AzureStorageEmulatorDb45,但还没有启动任何东西..
标签: c# asp.net-core azure-blob-storage