how to store/write values in SSO through Biztalk?

Goutham mark 1 Reputation point
2022-02-28T11:35:59.92+00:00

Values from SSO can be read through calling .Net helper classes in Biztalk.
but writing values to SSO through Biztalk (.Net helper Classes) is never found.

Microsoft BizTalk Server
Microsoft BizTalk Server
A family of Microsoft server products that support large-scale implementation management of enterprise application integration processes.
347 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Colin Dijkgraaf 1,346 Reputation points
    2022-02-28T22:50:45.833+00:00

    As per my answer on StackOverflow

    What you need is a method to call ISSOConfigStore.SetConfigInfo(String, String, IPropertyBag) Method added to the helper class for SSO

    And then a link in the comments to old MSDN/TechNet forum where the OP shared a bit of code

    method snippet for writing to SSO:

    public static void Write(string appName, string propName, string propValue)
            {
                try
                {
                    ISSOConfigStore configStore = (ISSOConfigStore)new SSOConfigStore();
                    ConfigurationPropertyBag appMgmtBag = new ConfigurationPropertyBag();
                    object tempProp = propValue;
                    try
                    {
                        appMgmtBag.Remove(propName);
                    }
                    catch { }
                    appMgmtBag.Write(propName, ref tempProp);
                    configStore.SetConfigInfo(appName, idenifierGUID, (IPropertyBag)appMgmtBag);
                }
                catch (Exception e)
                {
                    System.Diagnostics.Trace.WriteLine(e.Message);
                    throw;
                }
            }
    
    0 comments No comments