Microsoft update: Microsoft Azure Development in Microsoft Visual Studio 2010

Microsoft update: It’s possible to build Windows Azure applications with Microsoft Visual Studio 2008 or Microsoft Visual Studio 2010, but Microsoft Visual Studio 2010 gets you out of the gate faster and generally has a more deeply integrated experience; hence, it’s the focus of this article. If you’re interested in using Microsoft Visual Studio 2008, much of the content is applicable, but you’ll need to download Windows Azure Tools for Microsoft Visual Studio.

If you have Microsoft Visual Studio 2010 installed, then you’re ready to get started. If you don’t, go install it now – we’ll wait. The Azure Cloud Tools team has made every effort to make the experience of building a cloud application as similar as possible to building an ASP.NET application. There are some differences of course, but if you’re already an ASP.NET guru, your skills will translate remarkably well.

The first thing we’re going to do is get Microsoft Visual Studio set up to build these types of applications. Simply click on File | New Project, select the Visual C# or Visual Basic top-level nodes, and find the Cloud node that appears in the Installed templates pane on the right. Once this node is selected you’ll see only a single project template that says “Enable Windows Azure Tools.” Go ahead and double-click on that template; the name and location that you choose don’t matter in this case. You’ll end up with an HTML document opened in a tab, which provides instructions on downloading Windows Azure Tools. Follow the directions; this is something that you’ll only have to do the first time that you create a Cloud Service with Microsoft Visual Studio.

Windows Azure Tools have a couple of additional installation requirements outside of what Microsoft Visual Studio 2010 requires by default. In particular, you’ll need to enable IIS on your development machine. The page that has instructions for installation lists the process for doing this. We hope to eventually remove this requirement.

After the tools have been installed, the “Enable Windows Azure Tools” project template will be replaced by a project template named “Cloud Service.” In order to create your first Cloud Service project, double-click on this project template (off of the File | New Project… | Visual C# | Cloud node) and you’ll be taken to a new dialog. This dialog allows you to configure the roles associated with your Cloud Service. Roles are a new concept introduced with Windows Azure. The easiest way to think about them is that they’re the individual, scalable units of code. You can create any number of instances of roles, and then load balance work among them.

There are two types of roles: Worker roles and Web roles. A Web role is simply a Web application running on IIS. It’s able to communicate to the outside world through an HTTP or HTTPS endpoint. In general, a Web role will respond to requests, perform actions and then wait for the request. A Worker role is a background–processing application that runs arbitrary Microsoft .NET Framework code. These are usually used for work that should be scheduled, long running tasks and so on.

Discussing the correct way to use the various storage services that Windows Azure offers would take too long to explain in this article; however, there are numerous samples available at yfkxb86, and these offer good examples of building applications using these APIs. In addition, the usual support for learning APIs is built into the tools. You can use Object Browser to view the new assemblies — IntelliSense will show all of the types and APIs, including their XML documentation — and F1 will navigate you from a type to the online version of its help.

Microsoft Visual Studio 2010 makes it easy to create, edit, configure, debug and deploy applications that run on Windows Azure. In particular, it’s possible to make use of the better part of your existing skill set with both Visual Studio and ASP.NET. Windows Azure presents huge efficiency, stability and cost-saving opportunities, and Microsoft Visual Studio 2010 is a fast way to get an application up and running on the platform.

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read