Cloud Service Fundamentals in Windows Azure


Windows Azure, Windows Azure SQL Database, Windows Azure Caching
Windows Azure, Performance, Logging, Windows Azure SQL Database
Cloud
en-US
7/30/2013

Cloud Service Fundamentals in Windows Azure

The "Cloud Service Fundamentals" application, referred to as "CSFundamentals," demonstrates how to build database-backed Azure services.  This includes a description of the scenario, implementation architecture and reusable components for logging, configuration and data access.  The code base is intended to be a tangible exploration of best practices for delivering scalable, available services on Azure based on production deployments by the Windows Azure Customer Advisory Team.  

Creators:  Michael Thomassy, Rafael Fernandez, Mark Simms, Christian Martinez, Ewan Fairweather, James Podgorski, Paolo Salvatori, Rama Ramani, Shaun Tinline-Jones, Silvano Coriani, Valery Mizonov, Gus Apostol

Note: The complete version of this "Description" page is contained in the Microsoft Word document titled "Exploring CSFundamentals in WA.docx" as part of the "C# Download" linked above. The purpose of the rest of this page is to highlight each section in the document and describe the topics covered in those sections.

Details of indiviudal components are also documented on the Cloud Service Fundamentals wiki collection.

Scenario Description

Many modern cloud services integrate social experiences, based on a foundation of registering and managing per-user information.  The intent of the CSFundamentals code reference is to demonstrate several best practices and experiences for implementing modern data-driven applications on Azure in context.  The code base implements the following functionality:

Prerequisites

The reference implementation was developed using Visual Studio 2012 Ultimate; however, there shouldn't be issues with other editions.  The following items need to be installed:

Visual Studio Project Layout

The CSFundamentals applications incorporates several projects in one solution and three cloud service definitions for use by developers.  This section provides an overview of these artifacts, the directory structure and third party libraries.

Visual Studio Solution

The code base is contained in one Visual Studio solution, CloudServiceFundamentals.sln.  Open this Visual Studio solution to work with the application code, reusable libraries, and publish the application services to Azure.

Visual Studio Projects

The overall solution consists of several projects; with reusable and scenario specific code separated.

Shared Libraries

The reference implementation makes use of multiple shared libraries, managed through NuGet packages. The Microsoft libraries distributed through NuGet used by this solution include:

The non-Microsoft libraries used by this solution:

Reusable Components

There are several reusable aspects bundled with the CSFundamentals application.  This document provided describes the components, explains their design, configuration and potential applicability to your own projects. These components include:

 

Social Scenario Implementation

The CSFundamentals application implements a custom membership provider against a scaled-out relational store based on Windows Azure SQL Database.  For simplicity, the CSFundamentals code sample does not focus on functional capabilities but does provide four very simple social networking features in the MVC Web UI for purposes of demonstrating the key Azure implementation concepts.

  1. User Registration
  2. User Login
  3. Add Comments
  4. Retrieving Comments

 The focus of the implementation is on these core concepts:

Configuration and Deployment

In the Configuration and Deployment section, a description is provided for each step to configure, build and deploy the code sample to Windows Azure.  These steps include:

  1. Get an Azure subscription and create services for the CSFundamentals services: Hosted Services in Windows Azure, Azure SQL Database server and databases, Windows Azure Storage account
  2. Download the CloudServiceFundamentals solution and C# source code from the link above
  3. Create Certificates - management certificates, certificate for Remote Desktop usage and creating SSL certificate (the SSL certificate will be added to the RouterService project)
  4. Change the placeholder “csfundamentals_” settings in the appropriate project files to your Windows Azure service values including modifying the QuartzJobs.xml and the RootUsersShardMap.xml
  5. Package and deploy the 3 hosted services in the CloudServiceFundamentals Visual Studio solution:
    1. CSFundamentalsService
    2. RouterService
    3. SchedulerService

For these steps, refer to the word document provided. This details the configuration files and project files that require modification and customization for your subscription's services.

Building the CloudServiceFundamentals Solution

To build the solution, the CloudServiceFundamentals.sln file relies on enabling NuGet packages to be automatically downloaded by Visual Studio. These packages include Microsoft and 3rd party libraries previously listed. Typically, the Release BUILD configuration is selected which is recommended to use the provide Powershell scripts for configuration and deployment.

Configuration and Deployment from Visual Studio

The configuration and deployment sections describe how to modify the files to enable the solution and services to be deployed either directly by Visual Studio or through the use of Powershell scripts using the Windows Azure cmdlets. When using Visual Studio for deployment, there 9 files that require manual changes before the projects can be built and the service packages created.  The Powershell scripts help simplify modifying these files programmatically.

Configuration and Deployment from Powershell

The Powershell scripts provided for configuring and deploying the CloudServiceFundamentals solution to Windows Azure are located under the “PowerShellDeployment” directory. The scripts are organized and numbered in the order they should be executed along with a description of the steps.  There are manual steps involved too that must be followed in the order described which include uploading the management certificate to the Azure portal, modifying the RoutingService project (selecting your SSL certificate) and creating the deployment packages for each service from Visual Studio.

 

More Resources

For additional reading and background, please refer to the following resources:

Version History