BizTalk Continuous Integration with Visual Studio Team Services (VSTS)

Posted: January 12, 2016  |  Categories: BizTalk Uncategorized
Tags:

Published By: Bill Chesnut

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)

 

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

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

image

 

Modification to the Deployment.btdfproj file required for VSTS Build

Open the Deployment.btdfproj files clip_image001
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>

clip_image003

clip_image005

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>

clip_image007
Update this line for any properties that need to be pulled from the EnvironmentSettings file clip_image009
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>

clip_image011
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 clip_image013
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

clip_image015

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 clip_image002
Select Empty

Click Next

clip_image004
Select Default for the Default agent queue

Click Create

clip_image006
Click Save clip_image008
Type the name for the build, usually the same name as the solution

Click OK

clip_image010
Click Options

Note: The build steps will be added later

clip_image012
Take Default Options

Click Repository

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

clip_image014
Select true for Clean

Click Variables

clip_image016
Take Default Configuration clip_image018
Take Default Configuration

Note: These can be set according to the clients requirements

clip_image020
Enter the string shown for the Build number format clip_image022
Take Default Configuration

Click Save

clip_image024
Click OK clip_image026
On the Build Tab

Click Add build step

clip_image028
From Utility Tasks, Select PowerShell

Click Add

Click Close

clip_image030
Configure as shown clip_image032
On the Build Tab

Click Add build step

clip_image028[1]
From Utility Tasks, Select PowerShell

Click Add

Click Close

clip_image030[1]
Configure as shown clip_image034
On the Build Tab

Click Add build step

clip_image028[2]
From Build Tasks, Select Visual Studio Build

Click Add

Click Close

clip_image036
Configure as Shown

Click the pencil at the end of the name

clip_image038
Update Name

Click OK

clip_image040
On the Build Tab

Click Add build step

clip_image041
From Test Tasks, Select Visual Studio Test

Click Add

Click Close

clip_image043
Configure as Shown

Update Step Name

clip_image045
On the Build Tab

Click Add build step

clip_image041[1]
From Build Tasks, Select MSBuild

Click Add

Click Close

clip_image047
Configure as Shown

Update Step Name

clip_image049
On the Build Tab

Click Add build step

clip_image041[2]
From Test Tasks, Select Visual Studio Test

Click Add

Click Close

clip_image051
Configure as Shown

Update Step Name

clip_image053
On the Build Tab

Click Add build step

clip_image041[3]
From Build Tasks, Select Visual Studio Build

Click Add

Click Close

clip_image036[1]
Configure as Shown

Update Step Name

clip_image055
On the Build Tab

Click Add build step

clip_image041[4]
From Build Tasks, Select MSBuild

Click Add

Click Close

clip_image057
Configure as Shown

Update Step Name

clip_image059
On the Build Tab

Click Add build step

clip_image060
From All Tasks, Select Copy and Publish Artifacts

Click Add

Click Close

clip_image062
Configure as Shown

Update Step Name

clip_image064
On the Build Tab

Click Add build step

clip_image060[1]
From All Tasks, Select Copy and Publish Artifacts

Click Add

Click Close

clip_image062[1]
Configure as Shown

Update Step Name

clip_image066
On the Build Tab

Click Add build step

clip_image060[2]
From All Tasks, Select Copy and Publish Artifacts

Click Add

Click Close

clip_image062[2]
Configure as Shown

Update Step Name

clip_image068
Click Save clip_image069
Click OK clip_image071
To Test the Build

Click Queue build

clip_image073
Take Defaults

Click OK

clip_image075
Verify build complete successfully clip_image077

 

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

#1 all-in-one platform for Microsoft BizTalk Server management and monitoring
turbo360

Back to Top