# Environment variables for app functions

**URL:** <https://community.dynatrace.com/t/environment-variables-for-app-functions/38548>\
**Category:** Developer Q&A Forum\
**Tags:** app-functions\
**Created:** [February 22, 2023, 8:42pm UTC](https://community.dynatrace.com/t/environment-variables-for-app-functions/38548 "2023-02-22T20:42:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![StephenLHChan](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@StephenLHChan](https://community.dynatrace.com/u/StephenLHChan)\
**Post date:** [February 22, 2023, 8:42pm UTC](https://community.dynatrace.com/t/environment-variables-for-app-functions/38548/1 "2023-02-22T20:42:12Z")

</div>

Hi,

Do app functions support loading environment variable from .env file?

```javascript
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';
}

```

---

<div class="post-metadata">

**Author:** ![stefan\_baumgart](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/stefan_baumgart/32/33707_2.png) [@stefan\_baumgart](https://community.dynatrace.com/u/stefan_baumgart)\
**Post date:** [February 23, 2023, 11:23am UTC](https://community.dynatrace.com/t/environment-variables-for-app-functions/38548/2 "2023-02-23T11:23:51Z")

</div>

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.
