Nils
01/16/2025, 8:46 AMPREFECT_API_URL
in a prefect.toml
configuration file?Marvin
01/16/2025, 8:46 AMPREFECT_API_URL
in a prefect.toml
configuration file, you would include it under the appropriate section in your prefect.toml
. Here's an example:
toml
[server]
api_url = "<https://your-prefect-server-url.com>"
This configuration assumes you are setting the API URL for a self-hosted Prefect server. For more details on configuring settings and profiles in Prefect, you can refer to the official documentation.Nils
01/16/2025, 8:46 AMpyproject.toml
file?Marvin
01/16/2025, 8:47 AMpyproject.toml
file, you can set the PREFECT_API_URL
similarly under the appropriate section. Here's how it might look:
toml
[tool.prefect.server]
api_url = "<https://your-prefect-server-url.com>"
This setup is consistent with how you configure settings for a self-hosted Prefect server. The pyproject.toml
file allows you to centralize your project's configuration, including Prefect settings. For further guidance, you can consult the Prefect documentation on settings and profiles.Nils
01/16/2025, 8:49 AMMarvin
01/16/2025, 8:49 AM[tool.prefect]
section.
5. Profiles: Useful for switching between different environments.
To ensure that the URL in the pyproject.toml
is used, you must not set the PREFECT_API_URL
as an environment variable or in a .env
file, and ensure that no prefect.toml
file is present with the same setting. This way, the setting in pyproject.toml
will take precedence over the profile settings.
For more details, you can check the Prefect documentation on settings and profiles.Nils
01/16/2025, 8:52 AMMarvin
01/16/2025, 8:52 AMapi.url
setting when included in a local pyproject.toml
file. This has been documented in a GitHub issue here. The error you're encountering suggests that Prefect is not reading the configuration from pyproject.toml
as expected.
As a workaround, you can set the PREFECT_API_URL
using an environment variable or by using the command prefect config set PREFECT_API_URL="your-api-url"
. This should help you bypass the current issue until it is resolved in a future release.