BizTalk Server 2006 has been out and around for a while, now. Those of you who are familiar with both BizTalk 2004 and 2006 know that some of the biggest improvements have been made in the tools used for deploying and managing applications. One of my favorite improvements is the ability to export an application as an MSI file.
I recently had a question in a class about how someone could create an MSI for a BizTalk application that has different port binding configurations available for different environments. This was a good question, and something I think a lot of developers overlook.
By default, when you export an application to an MSI file, the port configuration settings of the application are saved directly in the MSI. This means that when you import the MSI somewhere else, you end up with ports that match the original environment. This works well, provided all your development, test, and production environments are exactly the same.
To save developers from having to create and re-create the same ports over and over again, BizTalk 2006 has the ability to create binding files. Binding files are XML representation of the port configuration from the BizTalk configuration database. Binding files include the transport settings of the ports, pipeline and maps used by the ports, and the application in which the port is contained, among other things. You can use the Administration Console to export or import binding files to quickly save and recreate physical ports. So what does this have to do with MSI files?
The short version of this is, create your physical send and receive ports, with the appropriate configuration for the end points you are interested in. Once you’ve created all the bindings for one environment export the bindings. Repeat this for the various environments that you need ports for.
Once all your binding files are created, you can add them to the Resources folder of the application (be sure to fill in the Target Environment box). When you export the application as an MSI, the bindings are bundled with it. When you import the MSI, the Target Environment page of the wizard will have a drop down list from which you can choose the bindings to apply.
There are two things you need to remember:
- You don’t need connectivity to the system in order to configure a port if you know all the properties (server name, user name, password, URI, connection string, etc.) so you can create the binding files in any environment.
- Passwords are not saved in the binding file (huge security risk), so they will need to be reconfigured after the MSI has been imported.
Try using the above recommendations next time you are in need of creating several MSI files with disparate application bindings.