Skip to content
Docs Try Aspire
Docs Try

withEnvironment

Method
📦 Aspire.Hosting v13.2.0
interface ContainerResource {
// ... omitted for brevity
withEnvironment(
name: string,
value: IResourceWithConnectionString): IResourceWithEnvironment;
}

Signature

method withEnvironment builder
Sets an environment variable on the resource
withEnvironment(
name: string,
value: IResourceWithConnectionString): IResourceWithEnvironment
name string
value IResourceWithConnectionString
IResourceWithEnvironment

Applies to

This method applies to the following types: