Skip to content

feat: add support for envfile in the dapr multiapp run - #1740

Open
ep0ll wants to merge 6 commits into
dapr:masterfrom
ep0ll:feat/envfile
Open

ep0ll wants to merge 6 commits into
dapr:masterfrom
ep0ll:feat/envfile

Conversation

@ep0ll

@ep0ll ep0ll commented Nov 1, 2026 •

Copy link
Copy Markdown

Description

Adds support for loading environment variables from an env file in dapr run -f (multi-app run). Until now, multi-app run templates only accepted environment variables written inline in the YAML file, so apps that already keep their configuration in .env files had to copy it into the template.

  • Added [envFile] as an option in the multi-app run template, at [app level / common level], pointing to a file of KEY=VALUE entries.
  • When dapr run -f launches an app, the variables from that file are added to the app's environment alongside any inline env entries.
  • Precedence: [inline env overrides envFile / envFile overrides inline env].
  • Removed the validation that ran after os.LookupEnv, which wrongly rejected valid configurations.
  • Behaviour on a missing or unparsable env file: [returns a clear error / is skipped].

Issue reference

Please reference the issue this PR will close: #1369

Closes #1369

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

ep0ll added 3 commits November 2, 2026 01:08
Signed-off-by: ep0ll <wygininc@gmail.com>
Signed-off-by: ep0ll <wygininc@gmail.com>
Signed-off-by: ep0ll <wygininc@gmail.com>
@ep0ll
ep0ll marked this pull request as ready for review November 2, 2026 14:33
@ep0ll
ep0ll requested review from a team as code owners November 2, 2026 14:33
ep0ll added 3 commits November 4, 2026 00:56
1. ensure GetDaprCommand getting evns from envFile

2. ensure RunConfig methods #getEnv #GetEnv retrive expected envs

3. ensure all common envs are propagated to all Apps

4. ensure that app's envFile apply to their respective apps

5. app envs take precedence over common envs when both envFiles have same keys

an existing test is failing, which is exected to be fixed bug in this PR

Signed-off-by: ep0ll <wygininc@gmail.com>
Signed-off-by: ep0ll <wygininc@gmail.com>
Signed-off-by: ep0ll <wygininc@gmail.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.

Please add support for envfile in the dapr multiapp run

1 participant