【问题标题】:Azure Blob Storage (Development Connection Issue)Azure Blob 存储(开发连接问题)
【发布时间】: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


【解决方案1】:

我必须启动本地存储模拟器,我在查看的教程中已经完全了解了该模拟器。谢谢你的小费肯尼斯!

请看这里: https://azure.microsoft.com/en-us/documentation/articles/storage-use-emulator/#authenticating-requests-against-the-storage-emulator

【讨论】:

    猜你喜欢
    • 2022-08-03
    • 2020-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-11
    • 2017-09-17
    • 1970-01-01
    • 2022-12-11
    相关资源
    最近更新 更多