workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🚀 Feature Request: Add an option to prevent overwriting dashboard variables when deploying Wrangler.

Open khaledkhalil94 opened this issue 3 years ago • 2 comments

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.

khaledkhalil94 avatar Nov 16 '23 10:11 khaledkhalil94

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.

juanmiguelguerrero avatar May 21 '24 09:05 juanmiguelguerrero

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)

penalosa avatar May 21 '24 10:05 penalosa