One of the aspect of the application design is the configuration module.
There are at least 4 repositories where we can store the configuration for BizTalk orchestration :
- Custom config file
- BizTalk config file
- Windows Registry
- Database
Since each company will have its own policy for the production environment, this will eventually lead into the configuration repository.
Each repository above has its own pros and cons to implement, but I would say that configuration files and registry will not scale for MultiServer / Clustering environment, since we need to replicate them to each of the BizTalk server. So it will be easier to use database since we can put the configuration information in one place and all the servers will access this central database.
But when it comes to the database, we will have the next question of where to store the connection string. Well, this is the point where SSODB comes in handy.
As we may notice, whenever we install BizTalk Server, the Enterprise Single Sign-on will need to be installed as well, and the Enterprise Single Sign-on has a database, named SSODB. This is mainly used for BizTalk to store all the internal configuration information.
This SSODB will be the ideal solution for the configuration repository since as far as i know.
Benefits :
- SSO will be installed and running along with BizTalk server
- It provides encryption
- It provides a central configuration repository for multi server environment
Microsoft also provide a sample of how to use the SSO as configuration Store (
http://go.microsoft.com/fwlink/?LinkId=99741)
How to configure our application configuration in SSODBThe SSO Installation comes some executable files in folder at C:\Program Files\Common Files\Enterprise Single Sign-On.
The executable which we're going to use is ssomanage.exe
As you can see in the screen shot above, there are some paramaters we can pass into the ssomanage.exe.
To create our custom application configuration :
1. Define our custom application configuration definition xml (below)
Note :
- When defining the fields, notice that the 1st field (ordinal=0) is a reserved field, so do not define any of your field in here, start defining our custom fields from the 2nd field (ordinal=1) afterwards.
- Use masked=true attribute to fields which need more security.
2. Save into xml file, e.g. BizAppTest1.xml
3. Run ssomanage.exe -createapps BizAppTest1.xml
4. Go to C:\Program Files\Microsoft BizTalk Server 2006\SDK\Scenarios\Common\SSOApplicationConfig
5. Run Setup.bat to compile the tool, the executables should be generated in the bin folder (BTSScnSSOApplicationConfig.exe)
6. Use this tool to define our fields value :
Example :
BTSScnSSOApplicationConfig.exe -set BizAppTest1 "ConfigProperties" "ConnectionString" "Data Source=."Note : Use "ConfigProperties" for the SSOIndentifierName parameter
7. Verify whether the value is correct
Example :
BTSScnSSOApplicationConfig.exe -get BizAppTest1 "ConfigProperties" "MaxInstances" Richard Seroter has created his own awesome
SSO Config Store Application Manager as window client tool to do the configuration in SSODB. You may want to take a look at it and try it yourself. He also has a lot of great biztalk posts and bits ;)
Note : If you have any additional fields or you want to remove the fields from SSO, the only way i know right now is to delete the app (ssomanage.exe -deleteapp BizAppTest1) and then re-do all the steps to setup the configuration. I created some script in a batch file so it will be much easier to do and can be re-used for deployment to production as well.
How to retrieve the configuration from SSODBFear not, when we install the enterprise single-sign on, there is an installed interface component which will provide the functionality to access the SSODB database, so we don't need to take care about how and where to connect to the SSODB database.
After you download the BizTalk Sample file for SSO As configuration store
http://go.microsoft.com/fwlink/?LinkId=99741, there is a utility cs file, named SSOConfigHelper.cs. You can either include this class or the dll into your project.
Then we can retrieve our custom configuration value by calling this static method from the SSOConfigHelper class :
Microsoft.SSO.Utility.SSOConfigHelper.Read("BizAppTest1", "ConnectionString");Hope this helps :)