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.
 
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.
<ItemGroup>    
  <FilesToXmlPreprocess Include="ProcessDespatchAdvices.xml">
    <LocationPath>..\ESB</LocationPath>
  </FilesToXmlPreprocess>    
  <EsbItineraries Include="ProcessDespatchAdvices.xml" >
    <LocationPath>..\ESB</LocationPath>
  </EsbItineraries>
</ItemGroup>

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

 

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.

 

 


 

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

Upgrading BizTalk Server

In my experience there are two upgrade methods for BizTalk Server environments. You either (1) buy new hardware and rebuild from scratch by installing the latest versions of Windows Server, SQL Server, etc. or (2) perform an “in-place” upgrade where … Continue reading →

The post Upgrading BizTalk Server appeared first on QuickLearn Blog.

Blog Post by: Rob Callaway

Change Data Capture feature of SQL Server do not work with BAM Archiving.

Change Data Capture feature of SQL Server do not work with BAM Archiving.

This topic is related with the issue arise from change data capture (CDC feature of SQL Server) enabled for activity tables active and completed. The Bam arching/purging activity when set up stops change data capture. We designed a solution for one of our major client where we migrate the data from BAM tables to DB2 […]
Blog Post by: shadabanwer

Timeout Publishing Database Project to Azure

Timeout Publishing Database Project to Azure

I had created a new database project in Visual Studio 2013 and every attempt to publish the project to my Azure hosted database failed with this error: Creating publish preview… Failed to import target model [database_name]. Detailed message Unable to reconnect to database: Timeout expired. The timeout period elapsed prior to completion of the operation […]
Blog Post by: James Corbould

SQL Queries to Enable or Disable All BizTalk SQL Server Agent jobs

SQL Queries to Enable or Disable All BizTalk SQL Server Agent jobs

BizTalk is shipped out with a total of 13 SQL Agent jobs. Experienced BizTalk professionals know that all the BizTalk SQL Server Agent jobs except the MessageBox_Message_Cleanup_BizTalkMsgBoxDb job should be enabled and running successfully. Besides this job the other jobs should not be disabled! However one of the most common and important tools to resolve […]
Blog Post by: Sandro Pereira

Installing Redis Cache Locally in a Development Environment

Installing Redis Cache Locally in a Development Environment

I recently blogged about using the excellent Redis Cache – which is now the preferred Azure caching solution – for a recent CRM integration project. In my development environment, I’m pointing against the Azure Redis Cache and while performance is fantastic, I recently saw that Chocolatey have an MS Open Tech version of Redis in […]
Blog Post by: modhul

BizTalk Health Monitor v2 soon available : more reliable and completly customizable

BizTalk Health Monitor v2 soon available : more reliable and completly customizable

Hello,

I'm pleased to inform you that BizTalk Health Monitor (BHM) v2 is finished and will be available very soon on the  Microsoft Download Link Center.

The BHM team improved drastically this MMC snap-in to make it more reliable and very customizable.
In this new version you will be able so to customize completly the dasboard views by creating your own tiles to display custom warnings, specific summary reports entries, or even queries output.
You will be also able to add quickly custom queries and rules.
These features were expected by lot of BHM users to provide more flexibility in this health check console and to use it as a centralized health application. 

In BHM v2, you can so complete easily the query repository of BHM adding  your custom queries executing WMI, .VBS, PowerShell, .CMD or .BAT scripts.
These queries will be stored per group node (renamed "profile" node in BHM v2).

You can also create your own rules in addition to the native BHM rules, using a declarative method to define your own conditions and triggered actions.
These custom rules can target existing native BHM queries but also your own custom queries of course.
These custom rules will also be stored per profile node.

Stay tuned so, BHM availability will be announced on the BHM blog but also on my MBV one.

Thanks !

JP


Blog Post by: JPAUC