C
C#5mo ago
renchuu

✅ Storing connection string securely

I am developing a web API and I created my database first on azure. To create the models i used this command Scaffold-DbContext "CONNECTION STRING" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models Now I have my string right in the DBcontext.cs file. I don't want to keep the string in the code like that. How can I store my string in a secure way?
3 Replies
Angius
Angius5mo ago
appsettings.json Or env variable Or Azure Key Vault
Pobiega
Pobiega5mo ago
env vars in production, user secrets during development thou keyvault is also a great option, if you are already on the azure train
Want results from more Discord servers?
Add your server