Helping one of my partners recently, I learned that the Windows Azure Storage APIs are being evolved in the past years and at each new version of the API a series of new features are implemented..
However, for backward compatibility reasons, the standard access to the APIs are always made based on the first version of the API.
For us to be on the same page, the Windows Azure Storage has 3 storage services and all the APIs are accessed by REST (Http or Https) or by native SDKs for Java, .NET, iOS, PHP, Python and Node.js:
-Blob Storage: a service to store files or large volumes of unstructured data
-Table Storage: “a NoSQL database” highly scalable to store strutuctured entities
-Queue Storage: to send and receive messages, very useful for asynchronous processing
It is important to remember that all of these services are automatically and highly scalable (using best practices, of course) and are locally and geographically redundant.
Going back to the new features and versioning of the API, there are two ways of using the latest API version:
1) Adding a request header in each request.
The advantage of this method is that new versions of the API will not “break” your code.
The disadvantage is that if you are accessing the blob directly from the browser (downloading a blob, for instance), the browser will not include the custom header.
A sample of the header:
x-ms-version: 2012-02-12
2) Setting the default version that every request will be served.
The advantage is that any request, including coming from a webbrowser, will be served using the features of the selected version.
The disadvantage is that it can (very UNlikely) break some of your “legacy code”.
Check how to do it with only 5 lines of C# code (you just need to run it once)
var storageAccount = CloudStorageAccount.Parse(“AccountName=;AccountKey=;DefaultEndpointsProtocol=http”);
var blobClient = storageAccount.CreateCloudBlobClient();
var serviceProperties = blobClient.GetServiceProperties();
serviceProperties.DefaultServiceVersion = “2012-02-12″;
blobClient.SetServiceProperties(serviceProperties);
The latest version of the API so far is: 2012-02-12
To learn about the available versions and their features go to: http://msdn.microsoft.com/en-us/library/windowsazure/dd894041.aspx
Ah, I almost forgot about this post title
In order to enable that browsers, downloaders and video players download different ranges of a blob file (for instance, when you perform a seek operation in a playing video, or when you want to resume an interrupted download), you need to set the default version to 2011-08-18 or later, using the second method I wrote above.
Happy blobing,
Vitor Ciaramella