Click or drag to resize

NeonServiceLoadEnvironmentVariables Method

Loads environment variables formatted as NAME=VALUE from a text file as service environment variables. The file will be decrypted using NeonVault if necessary.

Note Note
Blank lines and lines beginning with '#' will be ignored.

Namespace:  Neon.Service
Assembly:  Neon.Service (in Neon.Service.dll) Version: 2.10.0
public void LoadEnvironmentVariables(
	string path,
	Func<string, string> passwordProvider = null


Type: SystemString
The input file path.
passwordProvider (Optional)
Type: SystemFuncString, String
Optionally specifies the password provider function to be used to locate the password required to decrypt the source file when necessary. The password will use a default password provider passwordProvider is null. See the remarks below.
FileNotFoundExceptionThrown if the file doesn't exist.
FormatExceptionThrown for file formatting problems.

The default password provider assumes that you have neonDESKTOP installed and may be specifying passwords in the `~/.neonkube/passwords` folder (relative to the current user's home directory). This will be harmless if you don't have neonDESKTOP installed; it just probably won't find any passwords.

Implement a custom password provider function if you need something different.

See Also