<@ULVA73B9P> In my deployments, I put secrets bloc...
# ask-marvin
s
@Marvin In my deployments, I put secrets blocks loading at the top-level scope, above flows and functions, above main. Is that a problem? It seems that when triggering the deployment, it works as intended.
m
Loading secrets at the top-level scope in your Prefect deployments is not inherently problematic, but there are some considerations to keep in mind: 1. Security: Ensure that the secrets are not exposed inadvertently in logs or error messages. Prefect resolves block references at runtime to avoid exposing sensitive information. 2. Deployment Mechanics: Prefect's deployment process resolves block references during the deployment steps, so having them at the top-level should work as expected as long as they are properly configured. The deployment process involves resolving all variable and block references with the deployment declaration. 3. Best Practices: It's generally advisable to load secrets as close to their point of use as possible to minimize their exposure and potential misuse. However, if your current setup works without issues and aligns with your security protocols, it should be fine. For more detailed information, you can refer to the Prefect documentation on secrets and deployment concepts. If you have specific concerns about your setup, feel free to ask.