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.
- Configure your project to create a deployment package
- Create the package
- Import the package into AppFabric
- Change the application pool so I can authenticate with the database
- Test the service
- Quick tour of AppFabric
First, lets take a look at the test application I built in my previous post.
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.
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.
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.
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.
I can get information about the service.
I can view and even manage an endpoints.
I also have a host of configuration options provided by AppFabric.
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.
In order to fix this issue, I created a new app pool with specific credentials, and then configured my service to use those credentials.
Once done, I invoke my service again using WCF Storm and receive a valid response.
AppFabric is a great hosting environment for your services. Here is another look at the dashboard.
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.
Clicking on the calls failed link gives me a list of failed calls where I can get detailed information about the exceptions.
I can also get information about successfully completed calls.
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.
A quick recap.
- I configured my project to create a deployment package
- I created the package
- I imported the package into AppFabric
- I changed the application pool so I can authenticate with the database
- I tested the service
- 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.