🚀 Feature Request: Add an option to prevent overwriting dashboard variables when deploying Wrangler.
Describe the solution
Hello,
I'm trying to have the source of truth for environment variables to be the dashboard instead of wrangler.toml.
The value of this change would be to have easier deployment process when changing variables.
Now I can't find any option to do that, I thought the option keep_vars would help my case, but turns out it only prevent removing dashboard vars that aren't specified in wrangler.toml.
My experience with this is very bad.
Variables that are created in the Dashboard should not be deleted when deploying the worker.
This does not work as expected.
This is expected behaviour (see https://developers.cloudflare.com/workers/wrangler/configuration/#source-of-truth). We recommend managing your Worker configuration entirely in wrangler.toml, but the keep_vars option will allow you to manage some variables in the dashboard instead of Wrangler. As you've noted, you then can't set those variables in wrangler.toml, but you can set them for local development using a .dev.vars file (see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets for more details)