繁体   English   中英

Azure Blob存储(开发连接问题)

[英]Azure Blob Storage (Development Connection Issue)

我已经开始在应用程序中实现Azure Blob存储,使用开发连接字符串(“ UseDevelopmentStorage = true;”)时,不幸的是,在此处尝试创建容器时失败:

例外是: 用户代码InnerException未处理Microsoft.WindowsAzure.Storage.StorageException:Message =发送请求时发生错误。 Source = System.Private.CoreLib InnerException:HResult = -2147012867消息=无法建立与服务器的连接Source = 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);
        }
    }

有什么想法为什么我无法连接?

谢谢,尼克

我必须启动本地存储仿真器,在我看过的教程中已经完全监督了该仿真器。 谢谢您的小费肯尼斯!

请参阅此处: https : //azure.microsoft.com/zh-cn/documentation/articles/storage-use-emulator/#authenticating-requests-against-the-storage-emulator

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM