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

Deferred evaluation

Definition

Resolving or computing a value only when the information needed to produce it is available.

Also known as
lazy evaluation, deferred resolution

Some resource values do not exist when the application model is first constructed. Ports, endpoints, generated credentials, or provisioned cloud outputs may become available later.

Value providers and structured expressions defer resolution until the appropriate stage. In run mode that may produce a concrete value; in publish mode the target may receive an expression to resolve during deployment.

Preserving a reference avoids hard-coding a development value into output intended for another environment.

Practical example

Resolve a service's allocated port after endpoint allocation rather than trying to read it while the AppHost is still declaring resources.