Thursday, October 25, 2018

Notes on building a BizTalk Build and Release Server using TFS

I created a BizTalk build server to handle building BizTalk solutions as well as releasing/deploying the artifacts to the BizTalk environments.  It's running like a champ and the group is very happy with the implementation and results.  Getting a build server properly set up wasn't difficult, but there were a few things that I jotted down for documentation.  These notes are what you see below.

Here are the background/requirements/setup:
  • Visual Studio 2015 is being used to develop the BizTalk 2016 solutions
  • We use two NuGet repositories:  The main NuGet repository, and our own company-based repository.  I'll discuss the NuGet setup in a later post.
  • We are using the MSBuild.  XAML is not being used.
  • Deployment Framework for BizTalk 5.7 is being used.
  • Use of some simple, custom PowerShell scripts on local server is secondary method when BTDF doesn't make sense.
  • Right now I have just one agent set up.  I really haven't come upon a need to add more.  It's easy enough to add more agents, so there's no need to fret on this.

I did follow a good portion of what Vikas Bhardwaj put in his blog - it's a fantastic resource and got me going in the right direction.  Please take the time to read all parts, as there is good information in each one.

For my environment, I had the server team in my company create a new (small) server just for BizTalk builds/releases - you may want to do the same as there extra components that need to be installed.  I think it's just one cpu with a 200 gig hard drive.  It's mostly inactive compared to other servers.

Some notes:
  • You will need to ensure you have opened ports HTTP, HTTPS, and Windows Remoting (80, 443, 5985, and 5986) between the build server and the destination servers when using the build server to do Releases/Deployments. The port for PowerShell is needed only if you are going to perform a 'PowerShell on Target Machines' task.  This has been a huge plus, as I'll explain later.
  • Since we are using BizTalk 2016, I installed Visual Studio 2015.  Make sure you install all the necessary components (i.e. C#, VB.NET, whatever) you require in order to do a proper solution build.  For me, I left the default values alone.
  • Install BizTalk 2016, but select only the following:
    • Just the Developer Tools and SDK
    • Server Runtime (and all sub-categories) - you need this to compile a BizTalk solution.
    • Administration Tools And Monitoring (and all sub-categories)
    • Additional Software
    • Enterprise Single Sign-On Administration
    • Enterprise Single Sign-On Master Server
    • BAM Client
    • Project Build Component
    • Allow the installation wizard to install the Prerequisites
    • DO NOT CONFIGURE BIZTALK !!!!!
    • Note on the above: my interpretation is that a BizTalk license isn't necessary.  See BizTalk Pricing.  Send me a note if that is incorrect.
  • We installed the Deployment Framework for BizTalk, version 5.7.  Select everything but the samples.
  • We found that we came across two scenarios for building/deploying BizTalk artifacts: 
    • Large, complex applications worked very well under the BTDF
    • Small projects (single map, receive location, etc) worked just fine running the btstask.exe command via a PowerShell on Local Server task.  This is where opening port 5985 was critical.  PowerShell remoting (WinRM) is VERY powerful.
  • Installing an Agent wasn't difficult.  However, having the proper rights/permissions was difficult.  Make sure you have a good relationship with your server admins.  ☺☺

After I got the above finalized, we were hitting the ground with getting Build Definitions set up.