4. DEVELOPING WINDOWS AZURE APPLICATIONS
Windows Azure is not just about
services. It is an ever-evolving cloud platform that has a set of tools
and SDKs that enable you to get started quickly developing cloud
applications.
Getting started with Windows Azure requires the following:
- Visual Studio (2010 or 2012)
- Windows Azure SDK and Tools for Visual Studio
- Windows Azure subscription
You can also integrate different SDKs and tools
with Visual Studio 2010 or Visual Studio 2012. The Windows Azure tools
and SDK are free downloads. After you download the tools and SDK, you
must set up a Windows Azure account. You can sign up for a free 90-day
account to get started.
NOTE Remember that the cloud is about pay-per-use: as you use more compute, storage, data, and other service capabilities, the more you’ll be charged per month.
After you download the Windows Azure tools and
SDK and create a Windows Azure account, you can use Visual Studio to
build and deploy applications to your account. When you’re ready you
will be able to test, stage, and ultimately deploy your applications to
a production environment. While you’re developing (and especially while
you’re developing offline), you can use the emulator — an emulated
Windows Azure environment that is installed with the tools — to test
your applications locally.
Figure 5
illustrates at a high level the process of developing cloud
applications. In the diagram, you can see the left side represents a
local development environment. Installed in this environment are the
tools, SDK, and emulator as well as the .NET and Visual Studio
development toolset. (Windows Azure also supports PHP, Java, Node.js,
and other types of non-Microsoft technologies through SDKs and
community tooling.) You can build and test your applications locally,
but at some point you’ll need to deploy these apps to your production
account, and which account you choose depends on what licensing
structure your company has purchased (for example, basic subscription
or pay-per-use account versus enterprise license account). In any case,
you deploy into an account using a LiveID (or Microsoft account ID)
username and password information. The Windows Azure account has a
unique subscription ID and allows you to add co-admins so others can
manage the services that are deployed to it. Note in the right side of Figure 5
how the cloud environment is hosted in a physical data center ; thus your application, service, or data
becomes available to others when you deploy into this production
environment. You can lock down the applications (using Windows Azure
Active Directory technology) and have an authenticated, single sign-on
experience, or you can have a fully anonymous-access site or service
that is leveraged by your application.
A number of elements must be in place to get
started developing, so the following exercise walks you through where
you can find the software to set up your development environment.
1. Setting Up Your Development Environment
To set up your Windows Azure
development environment, you first install Visual Studio and then the
Windows Azure tools install on top of it.
To install the trial version of Visual Studio:
1. Download and install Visual Studio 2012. At the time of this writing, you could get the trial edition at http://www.microsoft.com/visualstudio/en-us. You have your choice of different SKUs (or Visual Studio versions) available; choose Professional or above.
2. When you
click the appropriate SKU, select Run when prompted. Visual Studio asks
for a download location and begins installing the product.
To install the Windows Azure SDK and tools:
1. Download and install the Windows Azure tools for Visual Studio 2012. At the time of this writing, you could get the tools at http://www.windowsazure.com/en-us. You can also get the software and tools through the Web PI: http://www.microsoft.com/web/downloads/platform.aspx.
2. Click the
Develop link, which takes you to all the available SDKs and tools.
Under languages, click .NET, the first option shown in Figure 6.
3. Click the Install button, and then select Install with Visual Studio 2012.
4. Select Run when prompted, which invokes the Web Platform installer.
5. Click Install, as shown in Figure 7, and then follow the wizard to accept the license and begin the installation process.
How it Works
The installation process is fairly
self-explanatory; just follow the wizard. If you want to download a
permanent version of Visual Studio, you can visit http://www.microsoft.com/visualstudio/en-us
and you should be able to buy the most recent version. If you’re an
MSDN subscription holder, you should be able to download Visual Studio
2012 under your subscription license there.
After you’ve installed Visual Studio and the
Windows Azure tools/SDK for Visual Studio, you need to sign up for a
Windows Azure account. To do this, click the Home link on the main
Windows Azure site, click the Free Trial button, and then click the Try
it Free∗ button (see Figure 8).
You’ll be prompted for your LiveID and a wizard will walk you through a
sign-up process. After you sign up, you’ll then be able to navigate to
your portal and begin creating cloud services, websites, and so on.
Now that you have your development
environment up and running and a Windows Azure account ready to go,
you’ll want to get hands on with developing for Windows Azure. To do
this, the following Try It Out walks you through creating your first
Windows Azure application. The application is a simple REST-based Web
API project that will return some hard-coded sales data.