Skip to content
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

Support environment variables DSC Meta Configuration #619

Open
Gijsreyn opened this issue Dec 24, 2024 · 4 comments
Open

Support environment variables DSC Meta Configuration #619

Gijsreyn opened this issue Dec 24, 2024 · 4 comments
Labels
Issue-Enhancement The issue is a feature or idea Needs Triage

Comments

@Gijsreyn
Copy link
Contributor

Summary of the new feature / enhancement

With the initial batch completed in #574, I want to be able to use environment variables in the directories field. The current implementation in preview.12 doesn't support the following:

{
  "resourcePath": {
    "allowEnvOverride": true,
    "appendEnvPath": true,
    "directories": ["%SYSTEMDRIVE%\\CompanyResources"]
  },
  "tracing": {
    "level": "TRACE",
    "format": "Default",
    "allowOverride": true
  }
}

Proposed technical implementation details (optional)

No response

@Gijsreyn Gijsreyn added Issue-Enhancement The issue is a feature or idea Needs Triage labels Dec 24, 2024
@SteveL-MSFT
Copy link
Member

The problem is that env vars have different syntax depending on the shell and depending on the OS. Maybe we can solve this by allowing expressions in the settings file which has an env() function that could be used along with path().

@Gijsreyn
Copy link
Contributor Author

Ah that's right. Would love to see it as an expression!

@michaeltlombardi
Copy link
Collaborator

Personally, I lean away from complicating the configuration files to support expressions. In my opinion, the configuration file should be explicit and readable purely as a text representation of the data, especially for integration/inspection scenarios.

I also wonder about the security/safety implications of allowing the meta configuration to be overridden by editing an environment variable.

@SteveL-MSFT
Copy link
Member

Env vars would probably be necessary in cases particularly on Windows that accesses the filesystem. You can't assume the systemdrive is c: and technically %programfiles%, %programdata%, %userprofile%, etc... could be moved to non-standard locations. I would agree we would not recommend using custom env vars as a way to modify config behavior, that should be parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement The issue is a feature or idea Needs Triage
Projects
None yet
Development

No branches or pull requests

3 participants