0

I am using Secrets Manager to retrieve database credentials and store it in a cache. I was trying to handle a scenario when we do rotation on Secrets Manager, cache should be invalidated as soon as the connection to the database raise an error (catch the exception when credentials provided invalid) then try to retrieve the new credentials from Secrets Manager.

So, I come up with an idea to override SqlConnection constructor, so then I can attach a function to re-retrieve database credentials when it fails to connect to the database.

Anybody have any thoughts how to do this?

jarlh
  • 42,561
  • 8
  • 45
  • 63
Raymond Natio
  • 556
  • 3
  • 22

0 Answers0