This blog post is to go along with my Integration Monday talk: http://www.integrationusergroup.com/biztalk-continuous-integration-continuous-deployment

 

Prerequisites 

Your BizTalk Solution needs to be using BTDF (https://biztalkdeployment.codeplex.com/)

You need a Visual Studio Team Services Account (https://www.visualstudio.com/)

You need a BizTalk Build Server (BizTalk Developer 2013 R2 machine with BTDF installed)

PowerShell Scripts using in VSTS Build (https://github.com/Mexia/BizTalkCICD)

 

Modifiction to the BTDF EnvironmentSettings.xml file required for VSTS Build

Add a Column for Build Server with Settings File Name: Exported_BuildSettings.xml

 

Modification to the Deployment.btdfproj file required for VSTS Build

 

Open the Deployment.btdfproj files

To Display the Build Number and date time of deployment on the BizTalk Server

Add the line below in the PropertyGroup shown

<BizTalkAppDescription>Version: $(ProductVersion) - Deployed: $([System.DateTime]::Now.ToString("dd-MM-yyyy HH:mm:ss"))</BizTalkAppDescription>

To Select the correct Environment Settings file for the Build Server

Add the line below in the PropertyGroup shown

<DeveloperPreProcessSettings Condition="'$(IsInVSTSBuild)' == 'True'">$(MSBuildProjectDirectory)\EnvironmentSettings\Exported_BuildSettings.xml

</DeveloperPreProcessSettings>
Update this line for any properties that need to be pulled from the EnvironmentSettings file

To control which Hosts get stopped and started during the install process

Add the highlighted ItemGroup, repeat the BizTalkHosts entry for all Hosts used by the application

<ItemGroup>

<BizTalkHosts Include="DefaultHost" />

</ItemGroup>
If the BizTalk Application that you are deploying references other BizTalk Applications, Add the ItemGroup show with a AppsToReference for every BizTalk Application that is referenced

If there are other BizTalk Applications that depend on the BizTalk Application that is being deployed

Add the ItemGroup and Target to the end of the Deployment.btdfproj file

Note: add a AppsToRemove line for each BizTalk Application that depends of the BizTalk Application that is being deployed

 

Steps to Create a Build in VSTS

Open the VSTS Team Project that the BizTalk Solution is in, go to the Build Tab, Click the + to create a new build

Select Empty

Click Next

Select Default for the Default agent queue

Click Create
Click Save

Type the name for the build, usually the same name as the solution

Click OK

Click Options

Note: The build steps will be added later

Take Default Options

Click Repository

Note: Create Work Item on Failure if build failure work needs to be tracked

Select true for Clean

Click Variables
Take Default Configuration

Take Default Configuration

Note: These can be set according to the clients requirements

Enter the string shown for the Build number format

 

Take Default Configuration

Click Save

 Click OK  

On the Build Tab


Click Add build step

 
From Utility Tasks, Select PowerShell

Click Add

Click Close
 
 Configure as shown  

On the Build Tab


Click Add build step

 
From Utility Tasks, Select PowerShell

Click Add

Click Close
 
 Configure as shown  

On the Build Tab


Click Add build step

 
From Build Tasks, Select Visual Studio Build

Click Add

Click Close
 

Configure as Shown


Click the pencil at the end of the name

 

Update Name


Click OK

 

On the Build Tab


Click Add build step

 
From Test Tasks, Select Visual Studio Test

Click Add

Click Close
 

Configure as Shown


Update Step Name

 

On the Build Tab

Click Add build step

 
From Build Tasks, Select MSBuild

Click Add

Click Close
 

Configure as Shown

Update Step Name

 

On the Build Tab

Click Add build step

 
From Test Tasks, Select Visual Studio Test

Click Add

Click Close
 

Configure as Shown

Update Step Name

 

On the Build Tab

Click Add build step

 
From Build Tasks, Select Visual Studio Build

Click Add

Click Close
 

Configure as Shown

Update Step Name

 

On the Build Tab

Click Add build step

 
From Build Tasks, Select MSBuild

Click Add

Click Close
 

Configure as Shown

Update Step Name

 

On the Build Tab

Click Add build step

 

From All Tasks, Select Copy and Publish Artifacts

Click Add

Click Close
 

Configure as Shown

Update Step Name

 

On the Build Tab

Click Add build step

 

From All Tasks, Select Copy and Publish Artifacts

Click Add

Click Close

Configure as Shown

Update Step Name

On the Build Tab

Click Add build step

From All Tasks, Select Copy and Publish Artifacts

Click Add

Click Close

Configure as Shown

Update Step Name
Click Save
Click OK

To Test the Build

Click Queue build

Take Defaults

Click OK
Verify build complete successfully  

 

Thanks for your time and I look forward to helping people on their BizTalk CI & CD journey