Retrieve name of SQL Server of BizTalk Group

Topics: Bindings File, Settings Management and SSO, Server Deployment, Tips and Tricks
Jan 12, 2015 at 4:23 PM
Hi all,

I use BTDF to deploy BizTalk Applications and T-SQL scripts throughout our DTAP environment.

We have 2 Production environments with BizTalk 2013 Standard edition. We also have a generic BizTalk solution which contains scripts to deploy an Archive database which we want to deploy to both environments.

We want that database to be deployed to the same SQL Server that has the BizTalkMgmtDb of that BizTalk Group. So I want to retrieve, at runtime, the name of the SQL Server of the BizTalk Group on which the deployment is taking place.

Is there any way BTDF can retrieve the name of the SQL Server that holds the BizTalkMgmtDb?

Thanks in advance!
Lex
Coordinator
Jan 13, 2015 at 4:15 AM
Hi Lex,

As long as you run the Archive database deployment on one of the BizTalk servers, it's straightforward to set up an MSBuild property.
<PropertyGroup>
  <MgmtDBServer>$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\BizTalk Server\3.0\Administration', 'MgmtDBServer', null, RegistryView.Registry64, RegistryView.Registry32))</MgmtDBServer>
<PropertyGroup>

It can be part of an existing PropertyGroup.

Thanks,
Tom
Marked as answer by LexHegt on 2/18/2015 at 2:17 AM
Jan 13, 2015 at 8:14 AM
Thanks Tom!

This works perfectly well!!

Best regards,
Lex
Jan 14, 2015 at 8:56 PM
Hi Tom,

I noticed that the registry also holds SQLScriptPath, which is the path to the folder where all kind of BizTalk related SQL scripts are stored. This gave me the idea of not just executing some SQL scripts from BTDF, but also automatically add a custom database to the BizTalk backup job! I wrote about it on TechNet Wiki. Hope you like it!

Best regards,
Lex
Coordinator
Feb 18, 2015 at 4:14 AM
Hi Lex,

You put together a great, comprehensive writeup. Thanks for taking the time to post it!

Regards,
Tom
Feb 18, 2015 at 9:12 AM
Thanks Tom!

My pleasure! Hope it's useful for other people as well!

Best regards,
Lex