The Prefect server Helm chart currently hardcodes the deprecated environment variable PREFECT_API_DATABASE_CONNECTION_URL in the deployment template. According to the Prefect v3 settings reference, the preferred environment variable is now PREFECT_SERVER_DATABASE_CONNECTION_URL, with PREFECT_API_DATABASE_CONNECTION_URL maintained as a backward-compatible alias.
Current Behavior:
In charts/prefect-server/templates/deployment.yaml (lines ~115-125), the deployment template hardcodes:
- name: PREFECT_API_DATABASE_CONNECTION_URL
{{- if .Values.sqlite.enabled }}
value: "sqlite+aiosqlite:////data/prefect.db"
{{- else }}
valueFrom:
secretKeyRef:
name: {{ include "server.postgres-string-secret-name" . }}
key: connection-string
{{- end }}
Expected Behavior:
The deployment template should use the new, preferred environment variable name:
- name: PREFECT_SERVER_DATABASE_CONNECTION_URL
{{- if .Values.sqlite.enabled }}
value: "sqlite+aiosqlite:////data/prefect.db"
{{- else }}
valueFrom:
secretKeyRef:
name: {{ include "server.postgres-string-secret-name" . }}
key: connection-string
{{- end }}
Why This Matters:
Future-proofing: The PREFECT_API_* naming convention is deprecated and may be removed in future Prefect versions
Consistency: All Prefect documentation now references PREFECT_SERVER_* variables as the primary naming convention
Best practices: Using the current, non-deprecated variable names aligns with Prefect's recommended configuration
Backward Compatibility:
Since Prefect currently supports both variable names as aliases, this change is backward compatible and won't break existing deployments. Users who have overridden this via server.env will continue to work as expected.
Affected Files:
charts/prefect-server/templates/deployment.yaml
Potentially charts/prefect-server/templates/background-services-deployment.yaml if it exists
Additional Context:
Chart version: 2026.2.5193506 (and likely all current versions)
Prefect documentation: https://docs.prefect.io/v3/api-ref/settings-ref (see ServerDatabaseSettings.connection_url)
The same pattern applies to other database-related env vars (PREFECT_SERVER_DATABASE_* vs PREFECT_API_DATABASE_*)
Proposed Solution:
A simple find-and-replace in the deployment templates:
PREFECT_API_DATABASE_CONNECTION_URL → PREFECT_SERVER_DATABASE_CONNECTION_URL
PREFECT_API_DATABASE_* → PREFECT_SERVER_DATABASE_* (for any other database-related variables)
The Prefect server Helm chart currently hardcodes the deprecated environment variable PREFECT_API_DATABASE_CONNECTION_URL in the deployment template. According to the Prefect v3 settings reference, the preferred environment variable is now PREFECT_SERVER_DATABASE_CONNECTION_URL, with PREFECT_API_DATABASE_CONNECTION_URL maintained as a backward-compatible alias.
Current Behavior:
In charts/prefect-server/templates/deployment.yaml (lines ~115-125), the deployment template hardcodes:
Expected Behavior:
The deployment template should use the new, preferred environment variable name:
Why This Matters:
Future-proofing: The PREFECT_API_* naming convention is deprecated and may be removed in future Prefect versions
Consistency: All Prefect documentation now references PREFECT_SERVER_* variables as the primary naming convention
Best practices: Using the current, non-deprecated variable names aligns with Prefect's recommended configuration
Backward Compatibility:
Since Prefect currently supports both variable names as aliases, this change is backward compatible and won't break existing deployments. Users who have overridden this via server.env will continue to work as expected.
Affected Files:
charts/prefect-server/templates/deployment.yaml
Potentially charts/prefect-server/templates/background-services-deployment.yaml if it exists
Additional Context:
Chart version: 2026.2.5193506 (and likely all current versions)
Prefect documentation: https://docs.prefect.io/v3/api-ref/settings-ref (see ServerDatabaseSettings.connection_url)
The same pattern applies to other database-related env vars (PREFECT_SERVER_DATABASE_* vs PREFECT_API_DATABASE_*)
Proposed Solution:
A simple find-and-replace in the deployment templates:
PREFECT_API_DATABASE_CONNECTION_URL → PREFECT_SERVER_DATABASE_CONNECTION_URL
PREFECT_API_DATABASE_* → PREFECT_SERVER_DATABASE_* (for any other database-related variables)