Tuesday, February 15, 2022

SSIS -Set database password without clear text - SENSITIVE PARAMETERS - GetSensitiveValue()

SSIS -Set database password without clear text -  SENSITIVE PARAMETERS - GetSensitiveValue()









public void Main()
       {
           try
           {
               string strPassword = Dts.Variables["$Project::up_DBPassword"].GetSensitiveValue().ToString();
               if (!string.IsNullOrEmpty(strPassword))
               {
                   Dts.Variables["User::uv_DBPasswordSensitiveValue"].Value = strPassword;
               }
               Dts.TaskResult = (int)ScriptResults.Success;
           }
           catch (Exception e)
           {
               Dts.Log(e.Message, 0null);
               Dts.TaskResult = (int)ScriptResults.Failure;
               throw (e);
           }
           Dts.TaskResult = (int)ScriptResults.Success;
       }



No comments:

Post a Comment

Encrypt/Decrypt the App.Config

Program.cs using System; using System.Diagnostics; using System.IO; namespace EncryptAppConfig {     internal class Program     {         pr...