Scenario:
- Web Api application in NET Core 2.2, it is deployed on multiple containers.
- In Startup, I read from the database password from HashiCorp Vault and put it into my connection string.
- I add the Entity Framework Core context to the Service Collection.
- I use the context in multiple controllers.
If I change the database password in Vault, all the the requests to the database will fail due to authentication errors.
I can bring all the containers down and when they restart they will have the new password, but that is not what I want to do. There are a few hacky ways of getting around this problem but they involve not using the Service Collection and I want to use it.
Question:
Does EF Core support password rotation, or is there a way to achieve this while still using the Service Collection?