22 Feb 2023 08:42 PM - last edited on 02 May 2023 02:43 PM by educampver
Hi,
Do app functions support loading environment variable from .env file?
export default async function (payload: unknown = undefined) {
const config = {
host: process.env.SERVER,
port: process.env.PORT,
username: process.env.USERNAME,
password: process.env.PASSWORD
}
...
return 'Hello world';
}
Solved! Go to Solution.
23 Feb 2023 11:23 AM - last edited on 19 Apr 2023 08:41 AM by educampver
No. Dynatrace app functions are not based on Node, nor do they have access to the file system or other process-related information. You can think of them as an ephemeral execution of just this one workload, with no knowledge of its surroundings other than the platform.
If you want to access secrets and configuration, you need to use the App Settings API and the Secrets/Credentials Vault, but they might not yet be available in Customer Preview.