Philip Street
12/12/2025, 5:54 PMMarvin
12/12/2025, 5:54 PMNate
12/12/2025, 5:55 PMPREFECT_API_URL=.... PREFECT_AUTH_STRING=... prefect worker start
Nate
12/12/2025, 5:55 PM~/.prefect/profiles.toml on the worker machine
and prefect --profile my-worker-profile worker start ...Marvin
12/12/2025, 5:59 PMPREFECT_API_URL pointing to your Server’s API, e.g. http://<host>:4200/api. No API key is required or used by OSS Server.
- With auth enabled: If you set PREFECT_SERVER_API_AUTH_STRING="user:pass" on the Server, then workers must send the same credentials via PREFECT_API_AUTH_STRING="user:pass". The client will use HTTP Basic auth automatically.
Typical env for a worker container (e.g., in Azure Container Instances):
# No auth (default server)
PREFECT_API_URL=<http://your-server:4200/api>
# If you enable server auth
PREFECT_API_URL=<http://your-server:4200/api>
PREFECT_API_AUTH_STRING=user:pass
Start the worker:
prefect worker start -p your-work-pool
Notes
- Do not use PREFECT_API_KEY with self-hosted Server; that’s for Prefect Cloud.
- When a worker submits flow runs, it propagates its Prefect settings (including PREFECT_API_URL and auth) into the flow-run environment, so your flows can talk back to the same Server.
- If your Server is exposed publicly, consider putting it behind TLS and enabling basic auth.
Docs and references
- Security settings (basic auth for self-hosted): Security settings
- Settings reference (env vars): Settings reference
- Workers overview: Workers
- Self-hosted server CLI: Self-hosted server CLI
If you plan to enable basic auth on your ACI-hosted Server, I can share a concrete az container create example with the right environment variables for both the Server and the Worker—would that help?