I have a Azure KeyVault providing a password which I'd like to read into a SecureString.
If I try to read the string as a SecureString from the IConfiguration object, it will return a null:
config.GetValue<SecureString>("AdminPW") == null
I can read the string in as a string and convert to SecureString, but this seems like a dirty hack:
var pass = new SecureString();
foreach (var c in config.GetValue<string>("AdminPW").ToCharArray())
{
pass.AppendChar(c);
}
Is there a way to get a SecureString directly from the IConfiguration?