Unable to access secret-store in local dev
I have defined a couple of secrets in the Cloudflare secrets-store. I have created bindings in the wrangler.jsonc file. But when running the worker locally, I get an error that the secret is "not found".
I have tried defining these in the
.dev.vars file but to no avail.
When running wrangler dev it does say:
But, when running the worker it says:
6 Replies
yes i get the same error, it doesnt work locally you will have to put --remote on nox wrangler dev --remote -- but you wont see any logs?! i still cant find a way to get serets store working locally with remote bindings well.
it is working locally you just have to put the secret through CLI without the --remote flag
Hi @Daniel Klein can you demonstate how would i pass in the keys locally? and can i save the keys somewhere so i dont have to do it everytime.
Cloudflare Docs
Use Secrets Store with Workers
Cloudflare Secrets Store is a secure, centralized location in which account-level secrets are stored and managed. The secrets are securely encrypted and stored across all Cloudflare data centers.
Just use the command in docs without —remote flag it should be kept in .wrangler and should be there until you manually remove that folder
I stored the secrets using the dashboard secret store, if I do not use the
--remote flag to create the secrets will they still be saved on the dashboard for reference when the worker actually gets deployed ?