-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Clarify how wrangler --env affects loading .env and .dev.vars
#19340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deploying cloudflare-docs with
|
| Latest commit: |
9298939
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9b273a98.cloudflare-docs-7ou.pages.dev |
| Branch Preview URL: | https://envarg.cloudflare-docs-7ou.pages.dev |
|
Files with changes (up to 15)
|
petebacondarwin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we explicitly call out that we do not combine the vars from .env.<env-name> with those in .env?
I think it would be a great idea, can you add this as a suggestion - your english is better than mine :) |
src/content/docs/workers/wrangler/system-environment-variables.mdx
Outdated
Show resolved
Hide resolved
….mdx Co-authored-by: Pete Bacon Darwin <[email protected]>
|
@ToriLindsay can you please take a look when you have time? 🙏 |
|
|
||
| :::note | ||
|
|
||
| You can set system environment variables per environment by creating additional files with the naming convention `.env.<environment-name>`. When you set the environment using `wrangler <command> --env <environment-name>`, such an environment specific file will be loaded instead of the `.env` file - they are not merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| You can set system environment variables per environment by creating additional files with the naming convention `.env.<environment-name>`. When you set the environment using `wrangler <command> --env <environment-name>`, such an environment specific file will be loaded instead of the `.env` file - they are not merged. | |
| To set different system environment variables for each environment, create files named `.env.<environment-name>`. When you use `wrangler <command> --env <environment-name>`, the corresponding environment-specific file will be loaded instead of the `.env` file, so the two files are not merged. |
| ``` | ||
|
|
||
| You can set secrets per environment by creating additional files with the naming convention `.dev.vars.<environment-name>`. Like other environment variables, secrets are [non-inheritable](/workers/wrangler/configuration/#non-inheritable-keys) and must be defined per environment. | ||
| You can set secrets per environment by creating additional files with the naming convention `.dev.vars.<environment-name>`. When you set the environment using `wrangler <command> --env <environment-name>`, such an environment specific file will be loaded instead of the `.dev.vars` file - they are not merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| You can set secrets per environment by creating additional files with the naming convention `.dev.vars.<environment-name>`. When you set the environment using `wrangler <command> --env <environment-name>`, such an environment specific file will be loaded instead of the `.dev.vars` file - they are not merged. | |
| To set different secrets for each environment, create files named `.dev.vars.<environment-name>`. When you use `wrangler <command> --env <environment-name>`, the corresponding environment-specific file will be loaded instead of the `.dev.vars` file, so the two files are not merged. |
…19340) Co-authored-by: Pete Bacon Darwin <[email protected]>
…19340) Co-authored-by: Pete Bacon Darwin <[email protected]>
Summary
Clarify how
wrangler --envaffects loading.envand.dev.varsRelated to cloudflare/workers-sdk#7859
Documentation checklist