-
-
Notifications
You must be signed in to change notification settings - Fork 54
Description
The provider crashes if you have multiple secrets that specify the same key
This occurs in the SetData method when generating the dictionary (Unhandled exception. System.ArgumentException: An item with the same key has already been added)
Our use case is wanting to have a full set of configuration, including development or placeholder values for secrets and then a separate secret which takes precedence over this and supplies the actual secret values, overriding the placeholder values
It'd be nice if there was a way to either override the SetData method (ie we could customise the provider class - protected methods and ability to pass derived class into SecretsManagerConfigurationSource etc) or a preFilter type options method that allowed you to filter _loadedValues before the call to SetData (or at the beginning of SetData):
if (!oldValues.SetEquals(newValues))
{
_loadedValues = newValues;
SetData(_loadedValues, triggerReload: true);
}