wrangler deploy and versions upload accept --secrets-file
Introduced 2026-03-16 · score 0.97
HOW TO USE IT
When deploying Worker code with secrets from a file, pass `--secrets-file <FILE>` to `wrangler deploy` or `wrangler versions upload`. The file can be JSON or `.env`; secrets it omits are preserved from the previous version.
npx wrangler deploy --secrets-file <PATH_TO_JSON_OR_ENV_FILE>npx wrangler versions upload --secrets-file <PATH_TO_JSON_OR_ENV_FILE>WHY THIS HELPS
Deploy Worker code with secrets from a JSON or .env file in one operation.
REQUIREMENTS AND LIMITATIONS
- Version: 4.74.0
- --secrets-file <string>: Path to a JSON or `.env` file containing secrets to upload alongside the deployment; secrets omitted from the file are preserved from the previous version.
- The file format matches `wrangler versions secret bulk` and supports JSON and .env formats.
- Secrets not included in the file are inherited from the previous version.
FIRST-PARTY EVIDENCE
- https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.74.0
- https://developers.cloudflare.com/workers/configuration/secrets/
- https://developers.cloudflare.com/workers/wrangler/commands/workers/
Check the installed version and the source before using it. Entry JSON