Watch Aspire live streamsDocsTry Aspire

IResourceWithEnvironment.withEnvironment

Method
📦 Aspire.Hosting v13.6.0
interface IResourceWithEnvironment {
// ... omitted for brevity
withEnvironment(
name: string,
value: string | ReferenceExpression | EndpointReference | ParameterResource | ExternalServiceResource | IResourceWithConnectionString | IExpressionValue): IResourceWithEnvironment;
}

Signature

methodwithEnvironmentbuilder
Sets an environment variable
withEnvironment(
name: string,
value: string | ReferenceExpression | EndpointReference | ParameterResource | ExternalServiceResource | IResourceWithConnectionString | IExpressionValue): IResourceWithEnvironment
namestring
valuestring | ReferenceExpression | EndpointReference | ParameterResource | ExternalServiceResource | IResourceWithConnectionString | IExpressionValue
IResourceWithEnvironment

Defined on

This method is defined on the following type: