<@ULVA73B9P> how can I add an environment variable...
# ask-marvin
b
@Marvin how can I add an environment variable to a deployment infrastructure override?
m
To add an environment variable to a deployment infrastructure override, you can include them in the
job_variables
section of your deployment definition within the
prefect.yaml
file. Here is an example:
Copy code
yaml
deployments:
  - name: demo-deployment
    entrypoint: demo_project/demo_flow.py:some_work
    work_pool:
      name: local
    job_variables:
      env:
        EXECUTION_ENVIRONMENT: staging
        MY_NOT_SO_SECRET_CONFIG: plumbus
After adding the environment variables to the
prefect.yaml
file, you can deploy the flow with these job variables by running:
Copy code
shell
prefect deploy -n demo-deployment
You should then see the job variables in the
Configuration
tab of the deployment in the Prefect UI. If you want to use existing environment variables from your local environment, you can template them in the
prefect.yaml
file using the
{{ $ENV_VAR_NAME }}
syntax. For more detailed information, you can refer to the Prefect documentation.