In my SSIS package, I need to use a password parameter and I would like to keep it as sensitive. Is there a way to read this sensitive parameter value in the script task?
I tried to use the GetSensitiveValue()
method as in this link but it always returns an empty string.
Adding the code below
Variables varCollection = null;
Dts.VariableDispenser.LockForRead("User::Username");
Dts.VariableDispenser.LockForRead("$Package::Password");
Dts.VariableDispenser.GetVariables(ref varCol);
var username = varCollection["User::Username"].Value.ToString();
var password = varCollection["$Package::Password"].GetSensitiveValue().ToString();
Are there any other ways to read the sensitive parameter value?