Develop on Azure using MSDN and Visual Studio

A few weeks ago, ElasticBox added support for Microsoft Azure IaaS services as a native provider. This is a great addition to the existing public cloud providers supported by ElasticBox (Amazon AWS and Google Compute Engine).

I will skip the details of all the configuration options supported by ElasticBox, as they are detailed in the documentation section. Instead I will focus here on what really got me interested for my personal use.

I have an MSDN account, which means I get

free hours on Azure every month (100 pounds and where the hell is the pound sign on my mac?) I also get free usage of Microsoft products like Visual Studio by signing in using my MSDN account.

Instead of writing my own box to deploy Visual Studio by pulling the installer stored somewhere in the cloud and using a silent install, I can simply leverage the existing images in Azure that already contain Visual Studio.

ElasticBox allows me to build a box that will deploy this in one click. I can set a default admin username in my deployment profile that will be reused every time if I want to, or I can override it when deploying. I can also make sure that the ports defined in my box will be open when deploying the instance.

All of the above can be done in Azure and more: there is the awesome feature of having a typo in the password and forgetting to open a port when deploying an instance!

Now that I replicated what Azure could automate for me, let’s move on to the extra features I need from a dev instance in the cloud:

  • I usually want to do some “local” testing before checking in any code. I have now the ability to stack boxes to add SQL Server Express installation on that machine
  • I want to connect the Visual Studio instance to my Visual Studio Online account, and pull the latest version of a project automatically.

Let’s look at what I have so far. The current box I use is the following:

The deployment profile for this box can be seen below:

As you can see, I let Azure handle the Windows + Visual Studio 2013 deployment in the deployment profile and add the extra customisation in the box. This includes a SQL Server Express box variable that I wrote for other projects and the Visual Studio Online URL/Collection/Username/Password.

The deployment will then be executed as follows:

  • Azure will deploy the Visual Studio image
  • ElasticBox will deploy SQL Server Express
  • Custom code will register the VSO account to Visual Studio.

Once I deployed a new instance of this box, I can see that the deployment was successful…

…And connect to the instance using the Endpoints page, that sums up all the open ports defined in my box

All that is left at that point is to connect to the instance using Remote Desktop, login and start Visual Studio.

The Visual Studio Online DefaultCollection in this case is available and I can start mapping it to folders

This process takes about 20 minutes to set up, and if you deployed and configured Windows/Visual Studio/SQL before, you don’t need any more convincing, do you?

That said, the box is far away from being complete. There are many manual steps that can be removed to get a true one click development environment as well as cool ideas to make the Test/Prod transition smoother:

  • The mapping of projects to Local folders can be automated
  • If an application requires resource files (e.g. datasets) you can simply create a box that downloads them and puts them in a specific location. Public datasets can easily be pulled when needed and you might not want to use VSO to store big datasets.
  • Use VSO build capabilities to build a version of the app that I just edited, and create a new box that will deploy that version from VSO to a test/prod environment
  • The box mentioned above can easily be customized to dynamically update the connection string from the application to the database. The binding variables in ElasticBox would allow using the same box to deploy the application with all tiers on a single instance as well as each tier on a different instance.


Categories: Cool Features & Tutorials, ElasticBox, News
Tags: ,