Managing Itineraries is one of the more tedious and tricky aspects of BizTalk deployments because it is possible that some values in Resolvers are specific for a certain environment. For example a File location in the Development environment is probably not the same as in the Production environment.

To address this problem, the Deployment Framework includes in each BizTalk project an Excel spreadsheet named SettingsFileGenerator.xml that captures an unlimited number of "settings" (name/value pairs) stored as rows in the spreadsheet.  Each setting (row) has a default value in addition to a value for any number of deployment environments (stored in columns).  This makes it very easy to manage a large matrix of settings across environments in one place.

During the deployment process, setting values from your Excel settings spreadsheet are seamlessly merged with the Itinerary file(s) to produce an environment-specific Itinerary.  In the Itinerary, you replace environment-specific values with tokens that correspond to setting names in the spreadsheet.



The following steps describe how you can automatically preprocess your itineraries to replace tokens with the environment specific values. 

In Visual Studio open the Solution with the Itineraries.
Add a new Deployment Framework for BizTalk project to the Solution.
Open the Deployment.btdfproj file and set the IncludeEsbItineraries property to true.
Add the FilesToXmlPreprocess setting to make sure that the Itinerary is preprocessed. (to replace the tokens with the environment specific values.)
Add the EsbItineraries setting to deploy the Itinerary.
  <FilesToXmlPreprocess Include="ProcessDespatchAdvices.xml">
  <EsbItineraries Include="ProcessDespatchAdvices.xml" >

.csharpcode, .csharpcode pre
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
background-color: #f4f4f4;
width: 100%;
margin: 0em;
.csharpcode .lnum { color: #606060; }

Create or edit an Itinerary in the Itinerary Designer and set the Model Exporter property to: XML.
In the Itinerary, locate an environment-specific configuration value, for example a Resolver that uses the FILE adapter and replace the location with a token.
Open the file SettingsFileGenerator.xml with Excel and enter the name for the configuration element on an empty row.  In the environment-specific columns or the Default Values column, enter the appropriate value for each environment.
Deploy the Itinerary with the Deployment Framework.
Open SQL Server Management Studio and select the Itinerary XML to test if the tokens are replaced.



Once the itinerary is deployed to the Itinerary Store database and a Receive Location in BizTalk is created that uses the Itinerary, the solution is ready to be tested.

Run DebugView to watch the trace output.




See Also

For more information on using the Deployment Framework with ESB itineraries see:

  • Use the Deployment Framework for BizTalk Server to deploy your ESB itineraries
  • Use the BTDF-SSO Resolver to dynamically resolve settings via SSO