From the searches in Prefect documentation, here's what I found:
1.
Prefect 2.x:
- The Prefect 2.x documentation indicates that job variables, including environment variables, can be overridden per deployment or per flow run. However, there is no explicit mention in the search results about directly sourcing these variables from a secret block. For more details, you can refer to the
overriding job variables guide.
2.
Prefect 3.x:
- Similar to 2.x, Prefect 3.x documentation mentions that work pools can utilize environment variables, but it doesn't explicitly state that these can be obtained from a secret block. However, Prefect supports secret management through blocks like
SecretStr
and
SecretDict
to securely handle sensitive information.
- For more details, you can check the
infrastructure concepts for work pools and
block documentation.
If you need to use secrets in your environment variables, you can manually fetch secrets in your flow code and then set them as environment variables programmatically.
For more precise guidance, you could explore Prefect's extensions or community examples that implement this pattern, as the official documentation might not cover direct integration of secret blocks into work pool environment variables.