Environment variables, which are key-value pairs configured outside your source code, allow you to dynamically modify application behavior depending on environment.
Using environment variables, you can define various configuration options for your Dagster application and securely set up secrets. For example, instead of hard-coding database credentials - which is bad practice and cumbersome for development - you can use environment variables to supply user details. This allows you to parameterize your pipeline without modifying code or insecurely storing sensitive data.
Environment variables are defined in the agent's configuration in your project's dagster_cloud.yaml file. Values are pulled from your user cluster, meaning they don't pass through Dagster Cloud.Supported for Hybrid deployments only.
For Dagster Cloud Hybrid deployments, making environment variables accessible is accomplished by adding them to your agent's configuration in your project's dagster_cloud.yaml file. How the container_context property is configured depends on the agent type.
Refer to the configuration reference for your agent type for more info and examples:
Dagster Cloud provides a set of built-in, automatically populated environment variables, such as the name of a deployment or details about a branch deployment commit, that can be used to modify behavior based on environment.