Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithEnvironmentCallback

Method
📦 Aspire.Hosting v17.0.0
func (ResourceWithEnvironment) WithEnvironmentCallback(callback func(arg EnvironmentCallbackContext)) ResourceWithEnvironment

Signature

methodWithEnvironmentCallbackbuilder
Allows for the population of environment variables on a resource.
WithEnvironmentCallback(callback func(arg EnvironmentCallbackContext)) ResourceWithEnvironment
callbackfunc(arg EnvironmentCallbackContext)callbackA callback that allows for deferred execution for computing many environment variables. This runs after resources have been allocated by the orchestrator and allows access to other resources to resolve computed data, e.g. connection strings, ports.
ResourceWithEnvironment

The resource builder.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types: