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
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:
2016-05-31
.My recommendation would be to go with #1 i.e. use the latest version of Storage Emulator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With