Skip to content
Docs Try Aspire

IResourceWithEnvironment

Interface
📦 Aspire.Hosting v13.2.0
interface IResourceWithEnvironment {
withCertificateTrustScope(scope: CertificateTrustScope): IResourceWithEnvironment;
withDeveloperCertificateTrust(trust: boolean): IResourceWithEnvironment;
withEnvironment(
name: string,
value: IResourceWithConnectionString): IResourceWithEnvironment;
withEnvironmentCallback(callback: (arg: EnvironmentCallbackContext) => void): IResourceWithEnvironment;
withEnvironmentConnectionString(
envVarName: string,
resource: IResourceWithConnectionString): IResourceWithEnvironment;
withEnvironmentEndpoint(
name: string,
endpointReference: EndpointReference): IResourceWithEnvironment;
withEnvironmentParameter(
name: string,
parameter: ParameterResource): IResourceWithEnvironment;
withHttpsDeveloperCertificate(password?: ParameterResource): IResourceWithEnvironment;
withOtlpExporter(): IResourceWithEnvironment;
withOtlpExporterProtocol(protocol: OtlpProtocol): IResourceWithEnvironment;
withoutHttpsCertificate(): IResourceWithEnvironment;
withReference(
source: IResource,
connectionName?: string,
optional?: boolean,
name?: string): IResourceWithEnvironment;
withReferenceEndpoint(endpointReference: EndpointReference): IResourceWithEnvironment;
withReferenceExternalService(externalService: ExternalServiceResource): IResourceWithEnvironment;
withReferenceUri(
name: string,
uri: uri): IResourceWithEnvironment;
}

Methods

method withCertificateTrustScope builder
Sets the certificate trust scope
withCertificateTrustScope(scope: CertificateTrustScope): IResourceWithEnvironment
scope CertificateTrustScope
IResourceWithEnvironment
Configures developer certificate trust
withDeveloperCertificateTrust(trust: boolean): IResourceWithEnvironment
trust boolean
IResourceWithEnvironment
method withEnvironment builder
Sets an environment variable on the resource
withEnvironment(
name: string,
value: IResourceWithConnectionString): IResourceWithEnvironment
name string
value IResourceWithConnectionString
IResourceWithEnvironment
method withEnvironmentCallback builder
Sets environment variables via callback
withEnvironmentCallback(callback: (arg: EnvironmentCallbackContext) => void): IResourceWithEnvironment
callback (arg: EnvironmentCallbackContext) => void
IResourceWithEnvironment
Sets an environment variable from a connection string resource
withEnvironmentConnectionString(
envVarName: string,
resource: IResourceWithConnectionString): IResourceWithEnvironment
envVarName string
resource IResourceWithConnectionString
IResourceWithEnvironment
method withEnvironmentEndpoint builder
Sets an environment variable from an endpoint reference
withEnvironmentEndpoint(
name: string,
endpointReference: EndpointReference): IResourceWithEnvironment
name string
endpointReference EndpointReference
IResourceWithEnvironment
method withEnvironmentParameter builder
Sets an environment variable from a parameter resource
withEnvironmentParameter(
name: string,
parameter: ParameterResource): IResourceWithEnvironment
name string
parameter ParameterResource
IResourceWithEnvironment
Configures HTTPS with a developer certificate
withHttpsDeveloperCertificate(password?: ParameterResource): IResourceWithEnvironment
password ParameterResource optional
IResourceWithEnvironment
method withOtlpExporter builder
Configures OTLP telemetry export
withOtlpExporter(): IResourceWithEnvironment
IResourceWithEnvironment
method withOtlpExporterProtocol builder
Configures OTLP telemetry export with specific protocol
withOtlpExporterProtocol(protocol: OtlpProtocol): IResourceWithEnvironment
protocol OtlpProtocol
IResourceWithEnvironment
method withoutHttpsCertificate builder
Removes HTTPS certificate configuration
withoutHttpsCertificate(): IResourceWithEnvironment
IResourceWithEnvironment
method withReference builder
Adds a reference to another resource
withReference(
source: IResource,
connectionName?: string,
optional?: boolean,
name?: string): IResourceWithEnvironment
source IResource
connectionName string optional
optional boolean optional = False
name string optional
IResourceWithEnvironment
method withReferenceEndpoint builder
Adds a reference to an endpoint
withReferenceEndpoint(endpointReference: EndpointReference): IResourceWithEnvironment
endpointReference EndpointReference
IResourceWithEnvironment
Adds a reference to an external service
withReferenceExternalService(externalService: ExternalServiceResource): IResourceWithEnvironment
externalService ExternalServiceResource
IResourceWithEnvironment
method withReferenceUri builder
Adds a reference to a URI
withReferenceUri(
name: string,
uri: uri): IResourceWithEnvironment
name string
uri uri
IResourceWithEnvironment