<@ULVA73B9P> how do I pass 2 environment variales ...
# ask-marvin
d
@Marvin how do I pass 2 environment variales to a prefect deployment via my prefect yaml file? using prefect 2
m
To pass environment variables to a Prefect 2 deployment via the
prefect.yaml
file, you will need to use the
job_variables
section. Here is how you can structure your YAML file to include the environment variables:
Copy code
yaml
deployments:
- name: demo-deployment
  entrypoint: demo_project/demo_flow.py:some_work
  work_pool:
    name: local
  schedule: null
  job_variables:
    env:
      EXECUTION_ENVIRONMENT: "YourValue"
      MY_NOT_SO_SECRET_CONFIG: "AnotherValue"
In this example, two environment variables,
EXECUTION_ENVIRONMENT
and
MY_NOT_SO_SECRET_CONFIG
, are being set with the values
"YourValue"
and
"AnotherValue"
respectively. You can change these keys and values to whatever suits your deployment needs. For complete details, you can refer to the Prefect 2 Documentation on Overriding Job Variables.