Skip to content
DocsTry Aspire
DocsTry

Aspire.Hosting

Official
📦 Aspire.Hostingv13.4.0
206Functions
119Types

Types

typeAddContainerOptions2 fields
handleAfterPublishEvent2 members
handleAfterResourcesCreatedEvent2 members
handleBeforePublishEvent2 members
handleBeforeResourceStartedEvent2 members
handleBeforeStartEvent2 members
typeCertificateTrustExecutionConfigurationContext4 fields
typeCertificateTrustExecutionConfigurationExportData3 fields
handleCommandLineArgsCallbackContext4 members
handleCommandLineArgsEditor1 members
typeCommandOptions10 fields
typeCommandResultData3 fields
handleConnectionStringAvailableEvent2 members
handleContainerImagePushOptions4 members
handleContainerImagePushOptionsCallbackContext3 members
handleContainerImageReference2 members
handleContainerMountAnnotation4 members
handleContainerPortReference2 members
handleContainerRegistryResource
handleContainerResource20 members
typeCreateBuilderOptions8 fields
handleCSharpAppResource
handleDistributedApplication1 members
handleDistributedApplicationEventSubscription
handleDistributedApplicationExecutionContext6 members
handleDistributedApplicationExecutionContextOptions
handleDistributedApplicationModel2 members
handleDistributedApplicationResourceEventSubscription
handleDockerfileBuilder3 members
handleDockerfileBuilderCallbackContext4 members
handleDockerfileFactoryContext1 members
handleDockerfileStage14 members
handleDotnetToolResource6 members
handleEndpointReference18 members
handleEndpointReferenceExpression3 members
handleEndpointUpdateContext21 members
handleEnvironmentCallbackContext4 members
handleEnvironmentEditor1 members
handleEventingSubscriberRegistrationContext6 members
handleExecutableResource3 members
handleExecuteCommandContext4 members
typeExecuteCommandResult5 fields
handleExternalServiceResource1 members
typeGenerateParameterDefault9 fields
typeHttpCommandExportOptions9 fields
typeHttpsCertificateExecutionConfigurationContext3 fields
typeHttpsCertificateExecutionConfigurationExportData7 fields
typeHttpsCertificateInfo3 fields
interfaceIAspireStore2 members
interfaceIComputeEnvironmentResource
interfaceIDistributedApplicationBuilder28 members
interfaceIDistributedApplicationEvent
interfaceIDistributedApplicationEventing1 members
interfaceIDistributedApplicationPipeline3 members
interfaceIDistributedApplicationResourceEvent
interfaceIExecutionConfigurationBuilder5 members
interfaceIExecutionConfigurationResult2 members
interfaceIExpressionValue
handleInitializeResourceEvent5 members
handleInputsDialogValidationContext3 members
typeInteractionInput13 fields
handleInteractionInputCollection1 members
interfaceIReportingStep6 members
interfaceIReportingTask4 members
interfaceIResource31 members
interfaceIResourceWithArgs2 members
interfaceIResourceWithConnectionString3 members
interfaceIResourceWithContainerFiles2 members
interfaceIResourceWithEndpoints15 members
interfaceIResourceWithEnvironment9 members
interfaceIResourceWithParent
interfaceIResourceWithWaitSupport3 members
interfaceIUserSecretsManager6 members
handleLogFacade4 members
typeParameterCustomInputOptions10 fields
handleParameterResource2 members
handlePipelineConfigurationContext3 members
handlePipelineContext7 members
handlePipelineEditor2 members
handlePipelineStep8 members
handlePipelineStepContext8 members
handlePipelineStepFactoryContext2 members
handlePipelineSummary2 members
typeProcessCommandExportOptions11 fields
typeProcessCommandResultExportOptions4 fields
typeProcessCommandSpecExportData7 fields
handleProjectResource3 members
handleProjectResourceOptions6 members
typeReferenceEnvironmentInjectionOptions4 fields
handleReferenceExpression1 members
handleReferenceExpressionBuilder5 members
handleResourceCommandService1 members
handleResourceEndpointsAllocatedEvent2 members
typeResourceEventDto6 fields
handleResourceLoggerService2 members
handleResourceNotificationService6 members
handleResourceReadyEvent2 members
handleResourceStoppedEvent2 members
typeResourceUrlAnnotation4 fields
handleResourceUrlsCallbackContext5 members
handleResourceUrlsEditor3 members
handleUpdateCommandStateContext1 members
typeUpdateCommandStateResourceSnapshot5 fields

Functions

methodaddConnectionStringbuilder
Adds a connection string resource
addConnectionString(name: string, environmentVariableNameOrExpression?: ReferenceExpression): IResourceWithConnectionString
methodaddContainerbuilder
Adds a container resource to the application.
addContainer(name: string, image: AddContainerOptions): ContainerResource
methodaddContainerFiles
Adds COPY --from statements for published container files
addContainerFiles(resource: IResource, rootDestinationPath: string, logger?: ILogger): DockerfileStage
methodaddContainerFilesStages
Adds Dockerfile stages for published container files
addContainerFilesStages(resource: IResource, logger?: ILogger): DockerfileBuilder
methodaddContainerRegistrybuilder
Adds a container registry resource
addContainerRegistry(name: string, endpoint: ParameterResource, repository?: ParameterResource): ContainerRegistryResource
methodaddCSharpAppbuilder
Adds a C# application resource
addCSharpApp(name: string, path: string, options?: ProjectResourceOptions): CSharpAppResource
methodaddDockerfilebuilder
Adds a Dockerfile to the application model that can be treated like a container resource.
addDockerfile(name: string, contextPath: string, dockerfilePath?: string, stage?: string): ContainerResource
methodaddDockerfileBuilderbuilder
Adds a container resource built from a programmatically generated Dockerfile
addDockerfileBuilder(name: string, contextPath: string, callback: (arg: DockerfileBuilderCallbackContext) => Promise<void>, stage?: string): ContainerResource
methodaddDockerfileFactorybuilder
Adds a Dockerfile to the application model that can be treated like a container resource, with the Dockerfile content generated by an asynchronous factory function.
addDockerfileFactory(name: string, contextPath: string, dockerfileFactory: (arg: DockerfileFactoryContext) => Promise<string>, stage?: string): ContainerResource
methodaddDotnetToolbuilder
Adds a .NET tool resource to the application model.
addDotnetTool(name: string, packageId: string): DotnetToolResource
methodaddEventingSubscriber
Adds an ATS-friendly eventing subscriber callback to the distributed-application builder.
addEventingSubscriber(subscribe: (arg: EventingSubscriberRegistrationContext) => Promise<void>): void
methodaddExecutablebuilder
Adds an executable resource to the application model.
addExecutable(name: string, command: string, workingDirectory: string, args: string[]): ExecutableResource
methodaddExternalServicebuilder
Adds an external service resource
addExternalService(name: string, url: ParameterResource): ExternalServiceResource
methodaddMarkdown
Adds a key-value pair to the pipeline summary with a Markdown-formatted value.
addMarkdown(key: string, markdownString: string): void
methodaddParameterbuilder
Adds a parameter resource
addParameter(name: string, value?: string, publishValueAsDefault?: boolean, secret?: boolean): ParameterResource
methodaddParameterFromConfigurationbuilder
Adds a parameter resource to the application, with a value coming from configuration.
addParameterFromConfiguration(name: string, configurationKey: string, secret?: boolean): ParameterResource
methodaddParameterWithGeneratedValuebuilder
Adds a parameter with a generated default value
addParameterWithGeneratedValue(name: string, value: GenerateParameterDefault, secret?: boolean, persist?: boolean): ParameterResource
methodaddProjectbuilder
Adds a .NET project resource
addProject(name: string, projectPath: string, launchProfileOrOptions?: ProjectResourceOptions): ProjectResource
methodaddStep
Adds an application-level pipeline step in a TypeScript-friendly shape.
addStep(stepName: string, callback: (arg: PipelineStepContext) => Promise<void>, dependsOn?: string[], requiredBy?: string[]): void
methodarg
Adds a global ARG statement to the Dockerfile
arg(name: string, defaultValue?: string): DockerfileBuilder
methodarg
Adds an ARG statement to a Dockerfile stage
arg(name: string, defaultValue?: string): DockerfileStage
methodasHttp2Servicebuilder
Configures a resource to mark all endpoints' transport as HTTP/2. This is useful for HTTP/2 services that need prior knowledge.
asHttp2Service(): IResourceWithEndpoints
methodbuild
Builds the execution configuration for the specified builder.
build(executionContext: DistributedApplicationExecutionContext, resourceLogger?: ILogger, cancellationToken?: cancellationToken): IExecutionConfigurationResult
methodclearContainerFilesSourcesbuilder
Removes any container files source annotation from the resource being built.
clearContainerFilesSources(): IResourceWithContainerFiles
methodcmd
Adds a CMD statement to a Dockerfile stage
cmd(command: string[]): DockerfileStage
methodcomment
Adds a comment to a Dockerfile stage
comment(comment: string): DockerfileStage
methodcompleteLog
Completes the log stream for a resource.
completeLog(resource: IResource): void
methodcompleteLogByName
Completes the log stream by resource name.
completeLogByName(resourceName: string): void
methodcompleteStep
Completes the reporting step with plain-text completion text.
completeStep(completionText: string, completionState?: string, cancellationToken?: cancellationToken): void
methodcompleteStepMarkdown
Completes the reporting step with Markdown-formatted completion text.
completeStepMarkdown(markdownString: string, completionState?: string, cancellationToken?: cancellationToken): void
methodcompleteTask
Completes the reporting task with plain-text completion text.
completeTask(completionMessage?: string, completionState?: string, cancellationToken?: cancellationToken): void
methodcompleteTaskMarkdown
Completes the reporting task with Markdown-formatted completion text.
completeTaskMarkdown(markdownString: string, completionState?: string, cancellationToken?: cancellationToken): void
methodconfigure
Registers a pipeline configuration callback in a TypeScript-friendly shape.
configure(callback: (arg: PipelineConfigurationContext) => Promise<void>): void
methodcopy
Adds a COPY statement to a Dockerfile stage
copy(source: string, destination: string, chown?: string): DockerfileStage
methodcopyFrom
Adds a COPY --from statement to a Dockerfile stage
copyFrom(from: string, source: string, destination: string, chown?: string): DockerfileStage
methodcreateBuilder
Creates a new distributed application builder
createBuilder(): IDistributedApplicationBuilder
methodcreateExecutionConfiguration
Creates an execution configuration builder for the specified resource.
createExecutionConfiguration(): IExecutionConfigurationBuilder
methodcreateLogger
Creates a logger for the specified category name.
createLogger(categoryName: string): ILogger
methodcreateMarkdownTask
Creates a reporting task with Markdown-formatted status text.
createMarkdownTask(markdownString: string, cancellationToken?: cancellationToken): IReportingTask
methodcreateTask
Creates a reporting task with plain-text status text.
createTask(statusText: string, cancellationToken?: cancellationToken): IReportingTask
methoddisableBuildOnlyContainerValidation
Disables the publish and deploy validation that requires build-only containers to be consumed by another resource.
disableBuildOnlyContainerValidation(): IDistributedApplicationPipeline
methoddisableForwardedHeadersbuilder
Configures the project to disable forwarded headers when being published.
disableForwardedHeaders(): ProjectResource
methodemptyLine
Adds an empty line to a Dockerfile stage
emptyLine(): DockerfileStage
methodentrypoint
Adds an ENTRYPOINT statement to a Dockerfile stage
entrypoint(command: string[]): DockerfileStage
methodenv
Adds an ENV statement to a Dockerfile stage
env(name: string, value: string): DockerfileStage
methodexcludeFromManifestbuilder
Excludes a resource from being published to the manifest.
excludeFromManifest(): IResource
methodexcludeFromMcpbuilder
Exclude the resource from MCP operations using the Aspire MCP server. The resource is excluded from results that return resources, console logs and telemetry.
excludeFromMcp(): IResource
methodexecuteCommandAsync
Executes a command for the specified resource.
executeCommandAsync(resource: IResource, commandName: string, arguments?: Dict<string,string>, cancellationToken?: cancellationToken): ExecuteCommandResult
methodexists
Checks whether a configuration section exists.
exists(key: string): boolean
methodexpose
Adds an EXPOSE statement to a Dockerfile stage
expose(port: number): DockerfileStage
methodfindResourceByName
Finds a resource by name.
findResourceByName(name: string): IResource
methodfrom
Adds a FROM statement to start a Dockerfile stage
from(image: string, stageName?: string): DockerfileStage
methodgetAspireStore
Gets the Aspire store from the service provider.
getAspireStore(): IAspireStore
methodgetCertificateTrustData
Gets certificate trust execution-configuration data when present.
getCertificateTrustData(): CertificateTrustExecutionConfigurationExportData
methodgetChildren
Gets the child sections of a configuration handle.
getChildren(): IConfigurationSection[]
methodgetConfiguration
Gets the application configuration.
getConfiguration(): IConfiguration
methodgetConfigValue
Gets a configuration value by key.
getConfigValue(key: string): string
methodgetConnectionProperty
Retrieves the value of a specified connection property from the resource's connection properties.
getConnectionProperty(key: string): ReferenceExpression
methodgetConnectionString
Gets a connection string by name.
getConnectionString(name: string): string
methodgetDistributedApplicationModel
Gets the distributed application model from the service provider.
getDistributedApplicationModel(): DistributedApplicationModel
methodgetEndpoint
Gets an endpoint reference
getEndpoint(name: string): EndpointReference
methodgetEventing
Gets the distributed application eventing service from the service provider.
getEventing(): IDistributedApplicationEventing
methodgetFileNameWithContent
Gets a deterministic file path that is a copy of the `sourceFilename`. The resulting file name will depend on the content of the file.
getFileNameWithContent(filenameTemplate: string, sourceFilename: string): string
methodgetHttpsCertificateData
Gets HTTPS certificate execution-configuration data when present.
getHttpsCertificateData(): HttpsCertificateExecutionConfigurationExportData
methodgetLoggerFactory
Gets the logger factory from the service provider.
getLoggerFactory(): ILoggerFactory
methodgetOrSetSecret
Gets a secret value if it exists in configuration, or sets it to the provided value if it does not.
getOrSetSecret(resourceBuilder: IResource, name: string, value: string): void
methodgetResourceCommandService
Gets the resource command service from the service provider.
getResourceCommandService(): ResourceCommandService
methodgetResourceLoggerService
Gets the resource logger service from the service provider.
getResourceLoggerService(): ResourceLoggerService
methodgetResourceName
Gets the name of the resource from a builder.
getResourceName(): string
methodgetResourceNotificationService
Gets the resource notification service from the service provider.
getResourceNotificationService(): ResourceNotificationService
methodgetResources
Gets all resources in the distributed application model.
getResources(): IResource[]
methodgetSection
Gets a configuration section by key.
getSection(key: string): IConfigurationSection
methodgetUserSecretsManager
Gets the user secrets manager from the service provider.
getUserSecretsManager(): IUserSecretsManager
methodisDevelopment
Checks if the environment is Development.
isDevelopment(): boolean
methodisEnvironment
Checks if the environment matches the specified name.
isEnvironment(environmentName: string): boolean
methodisProduction
Checks if the environment is Production.
isProduction(): boolean
methodisStaging
Checks if the environment is Staging.
isStaging(): boolean
methodlog
Logs a message with a specified log level.
log(level: string, message: string): void
methodlogDebug
Logs a debug message.
logDebug(message: string): void
methodlogError
Logs an error message.
logError(message: string): void
methodlogInformation
Logs an information message.
logInformation(message: string): void
methodlogStep
Logs a plain-text message for the reporting step.
logStep(level: string, message: string): void
methodlogStepMarkdown
Logs a Markdown-formatted message for the reporting step.
logStepMarkdown(level: string, markdownString: string): void
methodlogWarning
Logs a warning message.
logWarning(message: string): void
methodonAfterPublish
Subscribes to the AfterPublish event from an eventing subscriber registration context.
onAfterPublish(callback: (arg: AfterPublishEvent) => Promise<void>): DistributedApplicationEventSubscription
methodonAfterResourcesCreated
Subscribes to the AfterResourcesCreated event from an eventing subscriber registration context.
onAfterResourcesCreated(callback: (arg: AfterResourcesCreatedEvent) => Promise<void>): DistributedApplicationEventSubscription
methodonBeforePublish
Subscribes to the BeforePublish event from an eventing subscriber registration context.
onBeforePublish(callback: (arg: BeforePublishEvent) => Promise<void>): DistributedApplicationEventSubscription
methodonBeforeResourceStartedbuilder
Subscribes to the BeforeResourceStarted event.
onBeforeResourceStarted(callback: (arg: BeforeResourceStartedEvent) => Promise<void>): IResource
methodonBeforeStart
Subscribes to the BeforeStart event from an eventing subscriber registration context.
onBeforeStart(callback: (arg: BeforeStartEvent) => Promise<void>): DistributedApplicationEventSubscription
methodonConnectionStringAvailablebuilder
Subscribes to the ConnectionStringAvailable event.
onConnectionStringAvailable(callback: (arg: ConnectionStringAvailableEvent) => Promise<void>): IResourceWithConnectionString
methodonInitializeResourcebuilder
Subscribes to the InitializeResource event.
onInitializeResource(callback: (arg: InitializeResourceEvent) => Promise<void>): IResource
methodonResourceEndpointsAllocatedbuilder
Subscribes to the ResourceEndpointsAllocated event.
onResourceEndpointsAllocated(callback: (arg: ResourceEndpointsAllocatedEvent) => Promise<void>): IResourceWithEndpoints
methodonResourceReadybuilder
Subscribes to the ResourceReady event.
onResourceReady(callback: (arg: ResourceReadyEvent) => Promise<void>): IResource
methodonResourceStoppedbuilder
Subscribes to the ResourceStopped event.
onResourceStopped(callback: (arg: ResourceStoppedEvent) => Promise<void>): IResource
methodpublishAsConnectionStringbuilder
Changes the resource to be published as a connection string reference in the manifest.
publishAsConnectionString(): ContainerResource
methodpublishAsContainerbuilder
Changes the resource to be published as a container in the manifest.
publishAsContainer(): ContainerResource
methodpublishAsDockerFilebuilder
Publishes an executable as a Docker file
publishAsDockerFile(configure: (obj: ContainerResource) => Promise<void>): ExecutableResource
methodpublishAsDockerFilebuilder
Publishes a project as a Docker file with optional container configuration
publishAsDockerFile(configure?: (obj: ContainerResource) => Promise<void>): ProjectResource
methodpublishResourceUpdate
Publishes an update for a resource's state.
publishResourceUpdate(resource: IResource, state?: string, stateStyle?: string): void
methodpublishWithContainerFilesbuilder
Configures the resource to copy container files from the specified source resource during publishing.
publishWithContainerFiles(source: IResourceWithContainerFiles, destinationPath: string): IContainerFilesDestinationResource
methodrun
Adds a RUN statement to a Dockerfile stage
run(command: string): DockerfileStage
methodrunWithMounts
Adds a RUN statement with mounts to a Dockerfile stage
runWithMounts(command: string, mounts: string[]): DockerfileStage
methodsaveStateJson
Saves state to user secrets from a JSON string.
saveStateJson(json: string, cancellationToken?: cancellationToken): void
methodsubscribeAfterPublish
Subscribes to the AfterPublish event, which fires after the application is published.
subscribeAfterPublish(callback: (arg: AfterPublishEvent) => Promise<void>): DistributedApplicationEventSubscription
methodsubscribeAfterResourcesCreated
Subscribes to the AfterResourcesCreated event, which fires after all resources are created.
subscribeAfterResourcesCreated(callback: (arg: AfterResourcesCreatedEvent) => Promise<void>): DistributedApplicationEventSubscription
methodsubscribeBeforePublish
Subscribes to the BeforePublish event, which fires before the application is published.
subscribeBeforePublish(callback: (arg: BeforePublishEvent) => Promise<void>): DistributedApplicationEventSubscription
methodsubscribeBeforeStart
Subscribes to the BeforeStart event, which fires before the application starts.
subscribeBeforeStart(callback: (arg: BeforeStartEvent) => Promise<void>): DistributedApplicationEventSubscription
methodtryAddEventingSubscriber
Attempts to add an ATS-friendly eventing subscriber callback to the distributed-application builder.
tryAddEventingSubscriber(subscribe: (arg: EventingSubscriberRegistrationContext) => Promise<void>): void
methodtryGetResourceState
Tries to get the current state of a resource.
tryGetResourceState(resourceName: string): ResourceEventDto
methodupdateTask
Updates the reporting task with plain-text status text.
updateTask(statusText: string, cancellationToken?: cancellationToken): void
methodupdateTaskMarkdown
Updates the reporting task with Markdown-formatted status text.
updateTaskMarkdown(markdownString: string, cancellationToken?: cancellationToken): void
methoduser
Adds a USER statement to a Dockerfile stage
user(user: string): DockerfileStage
methodwaitForbuilder
Waits for another resource to be ready
waitFor(dependency: IResource, waitBehavior?: WaitBehavior): IResourceWithWaitSupport
methodwaitForCompletionbuilder
Waits for the dependency resource to enter the Exited or Finished state before starting the resource.
waitForCompletion(dependency: IResource, exitCode?: number): IResourceWithWaitSupport
methodwaitForDependencies
Waits for all dependencies of a resource to be ready.
waitForDependencies(resource: IResource): void
methodwaitForResourceHealthy
Waits for a resource to become healthy.
waitForResourceHealthy(resourceName: string): ResourceEventDto
methodwaitForResourceState
Waits for a resource to reach a specified state.
waitForResourceState(resourceName: string, targetState?: string): void
methodwaitForResourceStates
Waits for a resource to reach one of the specified states.
waitForResourceStates(resourceName: string, targetStates: string[]): string
methodwaitForStartbuilder
Waits for another resource to start
waitForStart(dependency: IResource, waitBehavior?: WaitBehavior): IResourceWithWaitSupport
methodwithArgsbuilder
Adds arguments to be passed to a resource that supports arguments when it is launched.
withArgs(args: string[]): IResourceWithArgs
methodwithArgsCallbackbuilder
Adds a callback to be executed with a list of command-line arguments when a resource is started.
withArgsCallback(callback: (obj: CommandLineArgsCallbackContext) => Promise<void>): IResourceWithArgs
methodwithArgumentsConfig
Adds a command line arguments configuration gatherer to the builder.
withArgumentsConfig(): IExecutionConfigurationBuilder
methodwithBindMountbuilder
Adds a bind mount to a container resource.
withBindMount(source: string, target: string, isReadOnly?: boolean): ContainerResource
methodwithBuildArgbuilder
Adds a build argument when the container is built from a Dockerfile.
withBuildArg(name: string, value: ParameterResource): ContainerResource
methodwithBuildSecretbuilder
Adds a secret build argument when the container is built from a Dockerfile.
withBuildSecret(name: string, value: ParameterResource): ContainerResource
methodwithCertificateTrustConfig
Adds a certificate trust configuration gatherer to the builder.
withCertificateTrustConfig(configContextFactory: (arg: CertificateTrustScope) => Promise<CertificateTrustExecutionConfigurationContext>): IExecutionConfigurationBuilder
methodwithCertificateTrustScopebuilder
Sets the certificate trust scope
withCertificateTrustScope(scope: CertificateTrustScope): IResourceWithEnvironment
methodwithChildRelationshipbuilder
Sets a child relationship
withChildRelationship(child: IResource): IResource
methodwithCommandbuilder
Adds a resource command
withCommand(name: string, displayName: string, executeCommand: (arg: ExecuteCommandContext) => Promise<ExecuteCommandResult>, commandOptions?: CommandOptions): IResource
methodwithComputeEnvironmentbuilder
Configures the compute environment for the compute resource.
withComputeEnvironment(computeEnvironmentResource: IComputeEnvironmentResource): IComputeResource
methodwithConnectionPropertybuilder
Adds a connection property annotation to the resource being built.
withConnectionProperty(name: string, value: ReferenceExpression): IResourceWithConnectionString
methodwithContainerCertificatePathsbuilder
Adds container certificate path overrides used for certificate trust at run time.
withContainerCertificatePaths(customCertificatesDestination?: string, defaultCertificateBundlePaths?: string[], defaultCertificateDirectoryPaths?: string[]): ContainerResource
methodwithContainerFilesSourcebuilder
Adds a container files source annotation to the resource being built, specifying the path to the container files source.
withContainerFilesSource(sourcePath: string): IResourceWithContainerFiles
methodwithContainerNamebuilder
Overrides the default container name for this resource. By default Aspire generates a unique container name based on the resource name and a random postfix (or a postfix based on a hash of the AppHost project path for persistent container resources). This method allows you to override that behavior with a custom name, but could lead to naming conflicts if the specified name is not unique.
withContainerName(name: string): ContainerResource
methodwithContainerNetworkAliasbuilder
Adds a network alias to container resource.
withContainerNetworkAlias(alias: string): ContainerResource
methodwithContainerRegistrybuilder
Configures the resource to use the specified container registry for container image operations.
withContainerRegistry(registry: IResource): IResource
methodwithContainerRuntimeArgsbuilder
Adds a callback to be executed with a list of arguments to add to the container runtime run command when a container resource is started.
withContainerRuntimeArgs(args: string[]): ContainerResource
methodwithCustomInputbuilder
Sets a custom input for the parameter resource from a polyglot app host.
withCustomInput(options: ParameterCustomInputOptions): ParameterResource
methodwithDescriptionbuilder
Sets the description of the parameter resource.
withDescription(description: string, enableMarkdown?: boolean): ParameterResource
methodwithDeveloperCertificateTrustbuilder
Indicates whether developer certificates should be treated as trusted certificate authorities for the resource at run time. Currently this indicates trust for the ASP.NET Core developer certificate. The developer certificate will only be trusted when running in local development scenarios; in publish mode resources will use their default certificate trust.
withDeveloperCertificateTrust(trust: boolean): IResourceWithEnvironment
methodwithDockerfilebuilder
Causes Aspire to build the specified container image from a Dockerfile.
withDockerfile(contextPath: string, dockerfilePath?: string, stage?: string): ContainerResource
methodwithDockerfileBaseImagebuilder
Configures custom base images for generated Dockerfiles.
withDockerfileBaseImage(buildImage?: string, runtimeImage?: string): IResource
methodwithDockerfileBuilderbuilder
Configures the resource to use a programmatically generated Dockerfile
withDockerfileBuilder(contextPath: string, callback: (arg: DockerfileBuilderCallbackContext) => Promise<void>, stage?: string): ContainerResource
methodwithDockerfileFactorybuilder
Builds the specified container image from a Dockerfile generated by an asynchronous factory function.
withDockerfileFactory(contextPath: string, dockerfileFactory: (arg: DockerfileFactoryContext) => Promise<string>, stage?: string): ContainerResource
methodwithEndpointbuilder
Adds a network endpoint
withEndpoint(port?: number, targetPort?: number, scheme?: string, name?: string, env?: string, isProxied?: boolean, isExternal?: boolean, protocol?: ProtocolType): IResourceWithEndpoints
methodwithEndpointCallbackbuilder
Updates a named endpoint via callback
withEndpointCallback(endpointName: string, callback: (obj: EndpointUpdateContext) => Promise<void>, createIfNotExists?: boolean): IResourceWithEndpoints
methodwithEndpointProxySupportbuilder
Set whether a resource can use proxied endpoints or whether they should be disabled for all endpoints belonging to the resource. If set to `false`, endpoints belonging to the resource will ignore the configured proxy settings and run proxy-less.
withEndpointProxySupport(proxyEnabled: boolean): IResourceWithEndpoints
methodwithEntrypointbuilder
Sets the Entrypoint for the container.
withEntrypoint(entrypoint: string): ContainerResource
methodwithEnvironmentbuilder
Sets an environment variable
withEnvironment(name: string, value: IExpressionValue): IResourceWithEnvironment
methodwithEnvironmentCallbackbuilder
Allows for the population of environment variables on a resource.
withEnvironmentCallback(callback: (arg: EnvironmentCallbackContext) => Promise<void>): IResourceWithEnvironment
methodwithEnvironmentVariablesConfig
Adds an environment variables configuration gatherer to the builder.
withEnvironmentVariablesConfig(): IExecutionConfigurationBuilder
methodwithExecutableCommandbuilder
Sets the command for the executable resource.
withExecutableCommand(command: string): ExecutableResource
methodwithExplicitStartbuilder
Prevents resource from starting automatically
withExplicitStart(): IResource
methodwithExternalHttpEndpointsbuilder
Marks existing http or https endpoints on a resource as external.
withExternalHttpEndpoints(): IResourceWithEndpoints
methodwithHealthCheckbuilder
Adds a health check by key
withHealthCheck(key: string): IResource
methodwithHiddenbuilder
Hides the resource from default resource lists
withHidden(): IResource
methodwithHiddenOnCompletionbuilder
Hides the resource from default resource lists after successful completion
withHiddenOnCompletion(exitCode?: number, exitCodes?: number[]): IResource
methodwithHttpCommandbuilder
Adds an HTTP resource command
withHttpCommand(path: string, displayName: string, options?: HttpCommandExportOptions): IResourceWithEndpoints
methodwithHttpEndpointbuilder
Adds an HTTP endpoint
withHttpEndpoint(port?: number, targetPort?: number, name?: string, env?: string, isProxied?: boolean): IResourceWithEndpoints
methodwithHttpEndpointCallbackbuilder
Updates an HTTP endpoint via callback
withHttpEndpointCallback(callback: (obj: EndpointUpdateContext) => Promise<void>, name?: string, createIfNotExists?: boolean): IResourceWithEndpoints
methodwithHttpHealthCheckbuilder
Adds an HTTP health check to the external service for polyglot app hosts.
withHttpHealthCheck(path?: string, statusCode?: number, endpointName?: string): ExternalServiceResource
methodwithHttpHealthCheckbuilder
Adds a health check to the resource which is mapped to a specific endpoint.
withHttpHealthCheck(path?: string, statusCode?: number, endpointName?: string): IResourceWithEndpoints
methodwithHttpProbebuilder
Adds an HTTP health probe to the resource
withHttpProbe(probeType: ProbeType, path?: string, initialDelaySeconds?: number, periodSeconds?: number, timeoutSeconds?: number, failureThreshold?: number, successThreshold?: number, endpointName?: string): IResourceWithEndpoints
methodwithHttpsCertificateConfig
Adds an HTTPS certificate configuration gatherer using certificate metadata instead of a raw X509 certificate.
withHttpsCertificateConfig(configContextFactory: (arg: HttpsCertificateInfo) => Promise<HttpsCertificateExecutionConfigurationContext>): IExecutionConfigurationBuilder
methodwithHttpsDeveloperCertificatebuilder
Indicates that a resource should use the developer certificate key pair for HTTPS endpoints at run time. Currently this indicates use of the ASP.NET Core developer certificate. The developer certificate will only be used when running in local development scenarios; in publish mode resources will use their default certificate configuration.
withHttpsDeveloperCertificate(password?: ParameterResource): IResourceWithEnvironment
methodwithHttpsEndpointbuilder
Adds an HTTPS endpoint
withHttpsEndpoint(port?: number, targetPort?: number, name?: string, env?: string, isProxied?: boolean): IResourceWithEndpoints
methodwithHttpsEndpointCallbackbuilder
Updates an HTTPS endpoint via callback
withHttpsEndpointCallback(callback: (obj: EndpointUpdateContext) => Promise<void>, name?: string, createIfNotExists?: boolean): IResourceWithEndpoints
methodwithIconNamebuilder
Specifies the icon to use when displaying the resource in the dashboard.
withIconName(iconName: string, iconVariant?: IconVariant): IResource
methodwithImagebuilder
Allows overriding the image on a container.
withImage(image: string, tag?: string): ContainerResource
methodwithImagePullPolicybuilder
Sets the pull policy for the container resource.
withImagePullPolicy(pullPolicy: ImagePullPolicy): ContainerResource
methodwithImagePushOptionsbuilder
Adds an asynchronous callback to configure container image push options for the resource.
withImagePushOptions(callback: (arg: ContainerImagePushOptionsCallbackContext) => Promise<void>): IComputeResource
methodwithImageRegistrybuilder
Allows overriding the image registry on a container.
withImageRegistry(registry: string): ContainerResource
methodwithImageSHA256builder
Allows setting the image to a specific sha256 on a container.
withImageSHA256(sha256: string): ContainerResource
methodwithImageTagbuilder
Allows overriding the image tag on a container.
withImageTag(tag: string): ContainerResource
methodwithLifetimebuilder
Sets the lifetime behavior of the container resource.
withLifetime(lifetime: ContainerLifetime): ContainerResource
methodwithLifetimeOfbuilder
Configures a resource to match the lifetime of another resource.
withLifetimeOf(sourceBuilder: IResource): IResource
methodwithMcpServerbuilder
Marks the resource as hosting a Model Context Protocol (MCP) server on the specified endpoint.
withMcpServer(path?: string, endpointName?: string): IResourceWithEndpoints
methodwithOtlpExporterbuilder
Configures OTLP telemetry export
withOtlpExporter(protocol?: OtlpProtocol): IResourceWithEnvironment
methodwithoutHttpsCertificatebuilder
Disable HTTPS/TLS server certificate configuration for the resource. No HTTPS/TLS termination configuration will be applied.
withoutHttpsCertificate(): IResourceWithEnvironment
methodwithParentProcessLifetimebuilder
Configures a resource to use a persistent lifetime that ends when a parent process exits.
withParentProcessLifetime(parentProcessId: number): IResource
methodwithParentRelationshipbuilder
Sets the parent relationship
withParentRelationship(parent: IResource): IResource
methodwithPersistentLifetimebuilder
Configures a resource to use a persistent lifetime.
withPersistentLifetime(): IResource
methodwithPipelineConfigurationbuilder
Registers a callback to be executed during the pipeline configuration phase, allowing modification of step dependencies and relationships.
withPipelineConfiguration(callback: (obj: PipelineConfigurationContext) => Promise<void>): IResource
methodwithPipelineStepFactorybuilder
Adds a pipeline step to the resource that will be executed during deployment.
withPipelineStepFactory(stepName: string, callback: (arg: PipelineStepContext) => Promise<void>, dependsOn?: string[], requiredBy?: string[], tags?: string[], description?: string): IResource
methodwithProcessCommandbuilder
Adds a command to the resource that starts a local process when invoked.
withProcessCommand(commandName: string, displayName: string, options: ProcessCommandExportOptions): IResource
methodwithProcessCommandFactorybuilder
Adds a command to the resource that starts a local process created by a callback when invoked.
withProcessCommandFactory(commandName: string, displayName: string, createProcessSpec: (arg: ExecuteCommandContext) => Promise<ProcessCommandSpecExportData>, options?: ProcessCommandResultExportOptions): IResource
methodwithReferencebuilder
Adds a reference to another resource
withReference(source: EndpointReference|string|uri, connectionName?: string, optional?: boolean, name?: string): IResourceWithEnvironment
methodwithReferenceEnvironmentbuilder
Configures how information is injected into environment variables when the resource references other resources.
withReferenceEnvironment(options: ReferenceEnvironmentInjectionOptions): IResourceWithEnvironment
methodwithRelationshipbuilder
Adds a relationship to another resource using its builder.
withRelationship(resourceBuilder: IResource, type: string): IResource
methodwithRemoteImageNamebuilder
Sets the remote image name (without registry endpoint or tag) for container push operations.
withRemoteImageName(remoteImageName: string): IComputeResource
methodwithRemoteImageTagbuilder
Sets the remote image tag for container push operations.
withRemoteImageTag(remoteImageTag: string): IComputeResource
methodwithReplicasbuilder
Configures how many replicas of the project should be created for the project.
withReplicas(replicas: number): ProjectResource
methodwithRequiredCommandbuilder
Declares that a resource requires a specific command/executable to be available on the local machine PATH before it can start.
withRequiredCommand(command: string, helpLink?: string): IResource
methodwithSessionLifetimebuilder
Configures a resource to use a session lifetime.
withSessionLifetime(): IResource
methodwithToolIgnoreExistingFeedsbuilder
Configures the tool to use only the specified package sources, ignoring existing NuGet configuration.
withToolIgnoreExistingFeeds(): DotnetToolResource
methodwithToolIgnoreFailedSourcesbuilder
Configures the resource to treat package source failures as warnings.
withToolIgnoreFailedSources(): DotnetToolResource
methodwithToolPackagebuilder
Sets the package identifier for the tool configuration associated with the resource builder.
withToolPackage(packageId: string): DotnetToolResource
methodwithToolPrereleasebuilder
Allows prerelease versions of the tool to be used
withToolPrerelease(): DotnetToolResource
methodwithToolSourcebuilder
Adds a NuGet package source for tool acquisition.
withToolSource(source: string): DotnetToolResource
methodwithToolVersionbuilder
Sets the package version for a tool to use.
withToolVersion(version: string): DotnetToolResource
methodwithUrlbuilder
Adds or modifies displayed URLs
withUrl(url: ReferenceExpression, displayText?: string): IResource
methodwithUrlForEndpointbuilder
Registers a callback to update the URL displayed for the endpoint with the specified name.
withUrlForEndpoint(endpointName: string, callback: (obj: ResourceUrlAnnotation) => Promise<void>): IResource
methodwithUrlsbuilder
Registers a callback to customize the URLs displayed for the resource.
withUrls(callback: (obj: ResourceUrlsCallbackContext) => Promise<void>): IResource
methodwithVolumebuilder
Adds a volume to a container resource.
withVolume(target: string, name?: string, isReadOnly?: boolean): ContainerResource
methodwithWorkingDirectorybuilder
Sets the working directory for the executable resource.
withWorkingDirectory(workingDirectory: string): ExecutableResource
methodworkDir
Adds a WORKDIR statement to a Dockerfile stage
workDir(path: string): DockerfileStage

Enums