Background

I'm a procrastinator. Where others see an obstacle to surmount, I see an opportunity to put something away for later. Which is exactly what I did for my Erlang wrapper around the Windows Azure a few days ago. I discovered that Erlang didn't support SHA 256 out of the box, necessary for the HMAC-SHA256 needed for authenticating storage requests, I threw up my hands in a mediocre blog post, filed away my code for a later date when either Erlang added SHA 256 support to the crypto module (likely) or when I got around to implementing SHA 256 myself (not likely).

However, my procrastination this time was short lived. Steve Vinoski showed up in the comments and to my astonishment, whipped together a SHA-256 implementation. Having run out of excuses, I spent some time and finished up my client. Along the way, I wrote a HMAC-SHA256 module in Erlang which was an interesting exercise as well. You can find the GitHub project here. It's in its infancy and can only deal with blobs at the moment. But I am taking feature requests so holler if you need something.

Sample

I'm still unsure of the right idiomatic way to do most things in Erlang. I've created it using the gen_server OTP framework though in retrospect, a simple module would have sufficed. Here's some sample test code which accesses storage (the key and account for the local development storage which runs on my machine).

	-module(winazuretest).
	-export([test/0]).

		test() ->
  		winazure:start({"",
		"",
		true}),
  		winazure:create_container("test",true),
  		winazure:put_blob("test","blob1","Hello!","text/plain"),
  		"Hello!" = winazure:get_blob("test","blob1"),
  		winazure:delete_blob("test","blob1"),
  		winazure:delete_container("test").


Observations

#