matjanos / matjanowski-blog

BSD Zero Clause License
0 stars 0 forks source link

Managing options and secrets in .NET Core and Docker #3

Open matjanos opened 3 years ago

PeterMilovcik commented 2 years ago

I'm not able to use builder.AddUserSecrets<Startup>(); - cannot resolve symbol AddUserSecrets. Which NuGet package do I need for this?

matjanos commented 1 year ago

hi @PeterMilovcik , It is here

jpeckham commented 1 year ago

I didn't have to add that manually... is it because i'm using WebApplication.CreateBuilder ?

var builder = WebApplication.CreateBuilder(args);
Umut-Numanoglu-Docplanner commented 1 year ago

Is there any more roboust way of doing it after nearly 3 years? My problem is that the USER_SECRETS_ID is different for everybody, so everybody needs to change the docker-compose file for themselves. Also there are extra steps for securing the credentials on each machine, sending them to each developer and making sure to update it on each machine when something changes sound very counterproductive to me. Before C# I was using ansible for managing our project, which offers an encrypted vault, which can be used with an agent. Maybe there is something similar from Microsoft? Or should I look into 3rd party tools like Harshicorp Vault?

darcythomas-coop commented 9 hours ago

Is there any more roboust way of doing it after nearly 3 years? My problem is that the USER_SECRETS_ID is different for everybody, so everybody needs to change the docker-compose file for themselves.

A couple of options:

  1. Have the same USER_SECRETS_ID for all developers; It should be unique per project/solution, not unique per developer
  2. create an .env file per developer with their USER_SECRETS_ID; Make sure you add .env to the .gitignore file