Aspirerelease/13.6
Watch Aspire live streamsDocsTry Aspire
Watch Aspire live streamsDocsTry

WaitFor

Definition

Term type
API method

Delays a resource's startup until a dependency is running and its configured health checks pass.

Also known as
waitFor, readiness dependency

WaitFor in C# and waitFor in TypeScript express a startup dependency. For a running resource with health checks, Aspire waits for those checks to report healthy. Without health checks, reaching the running state is sufficient.

Use a reference as well when the consuming resource needs connection information. Waiting alone does not supply a connection string or endpoint.

Readiness is only as meaningful as the checks you configure. Startup coordination does not replace retry policies or recovery from failures after startup.

Practical example

Wait for PostgreSQL before starting an API so its initial database connection is not attempted before the configured readiness checks succeed.