Centralizing Azure AppFabric Service Bus configuration using SO-Aware

In the last few days, various of our customers and partners have been interested on the capabilities of SO-Aware to integrate with the different technologies of the Windows Azure platform. This post will illustrate how to use SO-Aware to centralize the configuration of WCF services that interact with the Windows Azure platform AppFabric.

The Windows Azure platform AppFabric is a key component of Microsoft's cloud computing platform. In a nutshell, the AppFabric includes a Service Bus for connectivity across network and organizational boundaries, and Access Control for federated authorization as a service. The interaction with the Service Bus and the Access Control Service is abstracted through elements of the WCF programming model such as bindings and behaviors . Similarly to other protocols, developers need to familiar with the configuration of those bindings and behaviors in order to successfully interact with the Azure AppFabric. This task can be drastically simplified if developers could reuse an existing configuration stored in a centralized location.

SO-Aware (Tellago Studios' WCF Registry) enables developer to centralize the configuration of the Windows Azure AppFabric bindings and behaviors using the same model followed by other WCF artifacts. For instance, the following figure illustrates the default configuration of the netTcpRelayBinding using SO-Aware.

SW_AzureSBServiceConfig[1]

In addition to bindings, we can use SO-Aware to store the WCF behaviors required to interact with the Windows Azure platform AppFabric. The following figure illustrates the use of SO-Aware to configure an instance of the shared credentials behavior required by the Azure Access Control Service.

SW_AzureSharedCredentials[1]

Let's assume we would like to use the aforementioned Azure bindings and behaviors with the following WCF service.

   1: [ServiceContract]
   2:    public interface ISampleService
   3:    {
   4:        [OperationContract]
   5:        int Add(int param1, int param2);
   6:    }
   7:  
   8: public class SampleService : ISampleService
   9:    {
  10:        public int Add(int param1, int param2)
  11:        {
  12:            return param1 + param2;
  13:        }
  14:    }

We can instruct the service to resolve its configuration from SO-Aware using the following code.

   1: <serviceRepository url="http://localhost/SOAwarePortal/ServiceRepository.svc">
   2:     <services>
   3:         <service name="ref:SampleMathService(1.0)@dev"
   4:           type="Tellago.ServiceModel.Governance.AzureSamples.SampleService, 
   5:                 SampleService"/>
   6:     </services>
   7: </serviceRepository>

Using the SO-Aware portal, we can configure the service to interact with the Azure Service Bus as shown in the following figure.

SW_AzureSBServiceConfig[1]

At this point, our sample WCF service is completely configured to use the Azure platform AppFabric. The following client interacts with the service using the Azure Service Bus.

   1: private static void Test()
   2: {
   3:   SampleServiceClient service= new SampleServiceClient();
   4:   int result= service.Add(11,11);
   5: }

Using the following configuration.

   1: <system.serviceModel>
   2:         <client>
   3:             <endpoint address="sb://tellago-samples.servicebus.windows.net/"
   4:                       binding="netTcpRelayBinding"
   5:                       behaviorConfiguration="sharedSecretClientCredentials" 
   6:                       contract="ISampleService"
   7:                       name="AzureBinding_ISampleService"/>
   8:         </client>
   9:  
  10:         <behaviors>
  11:             <endpointBehaviors>
  12:                 <behavior name="sharedSecretClientCredentials">
  13:                   <transportClientEndpointBehavior credentialType="SharedSecret">
  14:                         <clientCredentials>
  15:                             <sharedSecret issuerName="owner" 
  16:                                issuerSecret="Issuet Secret"/>
  17:                         </clientCredentials>
  18:                   </transportClientEndpointBehavior>
  19:                 </behavior>
  20:             </endpointBehaviors>
  21:         </behaviors>
  22:     </system.serviceModel>

As you can see, by centralizing the WCF configuration, the use of SO-Aware can drastically simplify to the adoption path for the Windows Azure platform AppFabric in the enterprise.

No Comments