Deploying a WCF Service to AppFabric

In a previous post, I build a very simple WCF Workflow Service Application which leveraged the Beta BizTalk 2010 WCF LOB adapters.  You can read more about that here.  In this post, I will walk you through deploying the test application to AppFabric.

Here is a quick overview of the steps.

  1. Configure your project to create a deployment package
  2. Create the package
  3. Import the package into AppFabric
  4. Change the application pool so I can authenticate with the database
  5. Test the service
  6. Quick tour of AppFabric

First, lets take a look at the test application I built in my previous post.

image

Pretty simple stuff, receive a message, call the WCF LOB adapter for SQL to execute a query, then return the results to the client.  We tested this and it works just fine within our development environment, time to deploy this to AppFabric.

First, you need to setup your application and determine how you want to deploy.  View the properties for your application and take a look at the Package/Publish Web tab.

image

I am choosing to create a deployment package.  This simply zips everything up for you.  Once you have the location configured, save your project.

To create the deployment package, just right click on your project and select the Build Deployment Package.

image

In a few moments the package has been built and is located in the configured location.

Next I open IIS Manager and import the package.  I am going to deploy this to my default web site so I simply right click the web site and select Import Application from the Deploy menu.

image

This kicks off the Import Application Package wizard.  It lets you browse for the deployment package, gives you information on what is in the package, lets you make some configuration settings, etc.  Once you are done, you will have deployed your service.  Notice in the top right of the window that AppFabric is showing one service.  If you don’t see this, refresh AppFabric. 

Below is the AppFabric Dashboard.  This is a quick way to check the health of your services as well as view other metrics.

image

I can get information about the service.

image

I can view and even manage an endpoints.

image

I also have a host of configuration options provided by AppFabric.

image

Now that the service is deployed, time to test it.  I point WCF Storm at my service, enter some data, and invoke it.  I get an exception.  So, what is happening.  The service is running under the ASP.NET application pool which isn’t running with credentials which allow access to my database.

image

In order to fix this issue, I created a new app pool with specific credentials, and then configured my service to use those credentials.

image

Once done, I invoke my service again using WCF Storm and receive a valid response.

image

AppFabric is a great hosting environment for your services.  Here is another look at the dashboard.

image

This gives you a quick overview of the running services.  Note that I have 5 successful calls and one failed call.  If I expand the WCF Call History section I can get more information.

image

Clicking on the calls failed link gives me a list of failed calls where I can get detailed information about the exceptions.

image

I can also get information about successfully completed calls.

image

If that isn’t enough.  All this information is stored in SQL.  So I can create my own dashboard if Idon’t like the one AppFabric provides or if someone without access to the dashboard needs the information.

image

A quick recap.

  1. I configured my project to create a deployment package
  2. I created the package
  3. I imported the package into AppFabric
  4. I changed the application pool so I can authenticate with the database
  5. I tested the service
  6. We took a quick tour of AppFabric

One of the questions on my previous post was about authentication.  In his scenario, he was using the SAP adapter.  So switching the applicationPool didn’t help him with authentication.  He needs to pickup the login information from someplace before he makes the call.  Not sure if this will be my very next post, but it is something I will write up.

I also want to touch on how to use the BizTalk mapper from within WF as well as some EDI tips and tricks.  Let me know if you have something you would like to see covered.

Advertisements
Posted in AppFabric, WCF, WF
2 comments on “Deploying a WCF Service to AppFabric
  1. reading tech blogs to keep me updated on technology is what i do daily. i am a tech addict ,`’

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: