【问题标题】:The REST version of this request is not supported by this release of the Storage Emulator此版本的存储模拟器不支持此请求的 REST 版本
【发布时间】:2019-11-05 15:55:10
【问题描述】:

升级我的 Azure 存储资源管理器版本后,我的代码停止工作并显示以下消息:

"此版本不支持此请求的 REST 版本 存储模拟器。请将存储模拟器升级到 最新版本。有关详细信息,请参阅以下 URL: http://go.microsoft.com/fwlink/?LinkId=392237"

我的 Azure 存储资源管理器版本是 0.8.16。

上传到 azure 的代码基本上是这样的:

CloudStorageAccount storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true");        
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer blobContainer = blobClient.GetContainerReference("mycontainer");
blobContainer.CreateIfNotExistsAsync();
CloudBlockBlob blockBlob = this.blobContainer.GetBlockBlobReference(fileName);
byte[] CoverImageBytes = null; 
BinaryReader reader = new BinaryReader(file.OpenReadStream()); 
CoverImageBytes = reader.ReadBytes((int)file.Length);
await blockBlob.UploadFromByteArrayAsync(CoverImageBytes, 0,(int)file.Length);

在最后一行抛出异常。

更新

1) 你运行的存储模拟器是什么版本的?

V5.1

2) 在您的代码中,您使用的存储客户端库的版本是什么?

8.4.0 here

【问题讨论】:

  • 我认为这个错误与 Azure 存储资源管理器没有任何关系。你能告诉我们:1)你运行的存储模拟器是什么版本的? 2) 在您的代码中,您使用的存储客户端库的版本是什么?
  • 忘了提及所有这些信息。更新了问题,谢谢@GauravMantri

标签: c# azure azure-storage


【解决方案1】:

您收到此错误的原因是因为 Storage Client Library 8.4 以 REST API 版本 2017-04-17 为目标,而 Storage Emulator 5.1 版本以 REST API 版本 2016-05-31 为目标。

你可以做以下两件事之一:

  1. 安装最新版本的存储模拟器(目前为 5.2)。
  2. 将存储客户端库降级到支持 REST API 版本 2016-05-31 的 8.3。

我的建议是使用 #1,即使用最新版本的存储模拟器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-06-29
    • 2020-03-19
    • 2022-07-08
    • 2016-06-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多