Bryce Derriso
04/29/2024, 4:59 PMMarvin
04/29/2024, 5:00 PMjob_variables
section of your deployment definition within the prefect.yaml
file. Here is an example:
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:
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.