Environment variables in the `infra_overrides` of ...
# prefect-cloud
d
Environment variables in the
infra_overrides
of my deployment are not being stored in Prefect Cloud when I
prefect deploy
. I have tried the YAML definition shown in the documentation + one I decided to experiment with
Copy code
infra_overrides:
    env.MY_VAR: value
Copy code
infra_overrides:
    env:
      MY_VAR: value
Neither end up in the Prefect Cloud UI. It isn't an issue of the value being hidden, my job fails with an indicator that the variable was never set. If I manually set the variable in the Deployment's UI like below, the job runs with the variable.
Copy code
{
  "env": {
    "MY_VAR": "value"
  }
}
If it helps,
prefect version
output is
Copy code
Version:             2.14.9
API version:         0.8.4
Python version:      3.11.0
Git commit:          4fba882c
Built:               Thu, Nov 30, 2023 2:55 PM
OS/Arch:             win32/AMD64
Profile:             tarro
Server type:         cloud
a
Hey @Dominic Tarro! When using a
prefect.yaml
file you can use
job_variables
under your
work_pool
section to customize the infrastructure your flow runs in. Here’s a link to the docs with more information: https://docs.prefect.io/latest/guides/prefect-deploy/#work-pool-fields. Let me know if you have any other questions!
d
Ah, that was the missing piece. Thank you!