DEV Community

loading...

Discussion on: Inject Secrets into your CI/CD Pipelines

Collapse
gat786 profile image
Ganesh Tiwari

Wondering if .env files or doing the approach which you shared is a better way?

Collapse
ginomessmer profile image
Gino Messmer Author • Edited

That's a great question. Certainly, but it depends on your framework and toolset. Personally, I haven't stumbled upon any .env files in .NET projects -- but conceptionally, both environment files and the method I show in my article (by swapping out / injecting classes) are pretty much equal in the end.

Worth noting: Some modern .NET projects solve this issue by utilizing app settings and user secrets. I'm sure other programming languages offer similar solutions.

Collapse
gat786 profile image
Ganesh Tiwari

Oh yes the .env files were used in my react projects.

Thread Thread
ginomessmer profile image
Gino Messmer Author

Yeah, that’s the recommended way of doing it in React projects if I recall correctly. πŸ™‚

Forem Open with the Forem app