Watch Aspire live streamsDocsTry Aspire
Watch Aspire live streamsDocsTry

withEnvironment

Method
📦 Aspire.Hosting v13.6.0
interface ContainerResource {
// ... 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

Applies to

This method applies to the following types: