variablesherokuenvironment-variables

How to use config vars on heroku when using Stack=container


When using stack container deployment (config set stack), you would need changing config vars on the dashboard at heroku. But something bad happen. Step by step:

  1. Go to Settings
  2. Press Reveal Config Vars
  3. Add o Modify some config vars there
  4. Press Hide Config Vars
  5. Press Reveal Config Vars
  6. The config vars you earlier modified or added is not there with the last modified value, there something unexpected behaviour. Your code doesn't aware of any changes on the config var. So yo need to delete app, then initialize a new app, and then rebuild all the code including config vars with the desired values.

I want to change env vars at Dashboard or trough config set without deleting and rebuilding app.


Solution

  • Finally, after testing a lot, I found that by changing Deploy to Heroku Git and then changing Settings. Automatically Deploy move to Github Connected, preserving the new values for env var you modified. enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    enter image description here