SSO Config and Multiple Apps

Topics: Bindings File, Settings Management and SSO
Jan 27, 2013 at 11:17 PM

Hi, I've got a question about SSO for storing config. 

I've got this in my Deployment.btproj file.

<UpdateSSOConfigItem BizTalkAppName="$(BizTalkAppName)" SSOItemName="MyKey" SSOItemValue="MyValue" />

I want to read it in my code and I do so using 

SSOSettingsFileReader.ReadString(APPLICATION, key);

where APPLICATION is the BizTalk Application Name as displayed in the Application of the BizTalk Administration Console.

What happens if I want to deploy multiple versions of my app? My code needs to know about the application name. Can I query the $(BizTalkAppName) in code? Or am I taking the wrong approach?

Thanks

Andy

 

Coordinator
Jan 28, 2013 at 5:41 AM

Hi Andy,

There's not really a simple solution for this.  If you do some web searching, you'll find others trying to query at runtime to see under which BizTalk application their code is running.  It is possible, but not a high-performance operation.  The ESB Toolkit exception handling code does it to report the app name, for example.

I've sometimes just kept the app name in a Constants.cs and updated it when needed.  You could automate that by passing the app name into the solution build on an automated build server and having a preprocessor replace the constant value in the code (via an MSBuild task, most likely).  In the Deployment Framework, the project name is already an MSBuild variable ($ProjectName) so you could pass it in via command-line or from the solution build.  The $(BizTalkAppName) variable exists in part because when the Framework's side-by-side deployment mode is enabled, it automatically appends a version number.

There's no getting around the fact that side-by-side deployment in BizTalk is really tricky in general due to schema namespaces having to be unique, etc. etc.

Thanks,
Tom