If you store BizTalk application settings in Enterprise SSO database and adapt continuous integration you’ll find this MS Build task useful. DeploySSOConfigStore task reads settings from XML configuration file and saves them to the SSO database. The XML can be created (exported) using Richard Seroter’s SSO tool which I modified to support this operation. So, if you change your configuration settings, just update XML file in the source control and build process will pick it up and propagate changes to your target environment.Using this task is very simple, it accepts just one parameter -location of the XML settings file:
<UsingTask AssemblyFile="CustomMSBuildTasks.BizTalk.dll" TaskName="CustomMSBuildTasks.BizTalk.DeploySSOConfigStore"/> <Target Name="DeploySSOConfigStore" DependsOnTargets="BizTalkDeploy"> <CustomMSBuildTasks.BizTalk.DeploySSOConfigStore XmlConfigurationUrl="$(SolutionRoot)\$(BuildBranch)\Source\BizTalkSettings\BizTalk.Configuration.xml"/> </Target>
I also added another useful task for publishing WCF services: PublishBizTalkWcfServices. It’s very simple but does all that stuff:setting upvirtual directories (if needed), publishing contracts, creating receive locations. It has comprehensive logging thathelps tracking down deployment issues quickly.
public class PublishBizTalkWcfServices : Task { private string serviceDescriptionUrl; /// <summary> /// The URL to the description file. /// </summary> [Required] public string ServiceDescriptionUrl { get { return serviceDescriptionUrl; } set { serviceDescriptionUrl = value; } } /// <summary> /// Publishes BizTalk schemas as WCF services. /// </summary> /// <returns></returns> public override bool Execute() { WcfServiceDescription description = WcfServiceDescription.LoadXml(ServiceDescriptionUrl); Publisher publisher = new Publisher(); publisher.BackgroundWorker = new System.ComponentModel.BackgroundWorker(); publisher.BackgroundWorker.WorkerReportsProgress = true; publisher.BackgroundWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(BackgroundWorker_ProgressChanged); try { PublishingResults results = publisher.Publish(description); Log.LogMessage(results.Message); } catch (Exception ex) { Log.LogError(ex.ToString(), null); return false; } return true; } public void BackgroundWorker_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { Log.LogMessage(e.UserState.ToString(), null); } }
Complete Visual Studio project is available here.