I’ve known about vaasnet for quite a while. Basically, vaasnet is a way to almost instantly (OK, it took about 4 seconds to come up) grab a fresh VM (currently 99 cents an hour), do a bunch of stuff and go away. My bunch of stuff was I need to download a bittorrent file that was about 5 gig and I know if I do it from either home or over my hotspot, bad things will happen. If I do it at home, Comcast will send me a letter accusing me of stealing something, and if I use my Verizon hotspot, well, it’s a 5 gig per month plan. You do the math.
Back to vaasnet. Here is my experience today:
- 30 seconds to put my credit card it
- 4 seconds to boot a general purpose workstation
- 5 seconds to RDP into it
- 2 minutes to download bit torrent
- 35 minutes to have bit torrent download a 5 gig file!
- 35 minutes to have bit torrent download a 5 gig file (had to say it twice)
- 1 minute to transfer the file to my ORCSWeb server I already have
- $1.70 billed to my credit card.
- OMG!
I think that about says it all. OK, maybe not it all.
I’ll be back!
OK, now that says it all.

Introduction
If you’ve started using SqlAzure for your SqlServer with your Azure application, you’ve probably discovered that you get a reasonable number of connection failures. The advice from the Azure team is add retry logic to all your connections to SqlAzure. There is a long discussion posted by the Azure team here.
The key paragraph states the problem as follows:
The Problem
One of the things that SQL Azure does to deliver high availability is it sometimes closes connections. SQL Azure does some pretty cool stuff under the covers to minimize the impact, but this is a key difference in SQL Azure development vs. SQL Server development.
Basically, what this means is that you must be able to deal with connections failing when you call SqlAzure. Something that all of probably should have been doing forever, but because most of the time SqlServer is running on your local LAN and the likelihood if a connection failing was next to zero unless something else was going terribly wrong. Certainly not something we had to do on regular basis. To emphasize that even more, most of the controls built into asp.net that open connections to sqlserver don’t even do this and that’s from Microsoft itself.
The solution proposed in the thread mentioned above basically has you add tons of code to everyplace you access a connection object. Personally, I don’t like that because I have hundreds if not thousands of places I open connections and inserting tens of thousands of lines of extra new untested code is a little scary.
So, what to do?
Fortunately, another team at Microsoft, known as the Windows Server AppFabric Customer Advisory Team published a general purpose solution using Extension Methods and some darn clever coding wrote a great article and published code including azure examples that solves this problem very elegantly without requiring a lot of changes to your existing code base.
In this article I plan on giving an example and publishing a sample project that uses this code with SqlAzure to solve the connection retry problem. My goal here is not to simply restate what they published but to simply have a very simple concrete example of using their library.
(more…)