Running Workflow Services on Windows Azure

Windows Azure might not support the WCF and WF4 hosting parts of Windows AppFabric bit that doesn’t mean you can’t run workflow services on Windows Azure. After all a workflow is just a .NET 4 type and Windows Azure runs the .NET framework. As a result running a workflow service is quite easy once you know how to configure it.

 

The web.config file

The first problem is that the machine web.config of an Azure virtual machine is different than that on a regular machine. As a result, by default, IIS doesn’t know what to do with a WorkflowService type, the base type of a workflow service. On a normal Windows machine with the .NET 4 framework installed there is a <system.xaml.hosting> section in the machine web.config taking care of this. As this is missing on Azure we need to make sure we add this to our web.config.

<?xml version="1.0"?>


<configuration>


  <configSections>


    <sectionGroup name="system.xaml.hosting"


                  type="System.Xaml.Hosting.Configuration.XamlHostingSectionGroup, System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">


      <section name="httpHandlers"


               type="System.Xaml.Hosting.Configuration.XamlHostingSection, System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />


    </sectionGroup>


  </configSections>


 


  <system.xaml.hosting>


    <httpHandlers>


      <add xamlRootElementType="System.ServiceModel.Activities.WorkflowService, System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"


           httpHandlerType="System.ServiceModel.Activities.Activation.ServiceModelActivitiesActivationHandlerAsync, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />


      <add xamlRootElementType="System.Activities.Activity, System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"


           httpHandlerType="System.ServiceModel.Activities.Activation.ServiceModelActivitiesActivationHandlerAsync, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />


    </httpHandlers>


  </system.xaml.hosting>


  


  <!-- Remainder config removed -->


 


</configuration>




With this piece of config in place we can go and add a Workflow Service, or a XAMLX file, to the web role and call it just like we can with a local workflow service.



 



Enjoy!



 



[f1]
[f2]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>