In a previous post we introduced Windows Server AppFabric, a set of extensions to the Windows Application Server that “make it easier to build, scale and manage Web and composite applications that run on Internet Information Services (IIS).” AppFabric enhances the Application Server role in Windows by providing some features out of the box that customers previously have had to build by themselves. These include a scalable distributed cache and features for managing WCF and WF services. In this post I’m going to give you some tips for getting started with the service and workflow management features of AppFabric.

First, if you haven’t already done so, install AppFabric. You’ll find a pointer to the download page on the Windows Server AppFabric Development Center site.  Keep this site handy. This is the main site for AppFabric and is where you will find the latest news as well as links to samples, tutorials, and the support forum.

 Find the link to the download page on the Dev Center site.  Follow that link and take a few minutes to download and read the installation guide and release notes. Install any prerequisite software and Windows hotfixes that you may be missing. The prereqs include .NET 4 Beta 2 and Windows PowerShell v2. If you’re running on Windows Vista SP2 or Windows Server 2008 SP2 you’ll need to uninstall PowerShell v1 and download and install v2. Windows 7 and Windows Server 2008 R2 include PowerShell v2 by default. See the installation guide for details.

On the download page find the Setup package for your machine’s operating system and architecture, and run the Setup wizard. We’ll use only the service and workflow management features of AppFabric for now so we require only the Worker feature to be installed, but install and configure the distributed cache features if you will use those later.

The Dev Center site links to a tutorial that walks you through deploying, configuring, monitoring, and managing a WF service.  The tutorial does a nice job introducing most of the service and workflow management features of AppFabric and is well worth the time to go through. The first version of the tutorial has you use the IIS Manager tools for the exercises, while the second version has you complete the tasks using PowerShell cmdlets and scripts. The tutorial comes with a sample application that you will deploy using the Web Deployment Tool. You’ll hear us highlight this tool quite a bit as we talk about managing IIS hosted services. The tool is powerful for synchronizing applications and IIS settings from one machine to another.

If you just want to see some of the features in action, though, you can create a simple workflow service project in Visual Studio 2010 and run it in IIS. Create a new project using the WCF Workflow Service Application template. This will give you a workflow service with a GetData operation that receives a message and sends a response. On the project properties, view the Web tab and configure the application to run in IIS instead of the Visual Studio Development Server.  If you’re running Visual Studio elevated as an administrator and you have the IIS 6 Management Compatibility feature of IIS installed you can create a new virtual directory directly from the Web tab. Otherwise, use IIS Manager to create the virtual directory, pointing it to the root directory of your Visual Studio project. (This is where you’ll find the web.config and XAMLX files.)

Once you have your application running in IIS you can see and manage its services with AppFabric. Open IIS Manager and expand the tree. Click on the root node and find the Application Server Extensions for .NET 4 modules in the center features pane. With those modules you can view service activity on the Dashboard, view endpoints, and configure services. Go back to your project in Visual Studio and add a Delay activity at the end of your workflow to keep instances alive for a few minutes so you can watch them go from the Active to Idle states in the Persisted WF Instances section of the Dashboard and see the instances show up in the WF Instance History section as they complete.

AppFabric adds some powerful features to the Windows Application Server. Install the Beta 1 and go through the tutorials to learn about the features in depth, or try a simple scenario on your own to get familiar with the features. If you run into any problems or have feedback to share with us please do so in our forum  or via our Connect page.