Add a Binding File to an Application

Overview

Use the BizTalk Server Administration console or the command line to add a binding file to a BizTalk application. You might want to do this to make application or assembly deployment easier, as described in Binding Files and Application Deployment.

You can export bindings into an .xml file from a BizTalk application for an assembly, application, or group, as described in Exporting Bindings, and then use one of the procedures in this topic to add the binding file to an application.

When you do this, the binding file is added to the BizTalk Management database and displays in the BizTalk Server Administration console, in the Resources folder of the application. Unlike importing a binding file, adding a binding file does not immediately apply its bindings. Instead, the bindings are applied when the application is imported into another BizTalk group.

Important

For security reasons, when you export bindings, BizTalk Server removes the passwords for the bindings from the file. After importing the bindings, you must reconfigure passwords for send ports and receive locations before they will function. You configure passwords in the Transport Properties dialog box of the BizTalk Server Administration console for the send port or receive location. See Create a Send Port or Create a Receive Location.

Note

When you use a binding file, you should verify that the artifacts have been bound to the correct host, and that the trust level is appropriate.

When you add a binding file to an application, you can specify a value for the target deployment environment with a string that represents the environment, such as Test or Production. You can use any string for this value. Then, when you import the application, you can select which binding file to apply by providing the value that was specified for its target environment. When you do this, the bindings are applied from the binding file. Any existing bindings in the application that have the same name as bindings in the file are automatically overwritten.

When you import an application, bindings are applied in the following order. As bindings are applied during the import process, bindings that have already been applied are overwritten by new bindings that have the same name. In other words, the last binding of a particular name to be applied takes effect.

  1. Application bindings generated by BizTalk Server that were not explicitly added to the application via a binding file, but that were explicitly selected by the user for export into the application .msi file.

  2. Binding files that have been explicitly added, and do not have a target deployment environment specified. Bindings in this set are applied in no specific order.

  3. Bindings that have been explicitly added, and that have an associated target deployment environment that matches the deployment environment selected for application import. Bindings in this set are applied in no specific order.

    For more information about importing applications and applying bindings, see Import a BizTalk Application.

Prerequisites

Sign in with an account that is a member of the BizTalk Server Administrators group. Permissions Required for Deploying and Managing a BizTalk Application provides more details.

Add a binding file using BizTalk Administration

  1. Open BizTalk Server Administration (in the Start menu).

  2. Expand BizTalk Server Administration, expand the BizTalk group, expand Applications, and right-click the application to which you want to add a binding file.

  3. Point to Add, and then click Resources.

  4. Click Add, select the file to add, and then click Open.

  5. To overwrite an existing binding file in this application that has the same file name, select the Overwrite all check box. If another file exists with the same name, and you do not select this check box, the add operation will fail.

  6. In the File type drop-down list, select System.BizTalk:BizTalkBinding.

  7. In Target Environment, type a string to represent the target deployment environment where you want the bindings in this file to be applied, such as Test, and click OK.

    Important

    If you leave this field blank, the bindings in this file will always be applied upon application import.

    The binding file is added, and it displays in the Resources folder of the application.

Add a binding file using the command line

  1. Open a command prompt (Start menu > enter cmd > select Command Prompt).

  2. Type the following command, substituting the appropriate values, as described in the following table:

    BTSTask AddResource [/ApplicationName:"value"] /Type:System.BizTalk:BizTalkBinding [/Overwrite] /Source:value/Property:TargetEnvironment="value" [/Server:value] [/Database:value]

    Example:

    BTSTask AddResource /ApplicationName:"My Application" /Type:System.BizTalk:BizTalkBinding /Source:"C:\Binding Files\MyBinding.xml" /Property:TargetEnvironment="Production" /Server:MyDatabaseServer /Database:BizTalkMgmtDb

    Parameter Value
    /ApplicationName Name of the BizTalk application to which to add the binding file. If the application name is not specified, the default BizTalk application is used. If the name includes spaces, you must enclose it in double quotation marks (").
    /Type System.BizTalk:BizTalkBinding (This value is not case-sensitive.)
    /Overwrite Option to update an existing binding file. If not specified, and binding file already exists in the application that has the same file name as the file being added, the AddResource operation fails.
    /Source Full path of the binding file, including the file name. If the path includes spaces, you must enclose it in double quotation marks (").
    /Property:TargetEnvironment= A string that specifies the target deployment environment. You can use any string, for example Production. Example: /Property:TargetEnvironment="Production"

    If not specified, a value of <Default> is automatically applied. The value is case sensitive. If the value includes spaces, you must enclose it in double quotation marks ("). The maximum length of the environment value is 128 characters.
    /Server Name of the SQL Server instance hosting the BizTalk Management database, in the form ServerName\InstanceName,Port.

    Instance name is only required when the instance name is different than the server name. Port is only required when SQL Server uses a port number other than the default (1433).

    Examples:

    Server=MyServer

    Server=MyServer\MySQLServer,1533

    If not provided, the name of the SQL Server instance running on the local computer is used.
    /Database Name of the BizTalk Management database. If not specified, the BizTalk Management database running in the local instance of SQL Server is used.

See Also

Managing .NET Assemblies, Certificates, and Other Resources
AddResource Command: BizTalk Binding
Creating and Modifying BizTalk Applications