Skip to content

Conversation

@filintod
Copy link
Contributor

@filintod filintod commented Oct 3, 2025

Description

This PR allows for substituting env var templated strings in components (resources) so a user can run configuration without having to change the component yaml file. Any templated value like {{env_var_name}} in the component file will be substituted with the env var value, if it exists, or leave as is if not. You can also define default values in the shape of {{env_var_name:default_value}} where the colon : is the separator to indicate what is the default value if there is no env var with that name.

Note:

  • for multi-app runs there is no notion of using the env attribute to use for this, that is only pass to the app. The replacement does not use any of the env variables set in the multi-app run file.
  • this solution might be replaced in the future by adding env var substitution in dapr/dapr when loading the component files content

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

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

@filintod filintod requested review from a team as code owners October 3, 2025 15:52
@filintod filintod marked this pull request as draft October 3, 2025 15:54
Signed-off-by: Filinto Duran <[email protected]>
@WhitWaldo
Copy link

Isn't this already possible via secret references (and use of the local envvar secret store)?

@filintod
Copy link
Contributor Author

filintod commented Oct 5, 2025

oh, maybe and I just did not know, let me check this envvar secret store.

Looking at it, still need to test, it might work, it does look a bit more convoluted for a developer (create the secret store, limit env vars to some prefix, and then add the auth to the component to use) but it might be fine to start with.

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