cli icon indicating copy to clipboard operation
cli copied to clipboard

Add support for updating env variables without restarting app

Open vpavic opened this issue 5 years ago • 8 comments

At present, the heroku config:set and :unset CLI commands will restart the app immediately after applying the env variable change.

This might not always be desirable. For instance, if I'm adding env variables that will be only consumed by the next release of the app, it does not make sense to restart the currently deployed app. Coming from Cloud Foundry I've found this very surprising, as cf client doesn't do implicit restarts after manipulating environment but rather has a dedicated restage command for that purpose.

Please consider adding an option to the heroku config:set and :unset CLI commands that would prevent restarting the app.

My environment is:

$ heroku --version
heroku/7.42.5 linux-x64 node-v12.16.2

vpavic avatar Jul 28 '20 10:07 vpavic

Agreed. In our use case, we setup user connections to the database, and adding or removing users causes app restarts on each change. It'd be great if we could bulk up the changes to ENV variables for addon:attach and detach of the credentials, then do a restart. (I browned out our site the other day running a script to move users to a new follower, forgetting that each remove AND each add triggers a separate restart).

chrismo avatar Aug 11 '20 14:08 chrismo

Any feedback from the maintainers on this proposal?

vpavic avatar Oct 01 '20 14:10 vpavic

Indeed this feature would be very useful

alexvictoor avatar Jan 14 '21 10:01 alexvictoor

Heroku should strongly consider this proposal

luizsignorelli avatar Aug 02 '21 17:08 luizsignorelli

heroku config:edit CLI command supports batching of manual config changes, using the config-vars API.

While this doesn't solve the challenge with addon-related config var updates restarting the app, it does help for other types of config var changes.

mars avatar Jan 06 '22 23:01 mars

Any news regarding this issue? I also consider this feature really useful.

cpor3 avatar Oct 27 '23 14:10 cpor3

This would be very useful +1

davidemerritt avatar Dec 13 '23 21:12 davidemerritt

Very useful to have it.

I am now trying to deploy a new version for my app where production credentials are used. When I try to deploy the app it fails because the env with the key to decrypt the credentials is not the correct one. Setting the env key before fails because app restarts.

It would be great to have an argument were one could set env vars for the deploy:

--vars RAILS_MASTER_KEY=XXXX

replusminus avatar Feb 24 '24 00:02 replusminus