Welcome!

.NET Authors: JP Morgenthal, Bob Gourley, Yung Chou, Adine Deford, Jim Kaskade

Related Topics: Cloud Expo, SOA & WOA, .NET

Cloud Expo: Book Excerpt

Cloud Computing, SOA and Windows Azure - Part 4

Hello World in Windows Azure

For a complete list of the co-authors and contributors, see the end of the article.

The following section demonstrates the creation of a simple "Hello World" service in a Windows Azure hosted application.

Note: If you are carrying out the upcoming steps with Visual Studio 2008, you will need to be in an elevated mode (such as Administrator). A convenient way of determining whether the mode setting is correct is to press the F5 key in order to enter debug mode. If you receive an error stating "the development fabric must be run elevated," then you will need to restart Visual Studio as an administrator.

Also, ensure the following on your SQL Express setup:

  • SQL Server Express Edition 2008 must be running under the ‘.\SQLEXPRESS' instance
  • Your Windows account must have a login in .\SQLEXPRESS
  • Your login account is a member of the sysadmin role

If SQL Express isn't configured properly, you will get a permissions error.

1. Create a Cloud Service Project
First you need to open the New Project window to create a new cloud service project using VB.NET or C# (see Figure 5).

Figure 5: The New Project window

2. Choose an ASP.NET Web Role
After you click OK on the New Project window, the New Cloud Service Project wizard will start. You will then see a window (see Figure 6) that will allow you to choose the type of role that you would like as part of your service deployment.

Figure 6: The New Cloud Service Project Window

Mainstream SOA design patterns and service-orientation principles can be applied to Windows Azure-hosted services very similarly to how they are applied to internal enterprise-hosted services. Furthermore, Windows Azure-hosted services support different service implementation mediums (such as Web services and REST services) and allow for the same service to be accessed via multiple protocols. This supports the creative application of specialized patterns, such as Concurrent Contracts [726] and Dual Protocols [739].

For the Hello World project, you will only need the ASP.NET Web Role type. Once you select this role, you can choose the role name.

3. Create the Solution
After clicking OK, the wizard will generate the solution, which you can then view using the Solution Explorer window (see Figure 7).

Figure 7: The HelloWorld solution structure displayed in the Solution Explorer window

4. Instantiate the Service
Now you can open the Default.aspx file using the Solution Explorer window, put "Hello, Cloud!" in the Body element and press F5 to run. You should see something like what is shown in Figure 8.

Figure 8: The HelloWorld service in action

This example was executed locally on IIS. If we were to deploy this service into the Windows Azure cloud, it would still be running in IIS because it is hosted in a Web role.

Summary of Key Points

  • The development environment for Windows Azure is fully integrated into Visual Studio, which provides a simulated runtime for Windows Azure for local desktop-based development and unit testing.
  • Creating and deploying cloud-based services with Windows Azure is simplified using available wizards and development UIs.

•   •   •

This excerpt is from the book, "SOA with .NET & Windows Azure: Realizing Service-Orientation with the Microsoft Platform", edited and co-authored by Thomas Erl, with David Chou, John deVadoss, Nitin Ghandi, Hanu Kommapalati, Brian Loesgen, Christoph Schittko, Herbjörn Wilhelmsen, and Mickie Williams, with additional contributions from Scott Golightly, Daryl Hogan, Jeff King, and Scott Seely, published by Prentice Hall Professional, June 2010, ISBN 0131582313, Copyright 2010 SOA Systems Inc. For a complete Table of Contents please visit: www.informit.com/title/0131582313

Authors
David Chou is a technical architect at Microsoft and is based in Los Angeles. His focus is on collaborating with enterprises and organizations in such areas as cloud computing, SOA, Web, distributed systems, and security.

John deVadoss leads the Patterns & Practices team at Microsoft and is based in Redmond, WA.

Thomas Erl is the world's top-selling SOA author, series editor of the Prentice Hall Service-Oriented Computing Series from Thomas Erl (www.soabooks.com), and editor of the SOA Magazine (www.soamag.com).

Nitin Gandhi is an enterprise architect and an independent software consultant, based in Vancouver, BC.

Hanu Kommalapati is a Principal Platform Strategy Advisor for a Microsoft Developer and Platform Evangelism team based in North America.

Brian Loesgen is a Principal SOA Architect with Microsoft, based in San Diego. His extensive experience includes building sophisticated enterprise, ESB and SOA solutions.

Christoph Schittko is an architect for Microsoft, based in Texas. His focus is to work with customers to build innovative solutions that combine software + services for cutting edge user experiences and the leveraging of service-oriented architecture (SOA) solutions.

Herbjörn Wilhelmsen is a consultant at Forefront Consulting Group, based in Stockholm, Sweden. His main areas of focus are Service-Oriented Architecture, Cloud Computing and Business Architecture.

Mickey Williams leads the Technology Platform Group at Neudesic, based in Laguna Hills,

Contributors
Scott Golightly is currently an Enterprise Solution Strategist with Advaiya, Inc; he is also a Microsoft Regional Director with more than 15 years of experience helping clients to create solutions to business problems with various technologies.

Darryl Hogan is an architect with more than 15 years experience in the IT industry. Darryl has gained significant practical experience during his career as a consultant, technical evangelist and architect.

As a Senior Technical Product Manager at Microsoft, Kris works with customers, partners, and industry analysts to ensure the next generation of Microsoft technology meets customers' requirements for building distributed, service-oriented solutions.

Jeff King has been working with the Windows Azure platform since its first announcement at PDC 2008 and works with Windows Azure early adopter customers in the Windows Azure TAP

Scott Seely is co-founder of Tech in the Middle, www.techinthemiddle.com, and president of Friseton, LLC.

More Stories By Thomas Erl

Thomas Erl is a best-selling IT author and founder of Arcitura Education Inc., a global provider of vendor-neutral educational services and certification that encompasses the Cloud Certified Professional (CCP) and SOA Certified Professional (SOACP) programs from CloudSchool.com™ and SOASchool.com® respectively. Thomas has been the world's top-selling service technology author for nearly a decade and is the series editor of the Prentice Hall Service Technology Series from Thomas Erl, as well as the editor of the Service Technology Magazine. With over 175,000 copies in print world-wide, his eight published books have become international bestsellers and have been formally endorsed by senior members of many major IT organizations and academic institutions. To learn more, visit: www.thomaserl.com

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.