Archive for the 'Cloud Computing' Category

Cloud Computing: The New IT Paradigm

Much has been said about the new concept of Cloud Computing. There are a myriad of definitions and just as many companies claiming to have a Cloud Computing solution. What is really Cloud Computing, and which solutions will offer you what this new paradigm claims to deliver, are the questions most want to see answered. For starters, let me just state what is obvious for the most experienced who have seen this before, the new thing about Cloud Computing is, its name. During the rest of this entry I´ll walk you through the evolution of a few concepts that lead us to today’s so called Cloud Computing paradigm. Without further ado, let’s dive right into it.

The Industrialization of IT

Information technology has always been about turning computerized systems into a way of getting tasks done faster and in a more reliable fashion. In the last couple of decades this journey has bumped up a notch with the introduction of the object oriented programming, component based software, service oriented architectures (SOA), business process management (BPM) technologies, the internet and its technologies (Web 2.0), and so on. The last step on this long list of technologies, paradigms, and concepts is Cloud Computing. Leveraging on technologies such as virtualization, SOA, Web 2.0, grid computing, etc., Cloud Computing promises greater rates of industrialization of the IT. Making things happen faster, more reliably, and easier to manage is still the main goal of IT today.

Economy of Scale

With the build-up of the industrialization of IT, one inevitable outcome is the appearance of a new economy of scale that will allow IT providers to deliver services cheaper, making IT more like a commodity and less as a burden. Businesses can look at IT more and more as operational costs (OPEX), rather than capital expenditure (CAPEX) which makes a lot more sense for most.

Definition of Cloud Computing

What is Cloud computing after all? There are innumerous definitions of Cloud Computing and also huge disagreements about what it really is and means. So, I´ll try to give you an idea of what it is, hopefully without contributing further to the confusion. In my opinion, one of the reasons why there is a lot of confusionis because there is great mix-up of the concepts, namely technical ande purely conceptual.

                Conceptual Definition

According to NIST, National Institute of Standards and Technology, Cloud Computing is:

Cloud computing is a model for enabling convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction.”

This is a good conceptual definition of Cloud Computing that touches its main characteristics, i.e., on-demand self-service, broadband network access, rapid elasticity, resource pooled, measured services.

Today, it is more or less accepted that there are three Cloud Computing models depending on the type of service provided, IaaS, Infrastructure as a Service, PaaS, Platform as a Service, and SaaS, Software as a Service.

                                IaaS – Infrastructure as a Service

Infrastructure as a Service provides infrastructure capabilities like processing, storage, networking, security, and other resources which allow consumers to deploy their applications and data. This is the lowest level provided by the Cloud Computing paradigm. Some examples of IaaS are: Amazon S3/EC2, Microsoft Windows Azure, and VMWare vCloud.

                                PaaS – Platform as a Service

Platform as a Service provides application infrastructure such as programming languages, database management systems, web servers, applications servers, etc. that allow applications to run. The consumer does not manage the underlying platform including, networking, operating system, storage, etc. Some examples of PaaS are: Google App Engine, Microsoft Azure Services Platform, and ORACLE/AWS.

                                SaaS – Software as a Service

Software as a Service is the most sophisticated model hiding all the underlying details of networking, storage, operating system, database management systems, application servers, etc. from the consumer. It provides the consumers end-user software applications most commonly through a web browser (but could also be though a rich client). Some examples of SaaS are: Salesforce CRM, Oracle CRM On Demand, Microsoft Online Services, and Google Apps.

In reality, there are a number of other models emerging that for some analysts will have a classification of their own, not falling within the models just described. Some examples of these are:

                                AIaaS – Application Infrastructure as a Service

Some analysts consider this model to provide application middleware, including applications servers, ESB, and BPM (Business Process Management).

                                APaaS – Application Platform as a Service

Provides application servers with added multitenant elasticity as a service. The model PaaS (Platform as a Service) mentioned before includes AIaaS and APaaS.

                                DaaS – Desktop as a Service

Based on application streaming and virtualization technology, provides desktop standardization, pay-per-use, management, and security.

                                BPaaS – Business Process as a Service

Provides business processes such as billing, contract management, payroll, HR, advertising, etc. as a service.

                                CaaS – Communications as a Service

Management of hardware and software required for delivering voice over IP, instant messaging, video conferencing, for both fixed and mobile devices

                                NaaS – Network as a Service

It allows telecommunication operators to provide network communications, billing, and intelligent features as services to consumers.

                                XaaS – Everything as a Service

Broad term that embraces all the models discussed here.

Technical Definition

Trouble usually starts when one tries to add technical concepts to the definition of a paradigm that is, conceptually, above technology. This confusion usually starts with the introduction of virtualization, web 2.0, grid computing, and so on and so forth. This reminds me of innumerous discussions with  fellow colleagues, about SOA and Web Services; the former, the concept and the latter, a technology that best applies it. Undoubtedly, virtualization, grid computing, web 2.0, SOA, WOA, etc., are the technology trends that will, for now, fuel the Cloud Computing initiative, but these are ephemerons, and the same concept remains regardless of technology changes.

                Cloud Types

In terms of implementation, there are three major types of cloud deployments; internal clouds, private clouds, and public clouds.

Cloud Types

                               Private Clouds

Private clouds (aka, on-premises cloud) are cloud deployments inside the organization’s premises, managed internally without the benefits of the economy of scale but with advantages in terms of security. This is becoming a new form of architecture for the Datacenter, sometimes mentioned as a Datacenter-in-a-box. VMWare is pioneering this approach, delivering products that will help to implement this type of cloud through their products vCloud, vCenter, and vSphere. VMWare is also leading an effort to achieve standardization for the cloud through the DMFT (Distributed Management Task Force) organization.

                               Public Clouds

Public Clouds are the original concept of cloud computing based on the ubiquity of the internet. This type of cloud provides all the benefits of the economy of scale, ease of management, and ever growing elasticity. The major concern about this style of deployment is security, and that is the only reason why the other types of cloud deployment have a say.

                                Hybrid Clouds

Hybrid Clouds are a deployment type that sits between the private and the public clouds. Hybrid Clouds are usually a combination of private clouds and public clouds, usually, managed using the same administration and monitoring consoles (therefore, the importance of cloud standardization). 


Much more than the technology that supports it, Cloud Computing is the last plateau of evolution of the IT industrialization process. Looking back at the recent years of the IT industry, it was predictable that something like Cloud Computing would come to revolutionize the IT industry. It seems that for a while, the “tecky” people took over the IT business, always eager to try new technologies, often with little value for the business they were trying to support. Now business is back to claim  added value from the IT departments, and Cloud Computing may very well be the answer.

All Roads Lead to Rome – Towards the Clouds

Cloud Computing is growing, and every solution provider wants to be part of the hype. This new trend promises to abstract IT professionals from the underlying nuts and bolts of server virtualization, storage allocation, scalability, availability, and operational overhead. It also aims to deliver on-demand, self-servicing capacity to reliably run applications through a simple administration console that allows you to monitor service levels and react accordingly. In a nut shell, this is the main idea of Cloud Computing.

Every company has realized the potential of this new idea, and they are all rushing to provide the most comprehensive solution. Cloud solutions come in many forms. Some providers even cover all the different flavors, being IaaS (Infrastructure as a Service), PaaS (Platform as a Service), and SaaS (Software as a Service) the most common. So, what we see is, companies traditionally from the application infra-structure arena starting to incorporate virtualization solutions into their platforms and deliver Cloud Platforms in one or all of its forms. We also see companies, traditionally from the virtualization solution market, providing better management solutions, and partnering with application solution providers to deliver their Cloud Platforms, in one or all of its forms.

Another question that may arise is, if you are out in the market to purchase one of these solutions, which one best serves your interests!? Hard to tell, but I would say that it all depends on your particular requirements. Companies like VMWare and Citrix have strong virtualization products. VMWare, in particular, has partnered with a few other companies to provide virtual appliances with operating systems, database management systems, application servers, CRM, ERP, collaboration and communications solutions, etc. On the other side of the spectrum, companies like ORACLE, Microsoft, and IBM, also provide excellent solutions based on their application infrastructure and own virtualization solution. ORACLE, Microsoft, and IBM are extremely good in application infrastructure and are gaining expertise in the virtualization field. ORACLE has its virtualization solution based on the Xen open source solution, and is in the process of acquiring Virtual Iron and SUN Microsystems both of which have virtualization solutions based on Xen. Microsoft has its own Hyper-V solution. All of them also support VMWare virtualization solutions.

Bottom line, every new reference enterprise solution in the market is aiming at the “clouds”, providing a new form of DataCenter architecture based on simplicity and ease of use. Computer systems often evolve towards the use of standards achieving complex architectures based on building blocks made of well-known and reliable technologies. We have seen it in the past from objects, to components, to services, to composite applications, from virtualization, to RTI, to Cloud Computing, and will continue to see more and more levels of abstraction.

Virtualization and Cloud Computing

The most recent solutions from Microsoft and VMWare incorporate Cloud principles into their virtualization solutions. This is a predictable move since one of the major features of Cloud solutions is their elasticity which is accomplished heavily through virtualization. Cloud Computing solutions provide sophisticated administration tools, as well as, service level monitoring tools. Consequently,for visionary companies like Microsoft and VMWare ,extending these tools to their virtualization offerings is expectable. Additionally, VMWare extended its product to allow On-Premises installation, allowing customers to mitigate most of their security issues raised by an Off-Premises Cloud solution. Microsoft´s position on this isn´t yet clear.

The following diagram shows the architecture of Microsoft and VMWare solutions:


Microsoft´s solution,  taking the company’s background in consideration, targets the developer community, providing an integrated PaaS solution, including application services, database services, access control services, etc.

VMWare, on the other hand, relies on established partnerships to provide production ready application services through its Virtual Appliance Program.

The following diagram shows the use of VMWare´s solution on a Cloud environment:

 VMWare Cloud Architecture

The following diagram shows the use of Microsoft´s solution on a Cloud environment. Notice that Microsoft has not yet decided to provide an On-Premises Cloud solution, hence the grey cloud:

 Microsoft Cloud Architecture

VMWare has a credible solution to implement DataCenter setups On-Premises. The downside of VMWare´s solution, is that it only provides an IaaS solution which is expectable from a company that dedicates itself to virtualization solutions. Nevertheless, VMWare has established several partnerships with various application software providers to deliver Virtual Appliances that provide application engines (e.g., WebSphere), database engines (e.g., ORACLE), etc. Microsoft´s Cloud solution is more complete, in the sense that, it provides a fully loaded PaaS solution.

 Since I have dedicated some entries on this blog to Microsoft´s Cloud Solution, I will now concentrate on VMWare´s solution. The evolution of VMWare´s offerings has gone from a pure virtualization solution to a virtual DataCenter solution, with sophisticated administration tools, to a Cloud IaaS oriented operating system.

 VDC-OS and Cloud-OS

With its vCloud solution, VMWare delivers a Cloud operating system for Cloud providers. Many of these companies have already implemented VMWare´s vCloud solution, and this is expected to continue. VMWare is also targeting On-Premises installations, and taking advantage of the fact that Microsoft hasn´t taken a stand on this kind of installation.

Windows Azure – Service Bus Publish/Subscribe Example

Within the Azure Platform, there is a set of services named .NET Services. These set of services were originally known as BizTalk.NET, and it includes the Workflow Services, the Access Control Services, and the one we will talk about, the Service Bus.


The Service Bus implements the familiar Enterprise Service Bus Pattern. In a nutshell, the service bus allows for service location unawareness between the service and its consumer, along with a set of other, rather important, capabilities. The Service Bus allows you to build composite applications based on services that you really do not need to know where they are. They could be in servers inside your company, or on a server on the other side of the world; the location is irrelevant. There are, nevertheless, important things you need to know about the service you are calling, namely, security. The Access Control Service integrates seamlessly with the Service Bus to provide authentication and authorization. The Access Control Service will be addressed in some other entry, for now we are concentrating on the Service Bus.

The following diagrams depict different scenarios where it makes sense to use the Service Bus.



Depending on the Service Bus location, it can take a slightly different designation. If the Service Bus is installed and working on-premises, it is commonly known as an ESB (Enterprise Service Bus), if it is on the cloud, it takes the designation ISB (Internet Service Bus). It is still not clear what Microsoft´s intentions are regarding an on-premises offering of the Azure Platform. The following diagram shows another possible scenario for using the Service Bus.

Scenario 3

As I mentioned before, there are several other benefits associated with the use of the Service Bus that can be leveraged by the configuration shown in this diagram. For instance, the Service Bus also provides protocol mediation allowing use of non-standard bindings inside the enterprise (e.g., NetTcpBinding), and more standard protocols once a request is forwarded to the cloud (e.g., BasicHttpBinding).

Going back to our example, we are going to setup the publisher/subscriber scenario depicted in the following diagram.


Let´s start by building the service. To do so follow the steps:

1) Sign in to the Azure Services Platform Portal at

2) Create a solution in the Azure Services Platform Portal. This solution will create an account issued by the Access Control Service ( The Access Control Service creates this account for convenience only, and this is going to be deprecated. The Access Control Service is basically an STS (Security Token Service), there is no intention from Microsoft to build yet another Identity Management System. Although it integrates with Identity Management Systems such as Windows CardSpace, Windows Live Id, Active Directory Federation Services, etc.

3) Create a console application named “ESBServiceConsole”

4) Add a reference to the “System.ServiceModel” assembly

5) Add a reference to the “Microsoft.ServiceBus” assembly. You can find this assembly in the folder “C:\Program Files\Microsoft .NET Services SDK (March 2009 CTP)\Assemblies\Microsoft.ServiceBus.dll”. By the way I am using the March 2009 CTP on this example, you can find it at

6) Add the following interface to the “program.cs” file


[ServiceContract(Name = “IEchoContract”, Namespace = http://azure.samples/”)]

public interface IEchoContract


[OperationContract(IsOneWay = true)]

void Echo(string text);



7) Add the following class to the program “program.cs” file


[ServiceBehavior(Name = “EchoService”, Namespace = http://azure.samples/”)]

class EchoService : IEchoContract


public void Echo(string text)


Console.WriteLine(“Echoing: {0}”, text);




8) Add the following code to the “main” function


// since we are using a netEventRelayBinding based endpoint we can set the conectivity protocol, in this case we are setting it to http

ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.Http;


// read the solution credentials to connect to the Service Bus. this type of credentials are going to be deprecated, they just exist for convenience, in a real scenario one should use CardSpace, Certificates, Live Services Id, etc.

Console.Write(“Your Solution Name: “);

string solutionName = Console.ReadLine();

Console.Write(“Your Solution Password: “);

string solutionPassword = Console.ReadLine();


// create the endpoint address in the solution’s namespace

Uri address = ServiceBusEnvironment.CreateServiceUri(“sb”, solutionName, “EchoService”);


// create the credentials object for the endpoint

TransportClientEndpointBehavior userNamePasswordServiceBusCredential = new TransportClientEndpointBehavior();

userNamePasswordServiceBusCredential.CredentialType = TransportClientCredentialType.UserNamePassword;

userNamePasswordServiceBusCredential.Credentials.UserName.UserName = solutionName;

userNamePasswordServiceBusCredential.Credentials.UserName.Password = solutionPassword;


// create the service host reading the configuration

ServiceHost host = new ServiceHost(typeof(EchoService), address);


// add the Service Bus credentials to all endpoints specified in configuration

foreach (ServiceEndpoint endpoint in host.Description.Endpoints)





// open the service



Console.WriteLine(“Service address: “ + address);

Console.WriteLine(“Press [Enter] to exit”);



// close the service



Notice that I chose the Tcp protocol as the connectivity mode. In the client side, I will specify the Http protocol. This is to show that protocol mediation can be accomplished with the use of the Service Bus.

9) Add an “app.config” file to the project

10) Add the following configuration to the “app.config” file




<service name=ESBServiceConsole.EchoService>

<endpoint contract=ESBServiceConsole.IEchoContract

binding=netEventRelayBinding />





11) Compile and run the service. Enter the solution credentials, and you should get the following:


Now let´s build a client application.

1) Add a console project named “ESBClientConsole” to the solution.

2) Add a reference to the “System.ServiceModel” assembly.

3) Add a reference to the “Microsoft.ServiceBus” assembly.

4) Add the following interface to the “program.cs” file


[ServiceContract(Name = “IEchoContract”, Namespace = http://azure.samples/&#8221;)]

public interface IEchoContract


[OperationContract(IsOneWay = true)]

void Echo(string text);



public interface IEchoChannel : IEchoContract, IClientChannel { }


5) Add the following code to the “main” function


// since we are using a netEventRelayBinding based endpoint we can set the conectivity protocol, in this case we are setting it to http

ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.Tcp;


// read the solution credentials to connect to the Service Bus. this type of credentials are going to be deprecated, they just exist for convenience, in a real scenario one should use CardSpace, Certificates, Live Services Id, etc.

Console.Write(“Your Solution Name: “);

string solutionName = Console.ReadLine();

Console.Write(“Your Solution Password: “);

string solutionPassword = Console.ReadLine();


// create the service URI based on the solution name

Uri serviceUri = ServiceBusEnvironment.CreateServiceUri(“sb”, solutionName, “EchoService”);


// create the credentials object for the endpoint

TransportClientEndpointBehavior userNamePasswordServiceBusCredential = new TransportClientEndpointBehavior();

userNamePasswordServiceBusCredential.CredentialType = TransportClientCredentialType.UserNamePassword;

userNamePasswordServiceBusCredential.Credentials.UserName.UserName = solutionName;

userNamePasswordServiceBusCredential.Credentials.UserName.Password = solutionPassword;


// create the channel factory loading the configuration

ChannelFactory<IEchoChannel> channelFactory = new ChannelFactory<IEchoChannel>(“RelayEndpoint”, new EndpointAddress(serviceUri));


// apply the Service Bus credentials



// create and open the client channel

IEchoChannel channel = channelFactory.CreateChannel();



Console.WriteLine(“Enter text to echo (or [Enter] to exit):”);

string input = Console.ReadLine();

while (input != String.Empty)







catch (Exception e)


Console.WriteLine(“Error: “ + e.Message);


input = Console.ReadLine();






6) Add an “app.config” file to the project

7) Add the following configuration to the “app.config” file




<endpoint name=RelayEndpoint






8) Compile the client, run three instances of the service, enter the credentials, run the client and type some text, the result should be as follows.


There you have it, a publish/subscribe example using the Service Bus.

The Azure Platform and Usage Scenarios

We have all seen the picture below showing the main blocks of the Azure Platform. But how, exactly, do all of these services work together to provide us a cloud solution? As I usually say, Microsoft is not extremely good at inventing new things, but is extremely good at turning a particular idea into a great product which really makes sense to use. With Azure, Microsoft took all its great products and frameworks and allowed us to use them on a cloud environment in a way very similar to the one we usually use on our on-premises environment. That´s not quite true; actually, they made it even easier.

Azure Services Platform

Usually what we get from a cloud computing solution is an abstraction from the underlying hardware and software where our app is going to run on. Some providers even offer other services such as database management systems, but few go as far as providing content management services, CRM services, mesh services, access control services, SQL reporting and analysis services, a service bus, workflow services, etc.

The picture above shows the three main blocks of the Azure Platform, the operating system, the services, and some client portals. Additionally, we get a development environment that allows us to use our favourite programming language. Of course, you will not get an ORACLE database or an Apache Web Server but for the most part you don´t even need to know it is an SQL Server or an IIS under the covers. Zooming in, we get to see the functionalities addressed within each of these main blocks.

Azure Services Platform Details

Within the Windows Azure, the operating system for the cloud, we have two main services; management services, also known as Fabric Controller, that takes care of all the virtualization, deployment, scaling, logging, tracing, failure recovery, etc., and the storage system that provide us with a simple way to keep our data in blobs, tables (not SQL tables), and queues. The technologies that we can use to reach all of these functionalities are various, REST, JSON, HTTP, SOAP, etc. To host our apps and services, we have IIS7 and the Framework.NET 3.5 that allows us to expose our services any way we want, through the less standard REST, to the more standard WS*. Whoever is familiar with WCF will naturally take advantage of a new set of bindings that allow your services to be exposed through the new Service Bus on a direct or publisher/subscriber fashion.

The services layer provides Live Services, from mesh services that allow you to share and synchronize folders and files, to Identity and Directory Services to manage access to resources and applications. The .NET Services consist of Access Control Services, a Service Bus Service, and a Workflow Service. The Access Control Services , built using the “Geneva” Framework, is basically an STS (Security Token Service) that provides a claims based identity model, along with federation capabilities through WS* standards, that provides authentication and authorization services to anyone trying to access the services layer. The Service Bus, formerly BizTalk Services (I´m glad they changed the name), basically provides publish/subscribe functionality for calling services, as well as location unawareness between the service and the service consumer. The Workflow Service provides service orchestration and integration with the Service Bus and Access Control Service to provide more complex functionalities. It also provides all the functionalities that you can find on Workflow Foundation, like support for long running workflows, workflow designer, etc. The SQL Services provide typical data, reporting and analysis services.

In broader terms, the Azure Platform provides the services shown below:

Azure Platform

We are, now, going to take a quick look at some usage scenarios; how exactly can all of these services and functionalities work together to compose complex applications, processes and services. Some of these I have tried myself and will be posting shortly some practical examples of it.


This is a simple use of the Storage environment for applications that require merely a way to keep their data in a persistent store. Microsoft provides Tables, Queues and Blobs, and is working on new ways to store your data, namely File Streams, Locks, and Caches. Tables allow you to store data in a similar way to a DBMS, but, in fact, there is no SQL Server involved. Queues allow you to temporarily store data for processing and are a good way to relay data from one service to another, as we will see. Blobs are more oriented to store unstructured data such as different file formats.

Web Role Example

In this scenario, we want to deploy to the cloud an ASP.NET Web Application that possibly uses some storage to keep some of its data. For this, we use the Hosted Services capability, namely, a Web Role to host the Web App.

Web and Worker Role Example

In this example, we are extending the previous example to use a Worker Role to do some background asynchronous processing. A way to relay the data to be processed is to send it through a Queue. The web application posts the data to be processed in the queue and the worker role is periodically checking for data to be processed. Web Roles are, basically, web applications or services hosted in the IIS. Worker Roles are NT services with a specific interface similar to the SCM (Service Control Manager) that are constantly running and looking for something to do.

ESB Services Example

As explained in the previous scenario, Worker Roles are constantly running, looking for, or waiting for something to do. Worker Roles can access the Storage or call external services through the Service Bus, to collect data, send data, or simply notify an external service of some event.

Worker role Example

In fact, Worker Roles can call any service within the cloud.

Worker Role Example

Your applications, services, or any other processes can call into any of the services provided by Azure directly to enrich their functionality. The .NET Services, on their own, can then call other services and/or interact with the Storage system. Through the Storage system we can trigger worker processes to do some asynchronous work for us.

ESB Services Example

The Service Bus is a powerful and useful service that basically acts as mediator between consumers and services. This mediation can be accomplished in two ways; one that allows direct calls from a consumer to a service, another in a publish/subscribe fashion. In both cases, there is no knowledge of the location of the service; the consumer addresses the Service Bus unaware of the service location. This addressing is accomplished through a URL of type sb:// that both service and consumer use to register themselves on the Service Bus. The service must be registered and active on the Service Bus in order for the call from the consumer to get to it. WCF provides a new set of bindings that allow you to address the Service Bus, BasicHttpRelayBinding, WSHttpRelayBinding, NetTcpRelayBinding, etc.

ESB Services Example

As mentioned, the Service Bus allows a publish/subscriber mechanism for service invocation. This allows one call from a consumer to reach several services that expose the same interface. To work with this configuration, the service contracts should not return values. WCF provides a particular binding for this configuration, NetEventRelayBinding.

ESB and Workflow Services Example

WCF also provides context bindings, WSHttpRelayContextBinding and NetTcpRelayContextBinding to be used for WCF-WF integration. These bindings allow for WF Receive Activities (Web Services exposed directly from WF workflows) to receive contextual calls, i.e., there is an extra SOAP Header (instanceID) with a reference to the persisted workflow. Those of you familiar with the WF-WCF integration will easily understand the importance of these two bindings.

ESB Services Example

As we have seen the Service Bus can call any other services available in the cloud and outside it. Worker Roles can also implement services and register them on the Service Bus thus allowing external apps to call them.

Access Control Service Example

Every call to the services is validated against the Access Control Service. The Access Control Service is actually an STS (Security Token Service) that intercepts all calls authenticating the caller of the service and returning a number of claims used to allow the service to authorize the call. Now, this is a complex topic on its own which I will write about on a later entry in this blog. For now, I just wanted to give an idea on how this service is used.

Access Control Service Example

Same thing accessing the web apps in the Web Role hosted services or the storage.

There are a number of possibilities, just use your imagination (and some best practices), and you can, basically, mix and match these services according to your needs. You can build complex processes, applications and services using these building blocks without having to worry about setting up the infrastructure that supports it. The benefits are obvious, and I believe that in the long term this is where IT is heading.

Hosting a WCF Service in Windows Azure

When I first tried to create and deploy a WCF Web Service into the cloud I faced several constraints, some derived from my inexperience with the Azure Platform, some due to the fact that this is still a fairly recent technology from Microsoft, a CTP after all. In the next few paragraphs I will walk you through the steps to create and deploy a WCF service exposed with the WsHttpBinding.

There are a few prerequisites that need to be met in order to proceed with Azure development. To setup the proper development environment one needs to have:

Windows Vista or Windows 2008
Visual Studio 2008 + SP1
Windows Azure SDK and Windows Azure Tools for Microsoft Visual Studio
Access to Azure Services Developer Portal

Now, lets start by creating a new project in Visual Studio of type “Web Cloud Service”


Leave the configuration and definition files as they were created by Visual Studio. Note that the CTP access permits only one instance, i.e., only one virtual machine, do not change this setting, you can play with it only on the local development Fabric.

Even though all we want is to create and delpoy a WCF Service, leave the “default.aspx” page merely as a faster way to verify that the package was properly deployed. For that just add a label to the page with some text.


Now add a WCF Service to the project as follows


Alter the service contract to something a little more demo friendlier like

public interface IService
string Echo(stringmsg);

public class Service : IService
public string Echo(stringmsg)
return “Echo: “+ msg;

Also alter the configuration file (web.config) specifying the security policy for your binding

binding name =wsConfig>
security mode =None />
service behaviorConfiguration=MyCloudService_WebRole.ServiceBehaviorname=MyCloudService_WebRole.Service>
endpoint address=“” binding=wsHttpBinding contract=MyCloudService_WebRole.IServicebindingConfiguration=wsConfig>
endpoint address=mex binding=mexHttpBinding contract=IMetadataExchange />

Test your web application and service locally right-clicking the default.aspx page and selecting “View in Browser”.


You used the ASP.NET Development Server for this test. If you use the local Azure Development Fabric you will get the following error when you test your service. This appears to be a bug because you do not get the same error once you deploy to the real cloud.


Speaking of deployment, right-click on the MyCloudService project and select “Publish”. Once you select the “Publish” option you should see a browser open on your Azure project as shown bellow, as well as an explorer window opened with the configuration and definition files. Press the “Deploy…” button and follow the instructions.


Press the “Run” button to test you web app and service, this will take several minutes while starting your VM.


To test your app simply press the temporary DNS name provided and you should get something similar to


Now, change the URL to address the Web Service and you should get


Notice that the URL for the WSDL provided by Azure is an internal URL which is not resolved, this has been reported as a bug and will be fixed. To view your WSDL simply change the URL at the browser to


Now, promote your project to the production environment



This should be quite fast since it is only changing the DNS with which your app is exposed.

Our test would not be completed without building a client that actually called the service, so let´s do it. Since the provided WSDL on the cloud has references to URLs that are not resolved from the client the best way to build the client is to run the service locally with the “ASP.NET Development Server”. For that simply double-click the “ASP.NET Development Server”


And browse to the WSDL


Then add a console application to the solution as follows


Reference the Web Service to create the proxy


And add the following code to the main function

static void Main(string[] args)
ServiceClient proxy = new ServiceReference1.ServiceClient();
Console.WriteLine(proxy.Echo(“Hello Cloud World!”));

First, test it locally, then change the address in the configuration file to the one in the cloud

<endpoint address= binding=wsHttpBindingbindingConfiguration=WSHttpBinding_IService contract=ServiceReference1.IServicename=WSHttpBinding_IService>

Compile it and run it against the cloud. You should get an exception as follows

“The message with To ‘; cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver’s EndpointAddresses agree.”

This is due to a verification made by the default “EndpointAddressMessageFilter” that detects a mismatch between both addresses. The cause of this may be related to the virtualization of the service address probably related to the internal assigned address ““. The following code was retrieved with the Reflector and shows the logic behind the “Match” function.

public override bool Match(Message message)
if (message == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(“message”);
Uri to = message.Headers.To;
Uriuri = this.address.Uri;
return (((to != null) && this.comparer.Equals(uri, to)) && this.helper.Match(message));

Fortunatelly, there is a behavior to resolve this problem, add it to the ServiceHost as shown bellow, recompile and redeploy the service to the cloud

[ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)]
public class Service : IService
public string Echo(stringmsg)
return “Echo: “+ msg;

Run the client console application again and this time you should get a response back from your cloud service.