Steve Marx Explores Hidden Gems in Windows Azure
Steve Marx, Tactical Strategist for Windows Azure, gave a presentation on MIX11 on "10 Things You Didn’t Know You Could Do with Windows Azure", highlighting a list of things that can be done with Windows Azure but may not be common knowledge. He demonstrates how some of those features makes Windows Azure quite flexible.
Some of things he highlighted are -
Deploy Multiple sites in one Windows Azure role
Configure IIS application pools
Install and use databases like CouchDB on Windows Azure Roles
Log Performance Counters
Combine Web and Worker Roles
Do a Folder Share
All of these things along with the complete list is explained with code samples in a dedicated website.
We got in touch with Steve to speak to him about AppFabric, Startup Tasks, Blob leasing and more -
InfoQ: You have not really touched upon the AppFabric part of Windows Azure, which seems to be growing more as a cloud middleware platform. Are there any samples or resources that you would like to share for AppFabric?
Steve: I personally wasn’t speaking about WA AppFabric because I don’t work much with that part of the platform. However, MIX saw some great announcements about WA AppFabric, which you can find on the WA AppFabric team blog. That blog post includes some details and resources for the new features.
InfoQ: Between a) using VM Role feature and b) using regular Roles and installing pre-requisites (like PHP or Python or Ruby) using batch files or Web PI Command line tools on startup, which approach do you recommend and why?
Steve: The choice of using a VM role or a web/worker role with startup tasks is really a tradeoff. Going with a web or worker role lets you take the greatest advantage of Windows Azure’s Platform as a Service features (such as automated OS patching and code updates). This is personally usually my preferred path, because I feel very comfortable building startup tasks that install the components I need and otherwise customize the VM before my role executes. However, not all setup can be automated, and some setup steps take a very long time (so you don’t want them happening every time you spin up a new role instance). When that happens, a VM role is the right choice. You can manually set up the virtual machine once, upload it to Windows Azure, and start as many instances of it as you need. The downside of the VM role is that you’ll need to manage the OS yourself (installing patches and uploading a new differencing VHD with those changes).
InfoQ: There are startups like appharbor, which are showing that deploying new bits to hosted .net applications could be much smoother than what it is in Windows Azure right now. Do you see the deployment story for Windows Azure also improving over time? Are there any solutions already available to get such a deployment experience with Windows Azure?
Steve: We are always interested in learning more about our developers' needs. That being said, we don't have anything specific to share on this front at this time.
InfoQ: You have mentioned about “Blob leasing” and also have a blog post about how exactly to do that. Could you elaborate a bit more, maybe give a simple example, in which scenarios this could be particularly useful?
Steve: The most obvious use of blob leases today in Windows Azure is for Windows Azure Drives. Drives are NTFS volumes that are backed by Page Blobs. Due to the semantics of NTFS, only a single writer at a time can operate on a Drive. To ensure that this happens, the blob is leased by the VM that mounts the Drive, which gives it exclusive access for the duration of the lease. Blob leases are also useful as a general leasing mechanism. For example, a simple implementation of leader election in Windows Azure would be to have each instance race to acquire a lease on a blob. Whichever instance gets the lease is the leader. If the leader doesn’t renew the lease for a while, the blob will once again be un-leased, and another leader can emerge by acquiring the lease. In general, leasing is an important mechanism for handling concurrency in a distributed system. The place in Windows Azure where we have leases built-in is in the blob storage system, so people are using that in a variety of ways.
InfoQ: We have still not seen any Email service from Windows Azure, on the lines of what we have from Amazon Web Services or from Google Appengine. Alternative third-party providers like SendGrid are at least 5-10 times more expensive and might be charging for features that are not needed by most developers. Any cost-effective solutions can you recommend for sending email from applications on Windows Azure?
Steve: There’s nothing on our public roadmap about email service integration with Windows Azure. I do want to note that customers can choose from any number of 3rd-party email services.
InfoQ: Considering that we can either 1) use a web role and then override the Run() method to do a background task and 2) run IIS in a worker role, which is a better way to host a web + worker in a single role and why?
Steve: I think #1, since that’s basically no additional work, and you can model your web application (sites and bindings) in ServiceDefinition.csdef. If you do method #2, you have to figure that part out for yourself, and I don’t see that there’s any benefit.
My goal in talking about running IIS in a worker role is just to strengthen the point that web and worker roles are essentially the same thing. Web roles just have useful automatic configuration of IIS that you don’t have to do. I haven’t yet thought of a good use for running IIS in a worker role (instead of just using a web role), but I thought it was interesting.
Stephanie Davis (nee Stewart) Dec 21, 2014