Windows Azure Storage Services REST API

Hard DriveIn playing Windows Azure, I’ve started getting into the Windows Azure Storage Services REST API. The REST API gives developers from any languages and/or platforms access to all of the Storage from either inside of Windows Azure or outside. It supports both HTTP and HTTPS. With it you can do just about anything that you need to with Blobs, Queues and Tables.

For example, if you want to create a new table in the Windows Azure Table Storage you can just send it a little bit of XML that looks like this:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
	xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
	xmlns="http://www.w3.org/2005/Atom">
  <title />
  <updated>2010-02-04T10:48:34.9840639-05:00</updated>
  <author>
    <name />
  </author>
  <content type="application/xml">
    <m:properties>
      <d:TableName>MyTableName</d:TableName>
    </m:properties>
  </content>
</entry>

There are a couple of small things that are a little wonky.

First, the URL is RESTish to be honest. Check out the last bit of this sample URL that does a search on a set of entities in a table:

http://myaccount.table.core.windows.net/Customers()?$filter=(Rating%20ge%203)%20and%20(Rating%20le%206)

That last part of the filter is something that’s the “ish” part. It’s the query that’s used to search the entities.

The second things that’s a wonky is that there are a handful of things that you can do from the native .NET libraries that you can’t do from the REST interfaces. For example, you can’t do LINQ from the REST interfaces. There are little things like that across all of the storage options but what it really says is that you should use the native libraries where possible.

Third thing that I found a little wonky but it kinda makes sense is that every request against the REST service has to have an authorization code. It is passed in as an HTTP header.

Authorization=”[SharedKey|SharedKeyLite] <AccountName>:<Signature>”

Anyways, I thought it was an interesting set of services and they are really useful especially if you’re doing something other than .NET.

Read more about them at Windows Azure Storage Services REST API

Leave a Reply

Your email address will not be published. Required fields are marked *