Skip to content

docs to add envFile to the dapr runfile - #5477

Open
ep0ll wants to merge 3 commits into
dapr:v1.19from
ep0ll:envfile
Open

ep0ll wants to merge 3 commits into
dapr:v1.19from
ep0ll:envfile

Conversation

@ep0ll

@ep0ll ep0ll commented Nov 7, 2026 •

Copy link
Copy Markdown

Thank you for helping make the Dapr documentation better!

Please follow this checklist before submitting:

  • Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • Read the contribution guide
  • Commands include options for Linux, MacOS, and Windows within tabpane
  • New file and folder names are globally unique
  • Page references use shortcodes instead of markdown or URL links
  • Images use HTML style and have alternative text
  • Places where multiple code/command options are given have tabpane

In addition, please fill out the following to help reviewers understand this pull request:

Description

Documents the new envFile property in the Multi-App Run template (multi-app-template.md), added to the Dapr CLI in dapr/cli#1740.

Documents the new envFile option for the Multi-App Run template, which lets you load environment variables from a .env file instead of listing them inline. It covers both self-hosted and Kubernetes runs, explains how envFile relates to env, and notes where relative paths are resolved from and which Dapr CLI version introduces it.

Issue reference

Related to dapr/cli#1369 (the CLI feature request for envFile support). There is no docs issue to close.

Signed-off-by: GitHub <noreply@github.com>
@ep0ll
ep0ll requested review from a team as code owners November 7, 2026 10:30
@CasperGN CasperGN self-assigned this Nov 7, 2026

@CasperGN CasperGN left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ep0ll for your interest in Dapr and for adding envFile to the Multi-App Run template docs 🙌 I like that both the example and the property tables spell out that env and envFile can't be used together, and the precedence note is a nice touch. The PR description is empty, so could you link the dapr/cli change or issue that adds envFile and say which CLI release ships it? That makes it easy to confirm it belongs on the v1.19 branch. I left a few comments inline, please take a look 👀

Drafted with AI assistance and reviewed by me.

| `appHealthThreshold` | N | Number of consecutive failures for the app to be considered unhealthy | |
| `enableApiLogging` | N | Enable the logging of all API calls from application to Dapr | |
| `env` | N | Map to environment variable; environment variables applied per application will overwrite environment variables shared across applications | `DEBUG`, `DAPR_HOST_ADD` |
| `envFile` | N | Path to a `.env` file containing environment variables. Cannot be used together with `env` in the same section. Environment variables applied per application will overwrite those shared across applications | `./app.env` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does dapr run -k actually read envFile when it deploys to Kubernetes? The .env file is local, so I'd like to be sure the CLI puts those variables into the generated deployment. If it does, I think the Kubernetes tab should also get the commented envFile lines in its example and the note that env and envFile can't be used together, so the two tabs match. If it doesn't, could we drop this row?

- `appDirPath` under apps section should be provided relative to the template file path.
- All other relative paths under apps section should be provided relative to the `appDirPath`.

For environment variables, `env` and `envFile` are mutually exclusive within the same section (`common` or an app). Precedence, highest first: app `envFile` or `env`, then `common` `env` or `envFile`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about also saying where a relative envFile path resolves from? Going by the path rules just above, I'd expect an app's envFile to resolve from its appDirPath and the common one from the template file. Saying so here would save readers a guess, since ./backend.env in the example only works if that's true.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ATM, they resolve from the current working dir from where the cmd ran, should i update the code insteadin PR: dapr/cli#1740

| `enableApiLogging` | N | Enable the logging of all API calls from application to Dapr | |
| `runtimePath` | N | Dapr runtime install path | |
| `env` | N | Map to environment variable; environment variables applied per application will overwrite environment variables shared across applications | `DEBUG`, `DAPR_HOST_ADD` |
| `envFile` | N | Path to a `.env` file containing environment variables. Cannot be used together with `env` in the same section. Environment variables applied per application will overwrite those shared across applications | `./app.env` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a link to the dapr/cli PR or release that adds envFile, either in the PR description or as a version note here (for example "Available from Dapr CLI v1.x")? Nothing else in the docs mentions envFile or a matching --env-file flag yet, so readers on an older CLI would hit an unknown field.

Document Kubernetes envFile support and path resolution, align examples, and link the CLI implementation and issue.

Signed-off-by: Sai Kiran Maggidi <107541780+ep0ll@users.noreply.github.com>
Document envFile in the Kubernetes tab, state that relative envFile paths resolve from the working directory, and replace the CLI PR and issue links with a version note.

Signed-off-by: GitHub <noreply@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants