Note: this is account wide for me, but for the sake of debugging let’s use cedblog.netlify.app
I can’t seem to be able to find anymore the environment variable settings: when I click on the Environment variables section in the site settings I can only see Shared Environment Variables (which is disabled as I’m on a starter kit plan).
My builds work as expected, so the variables are still there, but I can’t change the existing or add new ones via the UI
Same here. I think someone shipped a bug which is rendering the “shared environment variables” component in the “site environment variables” section of the app. Please let us know when this can be fixed. I need to update an environment variable for my client. Thanks!
To get this working quickly, you can use the steps below, some have dialogue options. This assumes you aren’t using separate contexts – see the CLI documentation for more info on setting context values.
EDIT:--replace-existing will replace all of your .env vars, so be sure to put all of them in the .env.netlify file.
NOTE: The steps below will create a backup of your env vars locally, so if you have anything sensitive in your env vars, be sure to 1) not to commit to a repo and 2) remove the file or backup securely as needed.
Create a .env.netlify file with all of your env vars you want present on your netlify instance. You can base this off your backup from step 5. For example:
Whoever shipped this needs to stay away from shipping production code.
As much as I appreciate this issue could be frustrating, could you please avoid blaming folks? it’s not helpful, and since it’s my post to begin with, I’d rather keep a positive attitude towards a service that is fantastic (and, in the starter kit tier, also free)
But, if we’re on free plan we can’t complain… although there are other free options out there like vercel, fly, etc. Just happens I like Netlify as it’s fast and easy to configure…
But one note, if you use --replace-existing then you will lose existing env vars if you had some. So it seems best if adding vars, to include in your .env.netlify file all your existing vars if you do use --replace-existing so they are preserved as-is.
If you need to update just one var as I did you can simply just execute either of the following from netlify env:set --help:
$ netlify env:set VAR_NAME value # set in all contexts and scopes
$ netlify env:set VAR_NAME value --context production # one environment
$ netlify env:set VAR_NAME value --context production deploy-preview # multiple environments