If you store BizTalk application settings in Enterprise SSO database and use continuous integration in TFS you'll find these two MSBuild tasks useful.
DeploySSOConfigStore task reads settings from XML configuration file and saves them to the SSO database. The XML is created (exported) using SSO Config Tool which described in previous post. If you need to change 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 (and that can be different depending on the build target):
<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>
Another MSBuild task is for publishing WCF services - PublishBizTalkWcfServices. It sets up virtual directories (if needed), publishes WCF contracts, creates receive locations. It has comprehensive logging that helps tracking down deployment issues quickly.
public class PublishBizTalkWcfServices : Task
{ private string serviceDescriptionUrl;
/// <summary>
/// The URL to the services 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);
}
}
Source code can be downloaded from here http://www.box.net/shared/b7ry6iuw4o