Using tokens in the Deployment Framework for BizTalk to produce an environment-specific Itinerary

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.

 

Steps

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.
Add New Project
 
Open the Deployment.btdfproj file and set the IncludeEsbItineraries property to true.
Deployment.btdfproj
 
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.
<ItemGroup>    
  <FilesToXmlPreprocess Include="ProcessDespatchAdvices.xml">
    <LocationPath>..\ESB</LocationPath>
  </FilesToXmlPreprocess>    
  <EsbItineraries Include="ProcessDespatchAdvices.xml" >
    <LocationPath>..\ESB</LocationPath>
  </EsbItineraries>
</ItemGroup>
 
Create or edit an Itinerary in the Itinerary Designer and set the Model Exporter property to: XML.
Model Exporter Properties
 
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.
Resolver Properties
 
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.
SettingsFileGenerator.xml
 
Deploy the Itinerary with the Deployment Framework.
Deploy Solution
 
Open SQL Server Management Studio and select the Itinerary XML to test if the tokens are replaced.
Itinerary Tabel
 

 

Testing

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.
DebugView

 

 


 

See Also

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

About the author

Tomasso Groenendijk lives in Netherlands and is a senior integration consultant at Motion10. He has over 15 years’ experience in software development and software design. Tomasso is specialized in application integration with a strong interest in the Windows Azure cloud platform. In 2014, 2015 and 2016 Tomasso was awarded with the Microsoft Azure MVP award. He is an active contributor to the integration community through his work on his blog, MSDN samples, TechNet Wiki and also speaking on events.

 
 
 
MVP profile Tomasso Groenendijk
 
 
Sentinet Product Specialist
 
 
BizTalk360 Product Specialist

Month List