Here is the problem with that. A dev pushes a change that requires a change to the env file. Another dev pulls down the code, but doesn't change the env file. Everything breaks. At really bad companies, DevOps sets env vars from somewhere other than that file passed around by devs - another failure point.
My proposal:
1. Key Vault | HashiCorp Vault | whatever is the source of truth for secrets.
2. When a developer adds a key, they add it to Key Vault and update code to use it.
3. On app startup, code checks the dev's local for 2 env vars ONLY, which allow access to key vault.
4. The app then tries to pull in all the env vars it needs by secret name.
5. If any are missing, it fails.
This keeps devs from having to pass around .env files outside of source control. Btw, Azure (and all other cloud) builds can be configured to pull env vars directly from Key Vault, so there's that benefit too.