Wednesday, April 6, 2016

Execute custom command with Deployment Framework (BTDF) in BizTalk

Some time back one requirement came to me to run some custom command execution using the Deployment Framework or BTDF.

Problem : any way, where in we can keep an orchestration in the unenlisted state using BTDF

Solution : above requirement can be fulfill with two approches

1) we can keep the property  State="Unenlisted" in PortBindingsMaster.xml file for orchestration which you wanted to keep unenlisted, but make sure StartApplication set to false.

2) using WMI script we can Unenlist the orchestration post the successful deployment using the BTDF

In Target we can create one custom Target which run post deployment in BTDF, following is the sample,

<target name="CustomTargetDeploy">
    <Exec Command="my_command_to_execute" />
</target>

instead of text "my_command_to_execute" we can write our own command like (rename, copy, del etc.) we can also call the batch file as well, following is the command line arguments for Unenlisting the orchestration.


 cscript.exe "c:\Program Files (x86)\Microsoft BizTalk Server 2010\SDK\Samples\Admin\WMI\Stop Orchestration\VBScript\StopOrch.vbs" "myNameSpaceName.OrchestrationName" "myAppName" Unenlist

we need to save above command as OrchUnenlist.bat then call this in Custom Targest.



Hope this Helps!!!

No comments:

Post a Comment