BizTalk 2006: Deploy the Policies with command line (BTSTask)

It is not so strightforward as it suppose to be.
Below are the bat files with comments:
 
@rem ----------- Deploy.Policies.bat ---------------------------------------------
@call Settings.bat
 
@ECHO.
@ECHO.  Deploy Policies:
@ECHO.  ======================================================================
@ECHO.
 
@Time /T
@ECHO 1) Create the ResourceSpec.xml file.
@rem BTSTask ListApp  /ApplicationName:%ApplicationName%  /Server:%BizTalkDataBasesServer% /Database:%BizTalkConfigurationDataBase% /ResourceSpec:"%CurrentBuildPath%\ResourceSpec.xml
 
@Echo 2) Then edit it to remain only Policy recources.
 
@Echo 3) Export .xml to .msi
@rem BTSTask ExportApp /ApplicationName:%ApplicationName% /Package:"%CurrentBuildPath%\Policies.msi" /ResourceSpec:"%CurrentBuildPath%\ResourceSpec.xml"  /Server:%BizTalkDataBasesServer% /Database:%BizTalkConfigurationDataBase%
 
@Echo 4) Import .msi (Before this Undeploy the existed policies, the /Overwrite doesn't help! Or Stop the Application.)
BTSTask ImportApp /Package:"%CurrentBuildPath%\Policies.msi" /ApplicationName:%ApplicationName% /Overwrite  /Server:%BizTalkDataBasesServer% /Database:%BizTalkConfigurationDataBase%
 
@Echo 5) Deploy policies one by one :((
 
@set PolicyName=VesselID
@set PolicyVersion=1.27
BTSTask AddResource  /ApplicationName:%ApplicationName% /Type:System.BizTalk:Rules  /Overwrite /Name:%PolicyName% /Version:%PolicyVersion% /Server:%BizTalkDataBasesServer% /Database:%BizTalkConfigurationDataBase%
 
@set PolicyName=CompanyID
@set PolicyVersion=1.0
BTSTask AddResource  /ApplicationName:%ApplicationName% /Type:System.BizTalk:Rules  /Overwrite /Name:%PolicyName% /Version:%PolicyVersion% /Server:%BizTalkDataBasesServer% /Database:%BizTalkConfigurationDataBase%
 
@set PolicyName=PortOfUnloadingID
@set PolicyVersion=1.0
BTSTask AddResource  /ApplicationName:%ApplicationName% /Type:System.BizTalk:Rules  /Overwrite /Name:%PolicyName% /Version:%PolicyVersion% /Server:%BizTalkDataBasesServer% /Database:%BizTalkConfigurationDataBase%
 
@set PolicyName=DocumentValidator
@set PolicyVersion=1.1
BTSTask AddResource  /ApplicationName:%ApplicationName% /Type:System.BizTalk:Rules  /Overwrite /Name:%PolicyName% /Version:%PolicyVersion% /Server:%BizTalkDataBasesServer% /Database:%BizTalkConfigurationDataBase%
 

@Time /T
 
@rem call RestartBTS.bat
 
pause
 

@rem ----------- Settings.bat ---------------------------------------------
@set MyShortSolutionName=MyShortSolutionName
@Set SolutionName=MyCompany.Domain.%MyShortSolutionName%
@set SolutionDir=C:\Solutions\%MyShortSolutionName%
@SET CurrentBuildPath=%SolutionDir%\Builds\Current
@SET BizTalkServer=BTS-06V
@SET BizTalkDataBasesServer=BTS-06V
@SET BizTalkConfigurationDataBase=BizTalkMgmtDb
@Set ApplicationName=%MyShortSolutionName%.MyApp



 
Print | posted on Tuesday, April 10, 2007 8:41 AM

Feedback

# re: BizTalk 2006: Deploy the Policies with command line (BTSTask)

left by Raghav at 9/19/2007 9:20 AM Gravatar
I tried the way you shown in your bat file. But the policies were not deployed. they were in published state only.

# re: BizTalk 2006: Deploy the Policies with command line (BTSTask)

left by Leonid Ganeline at 9/19/2007 9:24 AM Gravatar
did you Undeploy the existed policies?

# re: BizTalk 2006: Deploy the Policies with command line (BTSTask)

left by Vivek at 9/25/2007 1:08 PM Gravatar
Raghav/Leonid

Were you guys able to figure this out. Even I was not able to deploy the policy, it was in the published state.
AddResource only seems to publish the policy file.

Any help would be appreciated.

Thanks

# re: BizTalk 2006: Deploy the Policies with command line (BTSTask)

left by Saied at 1/21/2015 11:34 AM Gravatar
Can you guys tel me how I can stop/start an application in BizTalk Server Administrator (BTStask) after importing a config file?
thanks.

# re: BizTalk 2006: Deploy the Policies with command line (BTSTask)

left by Leonid Ganeline at 1/21/2015 11:39 AM Gravatar
First, refresh the application then right-click app and Start...

# re: BizTalk 2006: Deploy the Policies with command line (BTSTask)

left by Saied at 1/21/2015 12:14 PM Gravatar
Can you guys tel me how I can stop/start an application in BizTalk Server Administrator (BTStask) after importing a config file?
thanks.

Thanks for your response but I meant the command line syntax. Is any with BTSTask.

Post A Comment
Title:
Name:
Email:
Comment:
Verification: