Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The REST version of this request is not supported by this release of the Storage Emulator

After upgrading my version of Azure Storage Explorer, my code stop working with the following message:

"The REST version of this request is not supported by this release of the Storage Emulator. Please upgrade the storage emulator to the latest version. Refer to the following URL for more information: http://go.microsoft.com/fwlink/?LinkId=392237"

My version of Azure Storage Explorer is 0.8.16.

Basically the code to upload to azure tends to be like:

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);

The exception throws at the last line.

UPDATE

1) What is the version of storage emulator you're running?

V5.1

2) In your code, what is the version of Storage Client library you're using?

8.4.0 here

like image 476
Jhonatas Kleinkauff Avatar asked Sep 20 '17 00:09

Jhonatas Kleinkauff


1 Answers

The reason you're getting this error is because Storage Client Library 8.4 targets REST API version 2017-04-17 where as Storage Emulator Version 5.1 targets REST API version 2016-05-31.

You can do one of the two things:

  1. Install latest version of Storage Emulator (5.2 at this time).
  2. Downgrade storage client library to 8.3 which supports REST API version 2016-05-31.

My recommendation would be to go with #1 i.e. use the latest version of Storage Emulator.

like image 115
Gaurav Mantri Avatar answered Oct 05 '22 13:10

Gaurav Mantri