Microsoft SQL Azure Enterprise Application Development

By Jayaram Krishnaswamy
  • Instant online access to over 7,500+ books and videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies
  1. Cloud Computing and Microsoft Azure Services Platform

About this book

SQL Azure is a database service in the cloud. Based on Microsoft’s Windows Azure platform, SQL Azure is well suited for web facing database applications. Are you interested in moving your business applications and data to the cloud but are not sure how to go about it? Look no further; this book covers all you ever wanted to know about taking your relational enterprise data to the cloud using SQL Azure.

This book will show you how to manage SQL Azure using various tools and also guide you in developing enterprise applications and business intelligence solutions. It will take you through migration and synchronization scenarios with a variety of tools, help you in working with Microsoft technology still in incubation, and in leveraging hybrid applications that exist partially in the cloud and partially on the ground.

This step-by-step tutorial begins by providing an overview of Cloud Computing, introducing you to the most significant Cloud Computing implementations. You will then learn the mechanics of signing up and obtaining an account on Microsoft Windows Azure and logging into the portal.

The book then dives deep into SQL Azure, showing you how to provision a SQL Azure Server, and how to create/delete databases as well as set up Firewall rules so that you can access SQL Azure from tools/Client programs. It is then followed by details of how to access SQL Azure using Client and Server APIs.

Other content includes, a comprehensive description of tools required to access SQL Azure and how to use them and how to populate and migrate SQL Azure databases using a variety of tools.

Finally, the book will detail with examples, data-centric applications that leverage a mix of on-site data and Cloud based data, how to synchronize data and extend the applicability of SQL Azure data by disconnected applications on mobile media, and synchronize services for globally distributed data. After covering the topics of services which are in production, the book will then cover future developments as well as a complete update to SQL Azure at the time of writing this book.

Publication date:
December 2010
Publisher
Packt
Pages
420
ISBN
9781849680806

 

Chapter 1. Cloud Computing and Microsoft Azure Services Platform

This book is about one of the components of the Windows Azure Platform that provides support for a relational database in the Cloud. However, as it is a component of a more comprehensive, larger system it is essential to understand how it is positioned in relation to the Windows Azure Platform. In addition to introducing the larger picture, the book also describes how Windows Azure cloud applications access and leverage relational data; how the business intelligence applications interact with the cloud-hosted relational data; how the relational database provides support for authenticating web clients; how the cloud and ground-based relational databases can be accessed from ground (on-site) as well as cloud applications, and many others.

The book, therefore, begins with an introduction to cloud computing as it is generally spoken about by reviewing the most popular cloud offerings and more specifically introduces the main components of Windows Azure Platform. Also included in this chapter is a section that you will need to go through before you access the Windows Azure Platform services.

In this chapter, we will look at the motivation for cloud computing. We will discuss the following:

  • What is cloud computing?

  • Why a business would like to move its business applications and data to the cloud

  • Types of cloud services

  • The hybrid cloud

  • How cloud computing is implemented with examples of some major cloud computing vendors

  • Windows Azure

 

What is cloud computing?


Cloud computing is still evolving and perhaps one of the more enduring, all embracing, definition of cloud computing may be defined according to the NIST (http://csrc.nist.gov/nice/states/maryland/posters/cloud-computing.pdf)as follows:

"Cloud computing is a model for enabling convenient, on-demand network access to a shared pool of configurable computing resources that can be rapidly provisioned and released with minimal management effort or service provider interaction."

The resources, as it is implied here, would include not only the hardware but also the software that cloud computing would use.

The industry watchdog Gartner (http://www.gartner.com/it/page.jsp?id=1035013) on the other hand defines cloud computing as follows:

"Cloud computing is a style of computing where scalable and elastic IT-enabled capabilities are delivered as a service to external customers using Internet technologies."

 

Why a business would like to move its business applications and data to the cloud


Economic and business considerations have persuaded businesses to move to the next level of productivity with economically valuable features such as extensibility, agility, elasticity, and security. Availability of such a resource removes the constraints from maintaining an in-house infrastructure (Hardware, Software, and IT manpower) and, therefore, brings in great business value. It also enables businesses with meager resources to concentrate their effort in developing their business rather than getting concerned about the resources.

The "Cloud" vendors aggregate all their resources at data centers, which they can maintain and make them available to businesses on a subscription basis. Recognizing early on, the importance of this cloud-based business paradigm, companies such as Amazon.com (http://aws.amazon.com/); Google (http://www.google.com/apps/intl/en/business/index.html); SalesForce.com (http://www.salesforce.com/) and a few others jumped into this business model and implemented applications offered from the cloud. Although all of them were 'Cloud' offerings, they meant different things as seen in their implementation. The single feature that is basic to all implementations in the cloud is the highly flexible, highly agile, highly virtualized (Servers, storage, and many more), and automated hardware capable of being created on the fly with a high degree of redundancy accessible by a very fast network.

As seen recently, businesses have started liking the flexibility of cloud services related to optimum resource utilization with virtually no overheads; with minimum support personnel and, therefore, smaller payroll expenses; smaller real estate commitment, and the ability to rescind in case of an emergent economic or financial crisis. One of the factors that still deter businesses to go all out for cloud computing perhaps, is security concerns.

 

Types of cloud services


There are several types of cloud implementations and they sharply differ from on-premises services in that the resources are shared by more than one party or business. Some of the most popular and widely known services are of the following types:

Infrastructure as a Service (IaaS)

This is strictly using the infrastructure where you access storage and virtual servers in the cloud. The storage and servers are of the industry standard, which you can add or remove depending on your requirements (your load characteristics).

Platform as a Service (PaaS)

Here, Platform on the cloud is where you execute the application. You use the platform specific programming API. The provider completely supports the maintenance of programs, diagnostic and monitoring, and so on — a one stop service for all web-based applications.

Software as a Service (SaaS)

In this case, users don't own the software but rent it. Users also don't concern themselves with the maintenance of the program or the servers on which it is hosted.

Some examples of SaaS are the Sales Force automation, financial services, content management, and collaboration. However, content management is also supported on vendors who are typically IaaS and PaaS providers.

The hybrid cloud

In the hybrid, it is not entirely cloud that is hosting the applications, a part of hardware and software also exists on premises. There are various implementations of this and it is customizable.

While Security and Privacy are some of the concerns, the round-the-clock availability and performance are the most attractive features. Looking into the near future, cloud appliances will make their debut, which offers a packaged 'mini-cloud' to enterprises to host cloud applications to address some of the security and privacy-related concerns. With the cloud appliance the complete infrastructure is under lock and key and owned by the enterprise without the security concerns of a cloud service.

How does Microsoft Azure Cloud offering measure up? From what you will read further on, you will notice that Microsoft Windows Azure not only provides the agile infrastructure at its globally dispersed data centers and its Windows Azure Platform OS but it also provides a scalable relational database. Azure AppFabric provides support for security and privacy as well as hybrid applications. Microsoft is also moving forward with Windows Azure Appliances (review this link: http://www.microsoft.com/windowsazure/appliance/) for private Windows Azure Cloud systems that run on user data centers. The Windows Azure platform is, therefore, all of IaaS, PaaS, and SaaS bundled into an integrated offering.

 

How cloud computing is implemented with examples of some major cloud computing vendors


The implementations described here are not the only ones. Lots of major events (both public and private) are happening bringing more and more players including the US Government (Read about Apps.gov here: http://www.informationweek.com/blog/main/archives/2009/11/uncle_sams_2442.html;jsessionid=UIWZYUIKFNJ1LQE1GHPSKHWATMY32JVN?queryText=app.gov), to the field as this line is written. The implementations described here are highlighted just to indicate how different the cloud offerings could be, and show the paths they have pursued.

Amazon Web Services

Amazon Web Services through its Amazon Elastic Compute Cloud (EC2) offered customers dynamically scaled computer infrastructure for running their application programs, thus offering infrastructure as a service. The term elastic came about by the ease with which the user can create, launch, and terminate the active virtual server instances used in running the programs. To be elastic there was built-in redundancy in the resources and automated scaling, which tracked the load.

Also, to cater to wide-scale adoption, there were a number of sizes the users could choose; from small instances to High-CPU extra-large instances. The applications could run on a computing platform that the customer can choose from, which can be accessed by a web service (one of many Amazon Web Services). Although, EC2 supported Linux operating system in the beginning, it rapidly added other platforms such as Open Solaris and Solaris Express Community Edition and even Windows. By adding Windows OS (2003 and 2008 Servers) it provided full support for all Microsoft applications (ASP.NET, AJAX, Silverlight, and so on) to be hosted on EC2 with data originating in SQL Server Express and SQL Server 2008 server (http://aws.amazon.com/windows/) instances. EC2 by itself had only temporary storage for data but later added Simple Storage Service (S3) and Elastic Block storage (EBS) for persisting data (http://news.cnet.com/8301-10784_3-9917948-7.html).

The 'Elasticity' of this cloud computing was further enhanced by Elastic IP, Elastic-load balancing, and a reliable monitoring service in the form of Amazon Cloud Watch. Most recently, Amazon added a relational database as a service (http://aws.amazon.com/rds/) by adding MySQL to its roster of web service offerings, accessible by simple API calls, which could work with EC2.

SalesForce.com

Force.com (Salesforce.com) has a secure, reliable, and fast cloud infrastructure spanning two continents with more than 60,000 businesses running a myriad of applications. This was a model of Software as a Service. Whereas, the keyword to describe Amazon Web Services was 'elastic', the keyword here is 'real-time'.

SalesForce.com has a multitenant architecture with tenants sharing a single copy of the program customized to their specific needs. It has an ISO 27001 security certification, which is trusted by financial and health services; reliable data centers with backup and disaster recovery plans; high scalability, real-time query optimizer, real-time status information, and real-time upgrades. The sharing model allows companies on Salesforce to communicate and share data with each other leveraging the multitenant, single core architecture. Reliability is increased with a redundant network bone.

Furthermore, Force.com (SalesForce) allows integration of almost anything with anything that includes most vendor products such as Google, Oracle, Twitter, Microsoft, and many more to mention just a few. Although it is possible to build custom applications, there is also the AppExchange, which provides hundreds of pre-built business components that can be used without reinventing the wheel. Force.com (SalesForce) also provides components for bridging with other clouds such as Amazon Web Services, Google AppEngine, and others.

For development purposes a sandbox environment is available, which can be created with a single-click. It boasts of programmable UI's, programmable logic, website development, real-time analytics, and so on. Video demos can be viewed here: http://www.salesforce.com/platform/cloud-platform/database.jsp.

Google

Google's App Engine (http://code.google.com/appengine/) Platform leverages Google's infrastructure to run Google's web applications as a Service. The configuration allows public as well as authenticated access to these resources. The tagline is "easy to build, easy to maintain, easy to scale". The Google App Engine's infrastructure handles all of the storage, distribution, replication, load balancing, and a few more. All of these activities are accessible by a simple API. The platform supports a powerful query engine as well as transactional processing support, key elements for commerce. The programming languages supported are python and java runtime but any language that uses a JVM-based interpreter or compiler (JavaScript, Ruby) can be used.

The storage of data is not in a relational database and therefore, SQL is not used but a Google Specific Query Language (GQL) is (http://code.google.com/appengine/docs/python/datastore/gqlreference.html). The nice thing about the Google model is you can get started for free with some 500MB of storage with enough bandwidth to serve a couple of million page views a month (as advertised). Even using the paid service is on pay-per-use basis. It also has an authenticating and e-mailing service as well as providing a local developmental environment.

Microsoft

Microsoft entered this area relatively late but directed a lot of its effort to branch out into this important business area very quickly and thus Microsoft Azure was born. The Microsoft Azure platform in Microsoft Data Centers spans three continents North America, Europe, and East Asia. Microsoft Azure not only makes available this humongous infrastructure but also provides its signature software products; Windows Servers; SQL Server; and components of .NET Framework. It is, therefore, both infrastructure and software as service. It is, in fact, heading towards offering its entire framework as service. Framework as a service would offer not only the extensibility of the platform for years to come but also leverages the regular enhancements made to the framework on which the Windows Azure is based. On the downside one gets locked into proprietary service.

The Azure platform is resting on three pillars, the Windows Azure Services, the SQL Azure Services, and Azure AppFabric. The Azure platform not only caters to cloud-based applications but also to applications that run on premises. Services that run part in the cloud and part on-premises are called hybrid services and the Azure Platform lends itself easily to create such services. The Azure platform is structured to be developer-friendly, and can be leveraged by desktop, web, and mobile devices using many of the programming languages such as PHP, Ruby, and so on in addition to Microsoft's VB, C#, and F#. As the software programs that work with the Azure platform are not limited to those that are Microsoft-Specific, the adaptability is much more general. As the accessibility uses Open Internet standards, clients can be on any platform. The main concerns that are being looked into are related to security and privacy as for any of the cloud offerings, however there are many ways the Windows Azure platform is made secure using encrypted transport, firewalls, and so on. Identity verification and user access based on Security Assertion Markup Language (SAML) tokens mitigate some of these concerns. However, for the hardcore control freaks Microsoft is offering the Windows Azure Appliance where security is now the user's concern.

More in-depth discussion of security is described in the following video, which is a must if you want to understand how Windows Azure security looks under the hood (http://technet.microsoft.com/en-us/edge/security-talk-windows-azure-security-a-peek-under-the-hood.aspx?query=1).

Review the case study of a late 2009 implemented business solution using Microsoft Azure components at: http://www.microsoft.com/casestudies/Case_Study_Detail.aspx?CaseStudyID=4000005882.

Also review this note about small business profiting by moving to cloud, http://howto.techworld.com/sme/3211586/how-to-move-your-small-business-to-the-cloud/.

On a practical footing, the Azure Platform, its hardware and software are physically located in the various Microsoft data centers: http://news.cnet.com/8301-10805_3-10277976-75.html.

Even as the various cloud paradigms (IaaS, PaaS, and SaaS) were developing, cloud computing has evolved to produce more varied patterns. Private clouds have emerged to satisfy the special requirements of certain industries (http://cloudstoragestrategy.com/2009/03/bechtel-harnesses-the-cloud-a-case-study-in-service-delivery.html) and even Microsoft will be launching its Windows Azure Appliance to address that possible growth area.

The following table shows at a glance some of the differences between the cloud offerings by these vendors:

Feature

Amazon

Google

Microsoft

SalesForce(Force.com)

Name

AWS

GAE (Google AppEngine)

Windows Azure

Genre

Infrastructure as Service (EC2) IaaS

Application as Service

AaaS

Platform as Service

PaaS

*Future ITaaS

Software as Service SaaS

Status of business

Strong on traffic patterns and metrics

Recently added some free services for limited periods

Small to enterprise, also some free services with limited access to resources

Presently developers and small businesses

Over 60000 users (at the beginning of this writing) health care and Financial

Target

Those who are yearning for hardware resources and manage their software including programming

Free to start and pay as you go. Small to big businesses such as eBay.

Small Business but appears Enterprise end is waiting at door step

Enterprise as well as Small Business

Motivation

Derive revenue from its (AMZN) Capacity and more

Enhance revenue from Ads. Push Ads revenue idea to App Builders

Move Office, SharePoint, and .NET Framework

 

Database support

MySQL

Amazon SimpleDB

Amazon Relational Database Services

SQL Server 2008

SQL Express

Non-relational distributed data storage with query engine and transaction support

Gmail query language

SQL Azure relational data storage and Storage Service for non-relational data. Tools to migrate MySQL and MS Access are presently available and Fox Pro may be added in the future.

Force.com object-based database using APEX language.

Development Environment

Free to choose, Eclipse Platform, .NET

Full featured web-based AppEngine simulated environment on developers' computer

Windows Azure simulated sandbox environment on developers' computer with almost 90 percent of full features using Visual Studio

Single-click Sandbox for development using Eclipse IDE

Programming Language Support

Ruby, Python, or Java (jar)

Java, Python, and any language supported by JVM

.NET languages (VB,C#,F#), Ruby, Java, PHP, and Perl

Most of the programming languages

Platform

Linux/UNIX, SUSE Linux, Windows Server, or Amazon VPC.

Not very much known about hardware

Windows Server 2008

APEX code, VisualForce using traditional MVC paradigm.

 

Windows Azure


In the following sections, a summary of the Windows Azure Platform details are described. The hardware system at the Microsoft Data Centers provides the physical support for all the programs and activities, and the software architecture is built on this resource.

Azure platform details

The Azure platform is a collection of services shown in the following image that operate in the cloud and orchestrate to provide businesses with an integrated set of programs that improve and enhance their business. The following image shows the three components of the Windows Azure Platform:

Businesses develop their application on their site in a simulated cloud environment, which may be compared with how you develop web applications on the development web server and then deploy it over an internet connection. End users access these applications on the cloud using familiar internet protocols such as SOAP, HTTP, REST, and more. Prior to February 2010, when the Windows Azure Platform was open to the public, the operating system changed over from CTP to Guest Operating System 1.0. Since then many updates to the operating system have been made as shown in the following table taken from Microsoft documentation at this URL http://msdn.microsoft.com/en-us/library/ee924680.aspx.

Guest OS

Release date

Windows Azure Guest OS 1.6 (Release 201008-01)

September 1, 2010

Windows Azure Guest OS 1.5 (Release 201006-01)

July 20, 2010

Windows Azure Guest OS 1.4 (Release 201005-01)

June 17, 2010

Windows Azure Guest OS 1.3 (Release 201004-01)

April 30, 2010

Windows Azure Guest OS 1.2 (Release 201003-01)

April 5, 2010

Windows Azure Guest OS 1.1 (Release 201001-01)

January 30, 2010

Windows Azure Guest OS 1.0 (Release 200912-01)

December 7, 2009

However, in order to develop for the cloud you also need the appropriate software development kit (SDK). Not every release of OS has an associated SDK. The SDKs released as of this writing and the appropriate OS for which the SDK can be used is shown in this table from the same documentation. Windows Azure SDKs provide the software support for running the development fabric (a mini version with most features of the application running on the cloud platform) on the local (on-site) machine and the development server.

Windows Azure SDK version

Compatible Windows Azure operating system releases

Windows Azure SDK version 1.2 (June 2010)

Guest OS 1.3 or newer

Windows Azure SDK version 1.1 (February 2010)

Guest OS 1.1 or newer

Windows Azure SDK version 1.0 (November 2009)

Guest OS 1.0 or newer

The Azure platform is accessible from programs in the cloud as well as from on-premises applications. In this sense, it works seamlessly between what the businesses have on their premises and those they have implemented, or propose to implement, in the cloud. In order to maximize the ROI and commensurate with their security needs, the businesses may move their data and applications, whole, or in part to the cloud. The present trend appears to be that the businesses move their less serious data initially when they buy into the cloud platform; and as they get more comfortable and gain confidence with the platform, move their applications and data to the cloud.

While security and reliability are of utmost concern to most businesses the most alluring features of "Cloud Computing" is the ease and rapidity with which a business on the internet can be installed. These concerns (outages, hacking, malware, and data loss) are making businesses refrain from large scale adoption according to several polls. Another preoccupation of business is to do with how customer data is stored. When the business removes data from its cloud application for whatever reason, what surety do they have that all of their data is completely removed without a trace? In order to satisfy the round the clock availability, the data is replicated to many locations in the data center, sometimes even to geographically separated locations. For small businesses however it appears to be an excellent fit where economic returns are tangible.

While all security concerns have not been addressed to the satisfaction of the users several major measures are implemented in the form of forms authentication for both Azure Table Storage and SQL Azure and enabling SSL with a self-signed certificate on Windows Azure. Also Microsoft has implemented comprehensive security measures for all physical security-related issues at its data centers.

The Platform hardware is housed in the various Microsoft Global Hosting Data Centers (see for example: http://www.datacenterknowledge.com/archives/category/microsoft/, also http://www.computerworld.com/s/article/9118190/Ozzie_details_Azure_Microsoft_s_cloud_version_of_Windows) with two in USA and one each in East Asia and Europe. The data centers are large installations (tens to hundreds of thousands of square foot area) with containerized hardware comprising of more than 2000 servers and other needed network interfaces. The infrastructure consists of Virtual Machines running Windows Servers 2008 provided by a Microsoft modified Hyper-V-based hypervisor. When a developer desires to host an application, the VMs get provisioned. User code gets into these VMs and users interact with the VMs using the internet. An excellent reference to some of the hardware details are found in this reference: http://whitepapers.techrepublic.com.com/thankyou.aspx?&tag=content;leftCol&docid=972383&view=972383&load=1&regSrc=wp&authId=ynwzchQWj6So7PJTwBg6rhE0o0VIkE8N2rj+2Ss6Rdz47retSuySSlC+kCljTZba.

Platform components

As previously mentioned, the Microsoft Azure platform URL accessible through its portal, using Windows Live Login, consists of the three components, which will be discussed later in this chapter. The details of accessing the portal are described later in the chapter.

In the next section, an overview of each of the three components is described. For the purposes of this book, the Windows Azure Service, which consists of the Compute and Storage items and the AppFabric are only tangential, as the emphasis of this book is on SQL Azure. However, these components will be addressed in the later chapters with some more detail so far as they are used for creating web-facing applications using SQL Azure, or on-premises SQL Servers.

Windows Azure

As described previously, Microsoft Data Centers contain the clusters of Windows Server 2008 (64 bit), which are virtualized to provide the Virtual Machine Images (Cloud Virtual Machines), which in turn hosts the User Code and Runtime APIs. These are accessed through the portal using the Service Management Service (a REST-based Service). In addition to compute VM clusters, the data center also hosts Storage Clusters for the storage service. These are also accessible through Representational State Transfer (REST), a new client-server software architecture built on transfer of resource representations. The developers using Visual Studio 2008 SP1 and Visual Studio 2010, presently in Beta 2 (VS 2010 will be available during 2010), and the Windows Azure SDKs as mentioned previously need Windows Azure Visual Tools: http://www.microsoft.com/downloads/details.aspx?familyid=6967FF37-813E-47C7-B987-889124B43ABD&displaylang=en. The servers hosting SQL Azure Services are separate from the ones used for the Compute and Storage Services.

Compute: Windows Azure Hosting Service

The Windows Azure Service, as you will be seeing later in Exercise 1.2, consists of components called roles enclosed within a service boundary built with managed code. This is where your executable program is hosted using this role-based model.

By design, it is mandated that the service should have at least one role. There are two kinds of roles; the Web Role, supported by IIS7 and ASP.NET, is well suited for web-applications defining a single HTTP/HTTPS endpoint for external clients and a Worker Role for running background programs. The storage service, the other component, can be accessed by the worker role to feed data to the web role. An application hosted on Windows Azure can have more than one role of each kind and a service hosted on Windows Azure can run multiple instances of these roles. The Azure Platform can replicate these across multiple virtual machine images. From an external location the service is reachable by a single Virtual IP Address (VIP) for load-balanced traffic to multiple end points.

The web role to worker role communication takes place through internal endpoints over TCP and HTTP shown schematically in the following figure:

While the previous figure shows the constituent parts of the compute service, the application is developed using Visual Studio at the user's premises. Visual Studio is the main programming IDE used. The SDKs provide the necessary hook ups to the Cloud Simulation and a number of different kinds of application templates (ASP.NET Web Application, WCF Service, Web Service, and more). The tools are needed for the application to be run in the development fabric (the program that simulates the Cloud environment locally on the premises) with the support of a locally installed IIS 7 server.

Typically, applications are developed in Visual Studio and tested in the simulated development environment followed by deployment. In the development process the development fabric comes into play and this is where 'debugging' of the application can be done effectively. The user will also have access to development user interface and a development local storage. The deployment can be a two-step process with an initial deployment to a Staging Slot (a client-specific staging URL) followed by a Public or web-facing URL, the Production Slot. After deployment, logging the messages is the only way available for developers to track the application.

The billing for the Windows Azure-hosted service starts whenever an application is hosted irrespective of whether it is in Production or Staging, irrespective of whether it is stopped or active. If you don't want to be billed you delete the application. In order to delete you must first stop it. In fact the Windows Azure Portal posts a warning to this effect.

Windows Azure storage

You need to get a storage account to work with Windows Azure Storage. Cloud-hosted applications use client data stored in Storage Accounts, and/or relational data in the SQL Azure. The Storage Account accessed by the Storage Service API, which as mentioned previously, is REST-based. You manipulate data in the Storage Service using POST, PUT, and DELETE requests and retrieve using GET. SQL. Azure data, on the other hand, is accessed by both applications as well as on-premises SQL Servers using T-SQL and ADO.NET. Users can access this Azure Storage Service from within an application running in Windows Azure, or directly from the internet by sending HTTP/HTTPS (version 1.0 for some operations and HTTP/HTTPS 1.1) requests and processing the returned responses.

Users should make sure of the storage service version they will be using by looking it up here: http://msdn.microsoft.com/en-us/library/dd894041.aspx. Just as in the case of hosted services, a development storage service is provided for local testing to simulate cloud storage service using local SQL Express servers (default 2005 or 2008 versions) or any local instance of SQL Server.

The following figure shows the components of the Windows Azure Storage. The Windows Azure Drive was added on Feb 1, 2009 which writes to Page blobs. The Windows Azure Drive makes it easier to migrate applications to the cloud as it appears as another durable disk drive. For applications that use file I/0 the disk availability provides a high degree of flexibility using the standard Windows NTFS APIs.

The Storage Account you hold is the top element in the namespace, which is accessed with authentication. The REST API exposes the storage account as a resource consisting of:

  • BLOBS — Stores Text and Binary data

    • Block blobs for streaming

    • Page Blobs for random read/write operations organized in containers

  • Queues — Stores unlimited 8KB sized messages

    • Messages accessible to storage account holder

    • Messages added to the end of the queue and retrieved from the front of the queue

  • Tables — Provides structured tables (not relational)

    • Store data as a collection of entities (similar to rows) with a primary key and a set of properties unlike relational databases, which are schema bound

    • Every entity has PartitionKey and RowKey properties handled by the developer and a Timestamp property provided by the server

    • REST API is ADO.NET Data Services Compliant

    • Any number of tables with uniquely identifiable names can be created

  • Windows Azure Drive — NTFS Virtual Hard Drive volumes for applications

    • Random read/write to Page Blob up to Page Blob limit of 1 TB

    • Supported by Windows Azure OS version 1.1 or later. Data to drives uploaded/downloaded through Page Blob

SQL Azure

SQL Azure is a relational database built leveraging SQL Server Technology in its latest embodiment — the SQL Server 2008 R2 (version 10.5). SQL Azure services offer a platform for hosting SQL Azure databases in the Windows Azure platform. Users can build web-facing database applications using SQL Azure as the 'cloud end'. In mid-February 2010, SQL Azure was updated with SU1.

Being built on SQL Server technologies and the agile, extensible, scalable data center infrastructure, SQL Azure provides a highly scalable, highly available, multi-tenant database service in the cloud. The ease with which you can create a database is truly amazing as the provisioning is extremely fast as we see later in the book.

The provisioning and management offered by this cloud service abstracts away an important part of how the databases are traditionally installed and managed. In fact many businesses do not need to employ IT professionals who work on the physical (hardware) side of database installation and management. This will be one of the selling points where the ROI is highly perceptible. As the databases are replicated in the cloud with a high degree of redundancy, users need not concern themselves regarding replication issues to the extent they were concerned traditionally. Also with the SQL Server being a mature technology there is a very little learning path to move user data to the cloud. The very familiar T-SQL is supported and the databases created in the cloud can be accessed through familiar tools such as Microsoft SQL Server Management Studio, SQLCMD, and so on.

The SQL Azure service architecture follows the schematic shown in the following figure:

The hardware is installed in the Microsoft Data Centers. SQL Server instances are installed on these machines, which provide the SQL Server and SQL Server Management Services. The SQL Azure hardware is separate from hardware used for Azure Compute and Storage but is shared across all clients. The SQL Azure fabric controller works in the platform layer. The SQL Azure Fabric is a part of the computing system that handles automatic failover, load balancing, and automatic replication between the servers in the data centers. It is, therefore, tightly integrated with the data center infrastructure such as servers, network, and storage. The services layer does most of the provisioning, billing and metering and connection routing. The Services layer is accessed by the Client through the portal using TDS (Tabular Data Stream). Tabular data stream is also accessible through the familiar ODBC and ADO.NET data services. SQL Server applications and tools can access the services layer using TDS but customer applications written in any of the familiar languages such as PHP, Java, and .NET languages can access through ODBC and ADO.NET and through HTTP/REST. These are the same languages that access on-premises SQL Servers; therefore, it makes it very easy to work with SQL Azure.

At present, in addition to SQL Azure, the SQL Azure Data Sync application — based on Microsoft Sync Framework 2.0 — provides a useful tool to synchronize SQL Azure data with on-the-premises SQL Server, thus enabling remote access to data on the cloud to mobile clients connecting through remote sites.

Although SQL Server Integration Services, the SQL Server Reporting Services, are not on the cloud, these applications available in the local servers can be used with the cloud-based SQL Azure databases. It is envisaged that these Business Intelligence (BI) applications will also be available in a future version of Microsoft Azure Platform.

Azure AppFabric

The AppFabric addresses the needs of securely accessing widely distributed resources. What used to be called .NET Services in the earlier versions of Windows Azure is now called AppFabric. As you will see later in this chapter, you can access the AppFabric from the Windows Azure Portal (http://windows.azure.com) after logging in with your Windows Live ID. It is a service just like the Windows Azure discussed previously.

The AppFabric consists of the Service Bus and Access control. These provide building blocks to .NET Applications to function reliably in the Microsoft Windows Azure platform. The necessity arises because one needs authentication and access to widely distributed resources that programs need, which reside behind machine firewalls and network firewalls. Furthermore, the stateless nature of web applications together with the changeable nature of the hosting environment makes for a loosely connected system requiring a way to manage connections. AppFabric provides these very important functionalities, which are needed for taking applications to the cloud:

  • Bidirectional application connectivity through firewalls

  • Claims-based access control

The Service Bus "relays" messages from clients to applications running on the premises sidestepping obstacles such as firewalls, NATs, and other objects as shown in the next figure. In this respect, it may be compared to a "relay phone" in the USA, which acts as a relaying point to connect your phone to a phone in another country, for example, a procedure used by Skype. Many Internet chat services work on the same principle of relayed connectivity.

The "Service" opens a bidirectional connection to the "Relay" by an outbound connection and a "Relay Address". The client (Application) connects to this address through an outbound connection. This way the Client can connect to the Service bypassing the barriers. The client application need not know where the service resides. The Service Bus provides a network infrastructure for interconnecting applications using a variety of messaging patterns.

The Service Bus supports the following forms of communication:

  • One way messaging

  • Request-Response

  • Publish-Subscribe (multicast)

  • Asynchronous

The security provided by the barriers is in no way compromised. Additionally, the Service Bus can also negotiate for direct connection between applications under some circumstances as in the following image:

The Service Bus works with Access Control through claims and a trust relationship. Both the client and the service must provide credentials to the Access Control to obtain a security token. Access Control provides a generic way to implement the authentication and authorization (using claims) program separate from applications. This relieves the developers from writing custom authentication and authorization routines and rules. The Access Control provides a claims transformation program that can leverage federated identity (delegated identity) providers facilitating enterprise clients to use their authentication in Active Directory. It is envisaged that other Identity Providers, such as Facebook connect, Google Accounts, and Windows Live ID will be available in the future.

Both of these services are accessible through open protocols and standards such as SOAP, REST, ATOM, and ATOMPUB, which allows more flexible program integration.

The AppFabric SDK, which may be downloaded from here: (http://www.microsoft.com/downloads/details.aspx?FamilyID=0bd0b14f-d112-4f11-94bf-90b489622edd&displaylang=en; Version 1.0 in Beta 1, November 2009) provides a great deal of help in understanding and working with these services by way of codes and samples. Windows Communication Foundation WCF is the primary programming model for working with the Service Bus. The SDK simplifies the task of integrating these services into your .NET Applications on the premises by introducing new concepts like WCF Relay Bindings. Similar SDKs are also available for Java and Ruby developers.

Most recently, Microsoft has released (http://blogs.msdn.com/b/windowsazureappfabric/archive/2010/09/19/windows-azure-appfabric-sdk-september-release-available-for-download.aspx) Windows Azure AppFabric SDK (Version V 1.0) for both x32 and x64 bit computers. If you want to use this September release follow this link:

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=39856a03-1490-4283-908f-c8bf0bfad8a5&displaylang=en.

However, note that the name of the installer has now changed to WindowsAzureAppFabricSDK-x86.msi.

System requirements

These requirements are for the tools and SDKs used by developers (clients) to create, host, and modify their applications and services on the Windows Azure Platform.

Note

The Windows Azure provides for backward compatibility with Version 1.0 by specifying the same in the configuration files.

Only one version of the tool is to be installed on a computer.

  • Supported Operating Systems:

  • Windows 7 (Hotfixes for Visual Studio stability and Fast CGI support not required)

  • Windows Server 2008

  • Windows Server 2008 R2 (Hotfixes for Visual Studio stability and Fast CGI support not required)

  • Windows Vista SP1

  • Windows Vista SP2

    IIS version

  • IIS 7.0 [with ASP.NET and WCF HTTP Activation and optionally CGI]

  • Use guidance here: http://learn.iis.net/page.aspx/28/install-iis-7-on-windows-vista-and-windows-7/ to install IIS 7.0

    Development IDEs

  • Microsoft Visual Studio 2008 SP1

  • Microsoft Visual Studio 2010 Beta 2 — Native debugging Hotfix not required

  • Microsoft Visual Web Developer 2008 Express Edition SP1

    SQL Servers

  • SQL Server 2005 Express Edition

  • SQL Server 2008 R2 or later

  • Hardware and software required

  • Getting started with Azure Platform and accessing services

In addition, the hands-on exercise in this chapter will teach you how to acquire the needed materials and permissions to work with this platform.

Hardware and software required

For working with the practical elements in this book, the following hardware and software components were used:

  • Aspire 4810TZ notebook computer

Intel Pentium SU2700/1.3 GHZ, 3GB DDR3 SDRAM-1066MHz, 24x(CD)/8x(DVD), 14in TFT Active Matrix, Ethernet/Wireless LAN, 3 x Hi-Speed USB Interfaces with Vista Home Premium:

  • Windows 7 Ultimate (installed after removing Vista Home Premium)

  • Wired and Wireless LAN

  • SQL Server 2008 R2 Nov-CTP Enterprise (Evaluation)

  • Visual Studio 2008, SP1

  • Visual Studio 2010 Beta 2

 

Getting started with Azure Platform and accessing services


In order to work with this book it will be necessary to have an account for using the Windows Azure Platform. This is not a free service starting from February 1, 2010. During January 2010, this was a free service for evaluation but since February 1 it is a service you can subscribe to and a number of different subscription plans are available. Presently, you need to purchase a subscription to use this service. Exercise 1.1 describes the steps you need to take for purchasing the subscription. Exercise 1.2 describes the steps for accessing the services purchased by accessing the Azure Portal. In particular, a hosting service will be created. The actual hosting will be described in Chapter 7, Working with Windows Azure Hosting. The access to SQL Azure (Chapter 2, SQL Azure Services) and AppFabric (Chapter 8, Database Applications on Windows Azure Platform Accessing SQL Server Databases) from the portal will be described later.

Exercise 1.1: Purchasing a subscription on Windows Azure Platform

There are various subscription options available for purchase and each business has to make a choice suitable for its needs. For the initial parts of this book the choice made is described here. There are three parts to this process shown as follows:

Signing up for a Windows Live ID

  • Purchasing a subscription

  • Activating the Service

Signing up for a Windows Live ID

The following assumes a new sign up. If you already have a login for Windows Live ID this step is not necessary.

  1. 1. Go to the following URL: http://home.live.

  2. 2. Click on Sign up to open the URL: https://signup.live.com/signup.aspx?id=251248&ru=http%3a%2f%2fhome.live.com%2f%3fnew%3dtrue&cp=2&mkt=en-US&rollrs=12&lic=1 as follows.

  3. 3. Fill in the required details. You may have to check and see if it is available. If your first choice is not successful you can try again until you get an ID. You have to provide demographic information and provide a strong password. You also need to agree to the service agreement by clicking the I Accept button (not shown in the previous screenshot).

  4. 4. If everything is OK a Windows Live ID account will be created. You may review the account information from one of the links on this page. You can sign out of the account on this page clicking Sign out at top right.

Purchasing a subscription

To purchase a subscription, go to the following URL and choose an offer that is suitable for you: http://www.microsoft.com/windowsazure/offers/. The various options are shown in the following screenshot (follow previous URL to see the complete page):

  1. 1. For this book, the first option was chosen.

  2. 2. Click on the Buy button. You will be taken to the Microsoft Online Services page (URL: https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1283982570&rver=5.5.4177.0&wp=SAPI&wreply=https:%2F%2Fmocp.microsoftonline.com%2Fsite%2Fbuy%2FMS-AZR-0001P&lc=1033&id=255559) where it is assumed you have already created a windows Live ID login.

  3. 3. Enter your password and click OK. This will take you to the My Profile page of your account, as shown, where you need to provide a few more pieces of information about your physical address and telephone number.

  4. 4. Click on the Next button. This will bring you to the Company Information page where you need to fill in a few more required items.

  5. 5. Click Next. This will take you back to the Service Usage Address page of My Profile.

  6. 6. Click Finish. This will take you to the Confirmation page of My Profile.

  7. 7. Now click Close on this URL link. This will take you to the Microsoft Online Services' Customer Portal where you can review the services, subscriptions, and so on as shown here: https://mocp.microsoftonline.com/Site/ShoppingCartPage.aspx.

  8. 8. Check the Customer acknowledgement regarding the agreement. Keep a copy for your files.

  9. 9. Click Checkout >. This will take you to the Billing Information wizard's Payment Options Page. Herein, you can use a Credit Card (New) or provide a purchase order number.

  10. 10. Click Next on this page. Provide the Credit card information here.

  11. 11. Click Next. You are once again taken to the Microsoft Online Subscription Agreement page where you again need to agree to the terms. You also provide the full customer name and a title.

  12. 12. Click the I Accept button. This will bring you to the Review and Confirm Order page of Billing Information.

  13. 13. Click Confirm. This brings up the Confirmation page with a confirmation number, which you can file for your records.

  14. 14. Click on Proceed to activation.

Activating the service

The previous action will take you to the service activation page. You need to provide a subscription name. This name will be used for the subscription as well as to provide a name for the first project with the Windows Azure Platform. The Service name is mapped to the billing information. Here is an example from Service Activation with the subscription name: mysorian.

  1. 1. Click Next. This will take you to the Service Administrator page, which will show the Windows Live ID and contact information of the Administrator.

  2. 2. Click Next. This will take you to the summary page as shown in the following screenshot. Note the Azure portals that will be provisioned for the mysorian subscription.

  3. 3. Click Finish. This brings you to the Confirmation page.

  4. 4. Click Close. The Online Services page comes up showing the status as Activation in Progress.

Now you are subscribed. You should check up your subscription status at the following URL: https://mocp.microsoftonline.com/Site/Manage.aspx.

Exercise 1.2: Accessing Windows Azure Portal

Now, we will access the Windows Azure Portal. Herein, although you can set up your project for all the three components of the Platform, you will only set up your Windows Azure Hosting Service as follows:

  • Verifying status of account and browsing to Windows Azure Portal

  • Creating an account and reviewing the portal

  • Creating a Windows Azure Service

In the next chapter, you will be setting up the SQL Azure Services from the same portal.

Verifying status of account and browsing to Windows Azure Portal

To verify the status of your account, you will need to complete the following steps:

  1. 1. Browse to the following URL: https://mocp.microsoftonline.com/Site/Manage.aspx.

    You will notice that the status has changed to Service Active. Herein, you can edit both the Service as well as the Billing details as follows:

  2. 2. Browse to the following Windows Azure portal: http://windows.azure.com to display the New Account page as follows.

    This page shows the components of the Windows Azure Platform, Windows Azure, SQL Azure, AppFabric, and Marketplace. From this page you may access the Billing information; review your projects as well as sign out of live.com. Notice that the developer portal account is tied to Windows Live ID. Read the privacy statement, which provides useful information regarding the services provided as well as where to get help if needed (Windows Azure Platform Support: http://www.microsoft.com/windowsazure/support/). Marketplace is not discussed in this book but it is a direct contender to one of the services offered by SalesForce.com.

Creating an account and reviewing the portal

To create an account and review the portal, you will need to do the following:

  1. 1. Click I Agree. You get a congratulatory message to the effect that your account has been created.

  2. 2. Click Continue. Voila, your portal is ready with the Project Name that you provided during setting up the service account as shown. You are in the Windows Azure Page of your services portal. The three components will all be associated with the same Project Name as all of them are Enabled.

Creating a Windows Azure Service

You can add services to your project as described here.

  1. 1. Click on the hyperlink under Project Name to open the Windows Azure Project page as follows.

    Here, you can create a New Service as well as a Marketplace Listing. For the purposes of this book you need not create a Marketplace Listing. However, you will be hosting applications in the Windows Azure cloud platform and, therefore, you will be creating a New Service. When you create a New Service, provisioning of various resources will be made for your project. This is also the place where you can find more information on Windows Azure as well as access the various forums where you can pose questions and hopefully find answers.

  2. 2. Click +New Service at either one of the locations shown on the previous screenshot. This will display the following page:

    There are two accounts that you can set up here, a Storage Account and an account for the Hosted Services. You can see that you can set up 5 Storage Accounts and 20 Hosted Services accounts. You must remember that these are all billable and use caution while setting up the accounts. For the purposes of this book we will not be setting up a Storage Account.

  3. 3. Click Hosted Services. This opens the Project's Create a Service page where you provide a Service Label and a Service description, which will be used only on developer portal as follows:

  4. 4. Click Next. This takes you to the Hosted Service page. Herein, you will need to provide a name for the publicly accessible name for the service (you may need to ascertain the availability) as well as the Hosted Service Affinity Group. For the purposes of this book, this is not of any great concern. However, if you are using Storage or any other bandwidth sensitive items, you may want to keep your data and application in the same region. Here, mysorian has been used for the Service URL and Anywhere US for the Affinity Group.

  5. 5. Click Create. The details of the Hosted Service created will be displayed as follows.

    When you create a project that you want to host on Windows Azure, this is where you will come to deploy. Applications hosted on Production are live and publicly accessible. In practice, you may want to test and verify the application on a Staging server. Windows Azure has this provision.

  6. 6. Click on the Vertical bar on the right with an arrow pointing left in the previous screenshot to display the following:

    You first deploy to Staging, which is not public and after you are satisfied you can bring it over to Production. When you deploy the application to Staging a new control will be spawned, which will allow you to transfer the application to Production. You can also manage certificates that you upload and by default there are no certificates. Whether you deploy your application to Staging or Production you will be charged and the amount charged will depend on the plan you choose.

  7. 7. Sign out of the portal. We will host a number of applications in Chapters 7, Working with Windows Azure Hosting and Chapter 8, Database applications on Windows Azure Platform accessing SQL Server databases. We will set up the SQL Azure Service in the next chapter.

 

Summary


The advantages of taking a business to the "Cloud Platform" were discussed highlighting the ease with which a complex business can be established in the cloud, without incurring the startup cost in terms of infrastructure and human resources. After defining what cloud computing is, the different forms of Cloud Computing Platforms were discussed with reference to some existing major vendors. The major components that make up the Windows Azure Platform, the Windows Azure Compute/Storage Services, the SQL Azure, and the AppFabric were discussed in some detail. Also discussed were the hardware and software requirements as well as the Windows Azure Operating System versions, SDKs, and Tools. Working through the two examples will help you get started in understanding the Windows Azure Platform. The two examples in this chapter, show you how to subscribe to this service and review the various services offered. Guidance to activate the service was also described as well as the deployment options in the cloud.

In the next chapter, SQL Azure services will be described in detail with a number of examples providing you with the ability to work with this relational database in the cloud effectively.

About the Author

  • Jayaram Krishnaswamy

    Jayaram Krishnaswamy studied at the Indian Institute of Science in Bangalore India and Madras University in India and taught at the Indian Institute of Technology in Madras. He went to Japan on a Japanese Ministry of Education Research scholarship to complete his PhD in Electrical Engineering from Nagoya University. He was a Post-Doctoral Fellow at Sydney University in Australia; a Government of India Senior Scientific Officer at the Indian Institute of Science in Bangalore and Indian Institute of Technology at Kanpur; a Visiting Scientist at the Eindhoven Institute of Technology in the Netherlands; a visiting Professor of Physics at the Federal University in Brazil; an Associate Research Scientist at a government laboratory in São Jose dos Campos in São Paulo, Brazil; a visiting scientist at the National Research Council in Ottawa, Canada before coming to USA in 1985. He has also taught and worked at the Colorado State University in Fort Collins and North Carolina State University in Raleigh, North Carolina. He worked with Northrop Grumman Corporation on a number of projects related to high energy electron accelerators and Free Electron Lasers. These projects were undertaken at the Brookhaven National Laboratory in Long Island and in the Physics Department at Princeton University. He has over 80 publications in refereed and non-refereed publications and 8 issued patents. He is fluent in Japanese and Portuguese and lives in Honolulu, Hawaii, USA.

    He has been working in IT-related fields since 1997. He was once a Microsoft Certified Trainer in Networking and a Siebel Certified developer. He has worked with several IT related companies, such as the Butler International in their Siebel practice, with several IBM sub-contractors and smaller companies. Presently he is active in writing technical articles in the IT field to many online sites such as http://CodeProject.com, http://APSFree.com, http://DevShed.com, http://DevArticles.com, http://OfficeUsers.org, http://ASPAlliance.com, Egghead Café, http://SSWUG.org, Packt Article Network, http://databasedev.co.uk, http://cimaware.com, and many others. Between 2006 and 2010 he wrote more than 400 articles mostly related to database and web related technologies covering Microsoft, Oracle, Sybase, ColdFusion, Sun, and other vendor products.

    He has written four books all published by Packt related to Microsoft Database and Application Development: SQL Server Integration Services Using Visual Studio 2005, Learning SQL Server Reporting Services 2008, Microsoft SQL Azure; Enterprise Application Development, and Microsoft Visual Studio Lightswitch Business Application Development. He regularly writes for his four blogs on Blogger; http://Hodentek.blogspot.com, http://HodentekHelp.blogspot.com, http://HodentekMobile.blogspot.com, and http://HodentekMSSS.blogspot.com. He received the 2011 Microsoft Community Contributor award.

    Contact Jayaram Krishnaswamy

    Browse publications by this author
Book Title
Access this book, plus 7,500 other titles for FREE
Access now