(Update: See the latest on the Deployment Framework here.)
Just when you thought automated deployments for BizTalk 2004 were safe, another update to the “Deploy with NAnt” template comes along… :)
This is a very worthwhile "upgrade" to consider taking advantage of. One of the big items is support for "configuration info within SSO", but a complete list of features/fixes, etc. is below.
SSO Integration: If you are currently using the SettingsFileGenerator.xls spreadsheet (discussed in previous entries) in conjunction with the XmlPreProcess tool to handle "environment-relative" configuration - that is, to handle variations between your dev/QA/production environments - you will be glad to know you can get more leverage out of that process now…
To review, with this process, you use the names that are defined in the first column of the SettingsFileGenerator spreadsheet (shown below) as "tokens" within your binding file, as in:
<!-- ifdef ${ xml preprocess} --> <!-- <Address>${FileSendLocation}\%MessageID%.xml</Address> --> <!-- else --> <Address>C:\temp\BizTalkSample OutDir\%MessageID%.xml</Address> <!-- endif -->
At install time, the value for FileSendLocation that is appropriate to the environment you are deploying to is "plugged in" by XmlPreProcess (but for developers, the file remains legal XML.) The spreadsheet might look as follows:
(click)
Now, however, you can also put in name-value pairs (whether they vary by environment or not) into the spreadsheet that you need access to at run time (i.e. general configuration information.)
The name-value pairs will be deployed into a newly created affiliate application within the SSO, and can be read using the SSOSettingsFileReader class (which serves as a cache, too – and is provided in the download.) The static methods on this class can be used from an orchestration expression shape, or from assemblies that orchestrations call – as in string test = SSOSettingsFileReader.ReadValue("BizTalkSample","SomeAppConfigItem"); (By the way, the “nested names” shown in the spreadsheet above are just meant to suggest a partitioning mechanism you might want to use, rather than one flat “namespace” of config data.)
Of course, the deployment scripts handle all the interaction with the SSO database for deployments/un-deployments. This whole mechanism (SettingsFileGenerator.xls, XmlPreProcess, and now SSOSettingsFileImport.exe) is worth using even if you don’t use the rest of this script infrastructure. Note that Jon Flanders had a great article on SSO-based configuration using a strongly-typed approach, where as this approach is loosely-typed, but leverages a mechanism you might already be using (i.e. the spreadsheet concept.) (Note: Jon’s code for creating/deleting affiliate apps helped me complete the SSOSettingsFileImport.exe utility quickly…)
Other features/fixes:
Other notes
The scripts like to see BizTalk projects using Debug and Release for target names. A long while back I had suggested a file-level search/replace within btproj files to change these, but two more elegant options are available:
Another note: Lots of folks have noticed that XmlPreProcess can be used for a lot more than port binding files! Log4net config files, orchestration binding files, you name it. See the full Word documentation in the download for an example of how to do this within customDeployTarget.
How do I upgrade?
Downloading
Enjoy – comments always welcome and appreciated.
Scott Colestock lives, writes, and works as an independent consultant in the Twin Cities (Minneapolis, Minnesota) area.