First of all thanks to everyone that watched my session at Build. I’ve received quite a bit of positive feedback so far (one wasn’t so positive.. you know who you are ;-)).
One of the common requests I’ve received is to get access to the source code for the demo virtual machine manager app I showed.
I’ve posted the full source for this demo in a repo on GitHub.
Disclaimer: This demo was designed specifically to show off how to how to use the service management API for basic operations. The code has limited (to no) exception handling, best practices or anything else that would work in a production application 🙂
So now that you know the quality level of the code level of the demo I do want to explain a bit of how it works.
There are two projects: SMLibrary which is a very basic wrapper around the Windows Azure Service Management API and MyVMPortal is the other. MyVMPortal is an ASP.NET WebForms app that uses the API to create a VM.
To run it locally you will need to have a management certificate installed on your local machine that is also installed in your Windows Azure subscription.
Open the web.config page and add your subscription ID, cert thumbprint and storage account name(s) (separate them by comma if you want multiple storage accounts). The app by default is hard coded to deploy to West US. So unless you change that you will need to create your storage accounts in West US as well.
Long term it might be nice to further expand this demo to show other functionality for automating virtual machines. If you are interested in contributing please let me know.