diff --git a/docs/content/guides/dagster/using-environment-variables-and-secrets.mdx b/docs/content/guides/dagster/using-environment-variables-and-secrets.mdx index 22aa2dbfcd794..c7535efb77506 100644 --- a/docs/content/guides/dagster/using-environment-variables-and-secrets.mdx +++ b/docs/content/guides/dagster/using-environment-variables-and-secrets.mdx @@ -104,6 +104,14 @@ deployment_name = os.getenv("DAGSTER_CLOUD_DEPLOYMENT_NAME") Refer to the [Dagster+ Branch Deployments example](#example-2-dagster-branch-deployments) for a real-world example. +You can also call the `get_value()` method on the `EnvVar`: + +```python +from dagster import EnvVar + +database_name = EnvVar('DATABASE_NAME').get_value() +``` + ### From Dagster configuration [Configurable Dagster objects](/concepts/configuration/config-schema) - such as ops, assets, resources, I/O managers, and so on - can accept configuration from environment variables. Dagster provides a native way to specify environment variables in your configuration. These environment variables are retrieved at launch time, rather than on initialization as with `os.getenv`. Refer to the [next section](#using-envvar-vs-osgetenv) for more info.