Aspire.Hosting
Official
📦 Aspire.Hostingv13.4.0206Functions
119Types
119 types and 181 members
Types
type
AddContainerOptions2 fieldshandle
AfterPublishEvent2 membershandle
AfterResourcesCreatedEvent2 membershandle
BeforePublishEvent2 membershandle
BeforeResourceStartedEvent2 membershandle
BeforeStartEvent2 memberstype
CertificateTrustExecutionConfigurationContext4 fieldstype
CertificateTrustExecutionConfigurationExportData3 fieldshandle
CommandLineArgsCallbackContext4 membershandle
CommandLineArgsEditor1 memberstype
CommandOptions10 fieldstype
CommandResultData3 fieldshandle
ConnectionStringAvailableEvent2 membershandle
ContainerImagePushOptions4 membershandle
ContainerImagePushOptionsCallbackContext3 membershandle
ContainerImageReference2 membershandle
ContainerMountAnnotation4 membershandle
ContainerPortReference2 membershandle
ContainerRegistryResourcehandle
ContainerResource20 memberstype
CreateBuilderOptions8 fieldshandle
CSharpAppResourcehandle
DistributedApplication1 membershandle
DistributedApplicationEventSubscriptionhandle
DistributedApplicationExecutionContext6 membershandle
DistributedApplicationExecutionContextOptionshandle
DistributedApplicationModel2 membershandle
DistributedApplicationResourceEventSubscriptionhandle
DockerfileBuilder3 membershandle
DockerfileBuilderCallbackContext4 membershandle
DockerfileFactoryContext1 membershandle
DockerfileStage14 membershandle
DotnetToolResource6 membershandle
EndpointReference18 membershandle
EndpointReferenceExpression3 membershandle
EndpointUpdateContext21 membershandle
EnvironmentCallbackContext4 membershandle
EnvironmentEditor1 membershandle
EventingSubscriberRegistrationContext6 membershandle
ExecutableResource3 membershandle
ExecuteCommandContext4 memberstype
ExecuteCommandResult5 fieldshandle
ExternalServiceResource1 memberstype
GenerateParameterDefault9 fieldstype
HttpCommandExportOptions9 fieldstype
HttpsCertificateExecutionConfigurationContext3 fieldstype
HttpsCertificateExecutionConfigurationExportData7 fieldstype
HttpsCertificateInfo3 fieldsinterface
IAspireStore2 membersinterface
IComputeEnvironmentResourceinterface
IDistributedApplicationBuilder28 membersinterface
IDistributedApplicationEventinterface
IDistributedApplicationEventing1 membersinterface
IDistributedApplicationPipeline3 membersinterface
IDistributedApplicationResourceEventinterface
IExecutionConfigurationBuilder5 membersinterface
IExecutionConfigurationResult2 membersinterface
IExpressionValuehandle
InitializeResourceEvent5 membershandle
InputsDialogValidationContext3 memberstype
InteractionInput13 fieldshandle
InteractionInputCollection1 membersinterface
IReportingStep6 membersinterface
IReportingTask4 membersinterface
IResource31 membersinterface
IResourceWithArgs2 membersinterface
IResourceWithConnectionString3 membersinterface
IResourceWithContainerFiles2 membersinterface
IResourceWithEndpoints15 membersinterface
IResourceWithEnvironment9 membersinterface
IResourceWithParentinterface
IResourceWithWaitSupport3 membersinterface
IUserSecretsManager6 membershandle
LogFacade4 memberstype
ParameterCustomInputOptions10 fieldshandle
ParameterResource2 membershandle
PipelineConfigurationContext3 membershandle
PipelineContext7 membershandle
PipelineEditor2 membershandle
PipelineStep8 membershandle
PipelineStepContext8 membershandle
PipelineStepFactoryContext2 membershandle
PipelineSummary2 memberstype
ProcessCommandExportOptions11 fieldstype
ProcessCommandResultExportOptions4 fieldstype
ProcessCommandSpecExportData7 fieldshandle
ProjectResource3 membershandle
ProjectResourceOptions6 memberstype
ReferenceEnvironmentInjectionOptions4 fieldshandle
ReferenceExpression1 membershandle
ReferenceExpressionBuilder5 membershandle
ResourceCommandService1 membershandle
ResourceEndpointsAllocatedEvent2 memberstype
ResourceEventDto6 fieldshandle
ResourceLoggerService2 membershandle
ResourceNotificationService6 membershandle
ResourceReadyEvent2 membershandle
ResourceStoppedEvent2 memberstype
ResourceUrlAnnotation4 fieldshandle
ResourceUrlsCallbackContext5 membershandle
ResourceUrlsEditor3 membershandle
UpdateCommandStateContext1 memberstype
UpdateCommandStateResourceSnapshot5 fieldsFunctions
method
addConnectionStringbuilderAdds a connection string resource
addConnectionString(name: string, environmentVariableNameOrExpression?: ReferenceExpression): IResourceWithConnectionStringmethod
addContainerbuilderAdds a container resource to the application.
addContainer(name: string, image: AddContainerOptions): ContainerResourcemethod
addContainerFilesAdds COPY --from statements for published container files
addContainerFiles(resource: IResource, rootDestinationPath: string, logger?: ILogger): DockerfileStagemethod
addContainerFilesStagesAdds Dockerfile stages for published container files
addContainerFilesStages(resource: IResource, logger?: ILogger): DockerfileBuildermethod
addContainerRegistrybuilderAdds a container registry resource
addContainerRegistry(name: string, endpoint: ParameterResource, repository?: ParameterResource): ContainerRegistryResourcemethod
addCSharpAppbuilderAdds a C# application resource
addCSharpApp(name: string, path: string, options?: ProjectResourceOptions): CSharpAppResourcemethod
addDockerfilebuilderAdds a Dockerfile to the application model that can be treated like a container resource.
addDockerfile(name: string, contextPath: string, dockerfilePath?: string, stage?: string): ContainerResourcemethod
addDockerfileBuilderbuilderAdds a container resource built from a programmatically generated Dockerfile
addDockerfileBuilder(name: string, contextPath: string, callback: (arg: DockerfileBuilderCallbackContext) => Promise<void>, stage?: string): ContainerResourcemethod
addDockerfileFactorybuilderAdds 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): ContainerResourcemethod
addDotnetToolbuilderAdds a .NET tool resource to the application model.
addDotnetTool(name: string, packageId: string): DotnetToolResourcemethod
addEventingSubscriberAdds an ATS-friendly eventing subscriber callback to the distributed-application builder.
addEventingSubscriber(subscribe: (arg: EventingSubscriberRegistrationContext) => Promise<void>): voidmethod
addExecutablebuilderAdds an executable resource to the application model.
addExecutable(name: string, command: string, workingDirectory: string, args: string[]): ExecutableResourcemethod
addExternalServicebuilderAdds an external service resource
addExternalService(name: string, url: ParameterResource): ExternalServiceResourcemethod
addMarkdownAdds a key-value pair to the pipeline summary with a Markdown-formatted value.
addMarkdown(key: string, markdownString: string): voidmethod
addParameterbuilderAdds a parameter resource
addParameter(name: string, value?: string, publishValueAsDefault?: boolean, secret?: boolean): ParameterResourcemethod
addParameterFromConfigurationbuilderAdds a parameter resource to the application, with a value coming from configuration.
addParameterFromConfiguration(name: string, configurationKey: string, secret?: boolean): ParameterResourcemethod
addParameterWithGeneratedValuebuilderAdds a parameter with a generated default value
addParameterWithGeneratedValue(name: string, value: GenerateParameterDefault, secret?: boolean, persist?: boolean): ParameterResourcemethod
addProjectbuilderAdds a .NET project resource
addProject(name: string, projectPath: string, launchProfileOrOptions?: ProjectResourceOptions): ProjectResourcemethod
addStepAdds an application-level pipeline step in a TypeScript-friendly shape.
addStep(stepName: string, callback: (arg: PipelineStepContext) => Promise<void>, dependsOn?: string[], requiredBy?: string[]): voidmethod
argAdds a global ARG statement to the Dockerfile
arg(name: string, defaultValue?: string): DockerfileBuildermethod
argAdds an ARG statement to a Dockerfile stage
arg(name: string, defaultValue?: string): DockerfileStagemethod
asHttp2ServicebuilderConfigures a resource to mark all endpoints' transport as HTTP/2. This is useful for HTTP/2 services that need prior knowledge.
asHttp2Service(): IResourceWithEndpointsmethod
buildBuilds the execution configuration for the specified builder.
build(executionContext: DistributedApplicationExecutionContext, resourceLogger?: ILogger, cancellationToken?: cancellationToken): IExecutionConfigurationResultmethod
clearContainerFilesSourcesbuilderRemoves any container files source annotation from the resource being built.
clearContainerFilesSources(): IResourceWithContainerFilesmethod
cmdAdds a CMD statement to a Dockerfile stage
cmd(command: string[]): DockerfileStagemethod
commentAdds a comment to a Dockerfile stage
comment(comment: string): DockerfileStagemethod
completeLogCompletes the log stream for a resource.
completeLog(resource: IResource): voidmethod
completeLogByNameCompletes the log stream by resource name.
completeLogByName(resourceName: string): voidmethod
completeStepCompletes the reporting step with plain-text completion text.
completeStep(completionText: string, completionState?: string, cancellationToken?: cancellationToken): voidmethod
completeStepMarkdownCompletes the reporting step with Markdown-formatted completion text.
completeStepMarkdown(markdownString: string, completionState?: string, cancellationToken?: cancellationToken): voidmethod
completeTaskCompletes the reporting task with plain-text completion text.
completeTask(completionMessage?: string, completionState?: string, cancellationToken?: cancellationToken): voidmethod
completeTaskMarkdownCompletes the reporting task with Markdown-formatted completion text.
completeTaskMarkdown(markdownString: string, completionState?: string, cancellationToken?: cancellationToken): voidmethod
configureRegisters a pipeline configuration callback in a TypeScript-friendly shape.
configure(callback: (arg: PipelineConfigurationContext) => Promise<void>): voidmethod
copyAdds a COPY statement to a Dockerfile stage
copy(source: string, destination: string, chown?: string): DockerfileStagemethod
copyFromAdds a COPY --from statement to a Dockerfile stage
copyFrom(from: string, source: string, destination: string, chown?: string): DockerfileStagemethod
createBuilderCreates a new distributed application builder
createBuilder(): IDistributedApplicationBuildermethod
createExecutionConfigurationCreates an execution configuration builder for the specified resource.
createExecutionConfiguration(): IExecutionConfigurationBuildermethod
createLoggerCreates a logger for the specified category name.
createLogger(categoryName: string): ILoggermethod
createMarkdownTaskCreates a reporting task with Markdown-formatted status text.
createMarkdownTask(markdownString: string, cancellationToken?: cancellationToken): IReportingTaskmethod
createTaskCreates a reporting task with plain-text status text.
createTask(statusText: string, cancellationToken?: cancellationToken): IReportingTaskmethod
disableBuildOnlyContainerValidationDisables the publish and deploy validation that requires build-only containers to be consumed by another resource.
disableBuildOnlyContainerValidation(): IDistributedApplicationPipelinemethod
disableForwardedHeadersbuilderConfigures the project to disable forwarded headers when being published.
disableForwardedHeaders(): ProjectResourcemethod
emptyLineAdds an empty line to a Dockerfile stage
emptyLine(): DockerfileStagemethod
entrypointAdds an ENTRYPOINT statement to a Dockerfile stage
entrypoint(command: string[]): DockerfileStagemethod
envAdds an ENV statement to a Dockerfile stage
env(name: string, value: string): DockerfileStagemethod
excludeFromManifestbuilderExcludes a resource from being published to the manifest.
excludeFromManifest(): IResourcemethod
excludeFromMcpbuilderExclude the resource from MCP operations using the Aspire MCP server. The resource is excluded from results that return resources, console logs and telemetry.
excludeFromMcp(): IResourcemethod
executeCommandAsyncExecutes a command for the specified resource.
executeCommandAsync(resource: IResource, commandName: string, arguments?: Dict<string,string>, cancellationToken?: cancellationToken): ExecuteCommandResultmethod
existsChecks whether a configuration section exists.
exists(key: string): booleanmethod
exposeAdds an EXPOSE statement to a Dockerfile stage
expose(port: number): DockerfileStagemethod
findResourceByNameFinds a resource by name.
findResourceByName(name: string): IResourcemethod
fromAdds a FROM statement to start a Dockerfile stage
from(image: string, stageName?: string): DockerfileStagemethod
getAspireStoreGets the Aspire store from the service provider.
getAspireStore(): IAspireStoremethod
getCertificateTrustDataGets certificate trust execution-configuration data when present.
getCertificateTrustData(): CertificateTrustExecutionConfigurationExportDatamethod
getChildrenGets the child sections of a configuration handle.
getChildren(): IConfigurationSection[]method
getConfigurationGets the application configuration.
getConfiguration(): IConfigurationmethod
getConfigValueGets a configuration value by key.
getConfigValue(key: string): stringmethod
getConnectionPropertyRetrieves the value of a specified connection property from the resource's connection properties.
getConnectionProperty(key: string): ReferenceExpressionmethod
getConnectionStringGets a connection string by name.
getConnectionString(name: string): stringmethod
getDistributedApplicationModelGets the distributed application model from the service provider.
getDistributedApplicationModel(): DistributedApplicationModelmethod
getEndpointGets an endpoint reference
getEndpoint(name: string): EndpointReferencemethod
getEventingGets the distributed application eventing service from the service provider.
getEventing(): IDistributedApplicationEventingmethod
getFileNameWithContentGets 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): stringmethod
getHttpsCertificateDataGets HTTPS certificate execution-configuration data when present.
getHttpsCertificateData(): HttpsCertificateExecutionConfigurationExportDatamethod
getLoggerFactoryGets the logger factory from the service provider.
getLoggerFactory(): ILoggerFactorymethod
getOrSetSecretGets 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): voidmethod
getResourceCommandServiceGets the resource command service from the service provider.
getResourceCommandService(): ResourceCommandServicemethod
getResourceLoggerServiceGets the resource logger service from the service provider.
getResourceLoggerService(): ResourceLoggerServicemethod
getResourceNameGets the name of the resource from a builder.
getResourceName(): stringmethod
getResourceNotificationServiceGets the resource notification service from the service provider.
getResourceNotificationService(): ResourceNotificationServicemethod
getResourcesGets all resources in the distributed application model.
getResources(): IResource[]method
getSectionGets a configuration section by key.
getSection(key: string): IConfigurationSectionmethod
getUserSecretsManagerGets the user secrets manager from the service provider.
getUserSecretsManager(): IUserSecretsManagermethod
isDevelopmentChecks if the environment is Development.
isDevelopment(): booleanmethod
isEnvironmentChecks if the environment matches the specified name.
isEnvironment(environmentName: string): booleanmethod
isProductionChecks if the environment is Production.
isProduction(): booleanmethod
isStagingChecks if the environment is Staging.
isStaging(): booleanmethod
logLogs a message with a specified log level.
log(level: string, message: string): voidmethod
logDebugLogs a debug message.
logDebug(message: string): voidmethod
logErrorLogs an error message.
logError(message: string): voidmethod
logInformationLogs an information message.
logInformation(message: string): voidmethod
logStepLogs a plain-text message for the reporting step.
logStep(level: string, message: string): voidmethod
logStepMarkdownLogs a Markdown-formatted message for the reporting step.
logStepMarkdown(level: string, markdownString: string): voidmethod
logWarningLogs a warning message.
logWarning(message: string): voidmethod
onAfterPublishSubscribes to the AfterPublish event from an eventing subscriber registration context.
onAfterPublish(callback: (arg: AfterPublishEvent) => Promise<void>): DistributedApplicationEventSubscriptionmethod
onAfterResourcesCreatedSubscribes to the AfterResourcesCreated event from an eventing subscriber registration context.
onAfterResourcesCreated(callback: (arg: AfterResourcesCreatedEvent) => Promise<void>): DistributedApplicationEventSubscriptionmethod
onBeforePublishSubscribes to the BeforePublish event from an eventing subscriber registration context.
onBeforePublish(callback: (arg: BeforePublishEvent) => Promise<void>): DistributedApplicationEventSubscriptionmethod
onBeforeResourceStartedbuilderSubscribes to the BeforeResourceStarted event.
onBeforeResourceStarted(callback: (arg: BeforeResourceStartedEvent) => Promise<void>): IResourcemethod
onBeforeStartSubscribes to the BeforeStart event from an eventing subscriber registration context.
onBeforeStart(callback: (arg: BeforeStartEvent) => Promise<void>): DistributedApplicationEventSubscriptionmethod
onConnectionStringAvailablebuilderSubscribes to the ConnectionStringAvailable event.
onConnectionStringAvailable(callback: (arg: ConnectionStringAvailableEvent) => Promise<void>): IResourceWithConnectionStringmethod
onInitializeResourcebuilderSubscribes to the InitializeResource event.
onInitializeResource(callback: (arg: InitializeResourceEvent) => Promise<void>): IResourcemethod
onResourceEndpointsAllocatedbuilderSubscribes to the ResourceEndpointsAllocated event.
onResourceEndpointsAllocated(callback: (arg: ResourceEndpointsAllocatedEvent) => Promise<void>): IResourceWithEndpointsmethod
onResourceReadybuilderSubscribes to the ResourceReady event.
onResourceReady(callback: (arg: ResourceReadyEvent) => Promise<void>): IResourcemethod
onResourceStoppedbuilderSubscribes to the ResourceStopped event.
onResourceStopped(callback: (arg: ResourceStoppedEvent) => Promise<void>): IResourcemethod
publishAsConnectionStringbuilderChanges the resource to be published as a connection string reference in the manifest.
publishAsConnectionString(): ContainerResourcemethod
publishAsContainerbuilderChanges the resource to be published as a container in the manifest.
publishAsContainer(): ContainerResourcemethod
publishAsDockerFilebuilderPublishes an executable as a Docker file
publishAsDockerFile(configure: (obj: ContainerResource) => Promise<void>): ExecutableResourcemethod
publishAsDockerFilebuilderPublishes a project as a Docker file with optional container configuration
publishAsDockerFile(configure?: (obj: ContainerResource) => Promise<void>): ProjectResourcemethod
publishResourceUpdatePublishes an update for a resource's state.
publishResourceUpdate(resource: IResource, state?: string, stateStyle?: string): voidmethod
publishWithContainerFilesbuilderConfigures the resource to copy container files from the specified source resource during publishing.
publishWithContainerFiles(source: IResourceWithContainerFiles, destinationPath: string): IContainerFilesDestinationResourcemethod
runAdds a RUN statement to a Dockerfile stage
run(command: string): DockerfileStagemethod
runWithMountsAdds a RUN statement with mounts to a Dockerfile stage
runWithMounts(command: string, mounts: string[]): DockerfileStagemethod
saveStateJsonSaves state to user secrets from a JSON string.
saveStateJson(json: string, cancellationToken?: cancellationToken): voidmethod
subscribeAfterPublishSubscribes to the AfterPublish event, which fires after the application is published.
subscribeAfterPublish(callback: (arg: AfterPublishEvent) => Promise<void>): DistributedApplicationEventSubscriptionmethod
subscribeAfterResourcesCreatedSubscribes to the AfterResourcesCreated event, which fires after all resources are created.
subscribeAfterResourcesCreated(callback: (arg: AfterResourcesCreatedEvent) => Promise<void>): DistributedApplicationEventSubscriptionmethod
subscribeBeforePublishSubscribes to the BeforePublish event, which fires before the application is published.
subscribeBeforePublish(callback: (arg: BeforePublishEvent) => Promise<void>): DistributedApplicationEventSubscriptionmethod
subscribeBeforeStartSubscribes to the BeforeStart event, which fires before the application starts.
subscribeBeforeStart(callback: (arg: BeforeStartEvent) => Promise<void>): DistributedApplicationEventSubscriptionmethod
tryAddEventingSubscriberAttempts to add an ATS-friendly eventing subscriber callback to the distributed-application builder.
tryAddEventingSubscriber(subscribe: (arg: EventingSubscriberRegistrationContext) => Promise<void>): voidmethod
tryGetResourceStateTries to get the current state of a resource.
tryGetResourceState(resourceName: string): ResourceEventDtomethod
updateTaskUpdates the reporting task with plain-text status text.
updateTask(statusText: string, cancellationToken?: cancellationToken): voidmethod
updateTaskMarkdownUpdates the reporting task with Markdown-formatted status text.
updateTaskMarkdown(markdownString: string, cancellationToken?: cancellationToken): voidmethod
userAdds a USER statement to a Dockerfile stage
user(user: string): DockerfileStagemethod
waitForbuilderWaits for another resource to be ready
waitFor(dependency: IResource, waitBehavior?: WaitBehavior): IResourceWithWaitSupportmethod
waitForCompletionbuilderWaits for the dependency resource to enter the Exited or Finished state before starting the resource.
waitForCompletion(dependency: IResource, exitCode?: number): IResourceWithWaitSupportmethod
waitForDependenciesWaits for all dependencies of a resource to be ready.
waitForDependencies(resource: IResource): voidmethod
waitForResourceHealthyWaits for a resource to become healthy.
waitForResourceHealthy(resourceName: string): ResourceEventDtomethod
waitForResourceStateWaits for a resource to reach a specified state.
waitForResourceState(resourceName: string, targetState?: string): voidmethod
waitForResourceStatesWaits for a resource to reach one of the specified states.
waitForResourceStates(resourceName: string, targetStates: string[]): stringmethod
waitForStartbuilderWaits for another resource to start
waitForStart(dependency: IResource, waitBehavior?: WaitBehavior): IResourceWithWaitSupportmethod
withArgsbuilderAdds arguments to be passed to a resource that supports arguments when it is launched.
withArgs(args: string[]): IResourceWithArgsmethod
withArgsCallbackbuilderAdds a callback to be executed with a list of command-line arguments when a resource is started.
withArgsCallback(callback: (obj: CommandLineArgsCallbackContext) => Promise<void>): IResourceWithArgsmethod
withArgumentsConfigAdds a command line arguments configuration gatherer to the builder.
withArgumentsConfig(): IExecutionConfigurationBuildermethod
withBindMountbuilderAdds a bind mount to a container resource.
withBindMount(source: string, target: string, isReadOnly?: boolean): ContainerResourcemethod
withBuildArgbuilderAdds a build argument when the container is built from a Dockerfile.
withBuildArg(name: string, value: ParameterResource): ContainerResourcemethod
withBuildSecretbuilderAdds a secret build argument when the container is built from a Dockerfile.
withBuildSecret(name: string, value: ParameterResource): ContainerResourcemethod
withCertificateTrustConfigAdds a certificate trust configuration gatherer to the builder.
withCertificateTrustConfig(configContextFactory: (arg: CertificateTrustScope) => Promise<CertificateTrustExecutionConfigurationContext>): IExecutionConfigurationBuildermethod
withCertificateTrustScopebuilderSets the certificate trust scope
withCertificateTrustScope(scope: CertificateTrustScope): IResourceWithEnvironmentmethod
withChildRelationshipbuilderSets a child relationship
withChildRelationship(child: IResource): IResourcemethod
withCommandbuilderAdds a resource command
withCommand(name: string, displayName: string, executeCommand: (arg: ExecuteCommandContext) => Promise<ExecuteCommandResult>, commandOptions?: CommandOptions): IResourcemethod
withComputeEnvironmentbuilderConfigures the compute environment for the compute resource.
withComputeEnvironment(computeEnvironmentResource: IComputeEnvironmentResource): IComputeResourcemethod
withConnectionPropertybuilderAdds a connection property annotation to the resource being built.
withConnectionProperty(name: string, value: ReferenceExpression): IResourceWithConnectionStringmethod
withContainerCertificatePathsbuilderAdds container certificate path overrides used for certificate trust at run time.
withContainerCertificatePaths(customCertificatesDestination?: string, defaultCertificateBundlePaths?: string[], defaultCertificateDirectoryPaths?: string[]): ContainerResourcemethod
withContainerFilesSourcebuilderAdds a container files source annotation to the resource being built, specifying the path to the container files source.
withContainerFilesSource(sourcePath: string): IResourceWithContainerFilesmethod
withContainerNamebuilderOverrides 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): ContainerResourcemethod
withContainerNetworkAliasbuilderAdds a network alias to container resource.
withContainerNetworkAlias(alias: string): ContainerResourcemethod
withContainerRegistrybuilderConfigures the resource to use the specified container registry for container image operations.
withContainerRegistry(registry: IResource): IResourcemethod
withContainerRuntimeArgsbuilderAdds 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[]): ContainerResourcemethod
withCustomInputbuilderSets a custom input for the parameter resource from a polyglot app host.
withCustomInput(options: ParameterCustomInputOptions): ParameterResourcemethod
withDescriptionbuilderSets the description of the parameter resource.
withDescription(description: string, enableMarkdown?: boolean): ParameterResourcemethod
withDeveloperCertificateTrustbuilderIndicates 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): IResourceWithEnvironmentmethod
withDockerfilebuilderCauses Aspire to build the specified container image from a Dockerfile.
withDockerfile(contextPath: string, dockerfilePath?: string, stage?: string): ContainerResourcemethod
withDockerfileBaseImagebuilderConfigures custom base images for generated Dockerfiles.
withDockerfileBaseImage(buildImage?: string, runtimeImage?: string): IResourcemethod
withDockerfileBuilderbuilderConfigures the resource to use a programmatically generated Dockerfile
withDockerfileBuilder(contextPath: string, callback: (arg: DockerfileBuilderCallbackContext) => Promise<void>, stage?: string): ContainerResourcemethod
withDockerfileFactorybuilderBuilds the specified container image from a Dockerfile generated by an asynchronous factory function.
withDockerfileFactory(contextPath: string, dockerfileFactory: (arg: DockerfileFactoryContext) => Promise<string>, stage?: string): ContainerResourcemethod
withEndpointbuilderAdds a network endpoint
withEndpoint(port?: number, targetPort?: number, scheme?: string, name?: string, env?: string, isProxied?: boolean, isExternal?: boolean, protocol?: ProtocolType): IResourceWithEndpointsmethod
withEndpointCallbackbuilderUpdates a named endpoint via callback
withEndpointCallback(endpointName: string, callback: (obj: EndpointUpdateContext) => Promise<void>, createIfNotExists?: boolean): IResourceWithEndpointsmethod
withEndpointProxySupportbuilderSet 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): IResourceWithEndpointsmethod
withEntrypointbuilderSets the Entrypoint for the container.
withEntrypoint(entrypoint: string): ContainerResourcemethod
withEnvironmentbuilderSets an environment variable
withEnvironment(name: string, value: IExpressionValue): IResourceWithEnvironmentmethod
withEnvironmentCallbackbuilderAllows for the population of environment variables on a resource.
withEnvironmentCallback(callback: (arg: EnvironmentCallbackContext) => Promise<void>): IResourceWithEnvironmentmethod
withEnvironmentVariablesConfigAdds an environment variables configuration gatherer to the builder.
withEnvironmentVariablesConfig(): IExecutionConfigurationBuildermethod
withExecutableCommandbuilderSets the command for the executable resource.
withExecutableCommand(command: string): ExecutableResourcemethod
withExplicitStartbuilderPrevents resource from starting automatically
withExplicitStart(): IResourcemethod
withExternalHttpEndpointsbuilderMarks existing http or https endpoints on a resource as external.
withExternalHttpEndpoints(): IResourceWithEndpointsmethod
withHealthCheckbuilderAdds a health check by key
withHealthCheck(key: string): IResourcemethod
withHiddenbuilderHides the resource from default resource lists
withHidden(): IResourcemethod
withHiddenOnCompletionbuilderHides the resource from default resource lists after successful completion
withHiddenOnCompletion(exitCode?: number, exitCodes?: number[]): IResourcemethod
withHttpCommandbuilderAdds an HTTP resource command
withHttpCommand(path: string, displayName: string, options?: HttpCommandExportOptions): IResourceWithEndpointsmethod
withHttpEndpointbuilderAdds an HTTP endpoint
withHttpEndpoint(port?: number, targetPort?: number, name?: string, env?: string, isProxied?: boolean): IResourceWithEndpointsmethod
withHttpEndpointCallbackbuilderUpdates an HTTP endpoint via callback
withHttpEndpointCallback(callback: (obj: EndpointUpdateContext) => Promise<void>, name?: string, createIfNotExists?: boolean): IResourceWithEndpointsmethod
withHttpHealthCheckbuilderAdds an HTTP health check to the external service for polyglot app hosts.
withHttpHealthCheck(path?: string, statusCode?: number, endpointName?: string): ExternalServiceResourcemethod
withHttpHealthCheckbuilderAdds a health check to the resource which is mapped to a specific endpoint.
withHttpHealthCheck(path?: string, statusCode?: number, endpointName?: string): IResourceWithEndpointsmethod
withHttpProbebuilderAdds an HTTP health probe to the resource
withHttpProbe(probeType: ProbeType, path?: string, initialDelaySeconds?: number, periodSeconds?: number, timeoutSeconds?: number, failureThreshold?: number, successThreshold?: number, endpointName?: string): IResourceWithEndpointsmethod
withHttpsCertificateConfigAdds an HTTPS certificate configuration gatherer using certificate metadata instead of a raw X509 certificate.
withHttpsCertificateConfig(configContextFactory: (arg: HttpsCertificateInfo) => Promise<HttpsCertificateExecutionConfigurationContext>): IExecutionConfigurationBuildermethod
withHttpsDeveloperCertificatebuilderIndicates 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): IResourceWithEnvironmentmethod
withHttpsEndpointbuilderAdds an HTTPS endpoint
withHttpsEndpoint(port?: number, targetPort?: number, name?: string, env?: string, isProxied?: boolean): IResourceWithEndpointsmethod
withHttpsEndpointCallbackbuilderUpdates an HTTPS endpoint via callback
withHttpsEndpointCallback(callback: (obj: EndpointUpdateContext) => Promise<void>, name?: string, createIfNotExists?: boolean): IResourceWithEndpointsmethod
withIconNamebuilderSpecifies the icon to use when displaying the resource in the dashboard.
withIconName(iconName: string, iconVariant?: IconVariant): IResourcemethod
withImagebuilderAllows overriding the image on a container.
withImage(image: string, tag?: string): ContainerResourcemethod
withImagePullPolicybuilderSets the pull policy for the container resource.
withImagePullPolicy(pullPolicy: ImagePullPolicy): ContainerResourcemethod
withImagePushOptionsbuilderAdds an asynchronous callback to configure container image push options for the resource.
withImagePushOptions(callback: (arg: ContainerImagePushOptionsCallbackContext) => Promise<void>): IComputeResourcemethod
withImageRegistrybuilderAllows overriding the image registry on a container.
withImageRegistry(registry: string): ContainerResourcemethod
withImageSHA256builderAllows setting the image to a specific sha256 on a container.
withImageSHA256(sha256: string): ContainerResourcemethod
withImageTagbuilderAllows overriding the image tag on a container.
withImageTag(tag: string): ContainerResourcemethod
withLifetimebuilderSets the lifetime behavior of the container resource.
withLifetime(lifetime: ContainerLifetime): ContainerResourcemethod
withLifetimeOfbuilderConfigures a resource to match the lifetime of another resource.
withLifetimeOf(sourceBuilder: IResource): IResourcemethod
withMcpServerbuilderMarks the resource as hosting a Model Context Protocol (MCP) server on the specified endpoint.
withMcpServer(path?: string, endpointName?: string): IResourceWithEndpointsmethod
withOtlpExporterbuilderConfigures OTLP telemetry export
withOtlpExporter(protocol?: OtlpProtocol): IResourceWithEnvironmentmethod
withoutHttpsCertificatebuilderDisable HTTPS/TLS server certificate configuration for the resource. No HTTPS/TLS termination configuration will be applied.
withoutHttpsCertificate(): IResourceWithEnvironmentmethod
withParentProcessLifetimebuilderConfigures a resource to use a persistent lifetime that ends when a parent process exits.
withParentProcessLifetime(parentProcessId: number): IResourcemethod
withParentRelationshipbuilderSets the parent relationship
withParentRelationship(parent: IResource): IResourcemethod
withPersistentLifetimebuilderConfigures a resource to use a persistent lifetime.
withPersistentLifetime(): IResourcemethod
withPipelineConfigurationbuilderRegisters a callback to be executed during the pipeline configuration phase, allowing modification of step dependencies and relationships.
withPipelineConfiguration(callback: (obj: PipelineConfigurationContext) => Promise<void>): IResourcemethod
withPipelineStepFactorybuilderAdds 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): IResourcemethod
withProcessCommandbuilderAdds a command to the resource that starts a local process when invoked.
withProcessCommand(commandName: string, displayName: string, options: ProcessCommandExportOptions): IResourcemethod
withProcessCommandFactorybuilderAdds 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): IResourcemethod
withReferencebuilderAdds a reference to another resource
withReference(source: EndpointReference|string|uri, connectionName?: string, optional?: boolean, name?: string): IResourceWithEnvironmentmethod
withReferenceEnvironmentbuilderConfigures how information is injected into environment variables when the resource references other resources.
withReferenceEnvironment(options: ReferenceEnvironmentInjectionOptions): IResourceWithEnvironmentmethod
withRelationshipbuilderAdds a relationship to another resource using its builder.
withRelationship(resourceBuilder: IResource, type: string): IResourcemethod
withRemoteImageNamebuilderSets the remote image name (without registry endpoint or tag) for container push operations.
withRemoteImageName(remoteImageName: string): IComputeResourcemethod
withRemoteImageTagbuilderSets the remote image tag for container push operations.
withRemoteImageTag(remoteImageTag: string): IComputeResourcemethod
withReplicasbuilderConfigures how many replicas of the project should be created for the project.
withReplicas(replicas: number): ProjectResourcemethod
withRequiredCommandbuilderDeclares 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): IResourcemethod
withSessionLifetimebuilderConfigures a resource to use a session lifetime.
withSessionLifetime(): IResourcemethod
withToolIgnoreExistingFeedsbuilderConfigures the tool to use only the specified package sources, ignoring existing NuGet configuration.
withToolIgnoreExistingFeeds(): DotnetToolResourcemethod
withToolIgnoreFailedSourcesbuilderConfigures the resource to treat package source failures as warnings.
withToolIgnoreFailedSources(): DotnetToolResourcemethod
withToolPackagebuilderSets the package identifier for the tool configuration associated with the resource builder.
withToolPackage(packageId: string): DotnetToolResourcemethod
withToolPrereleasebuilderAllows prerelease versions of the tool to be used
withToolPrerelease(): DotnetToolResourcemethod
withToolSourcebuilderAdds a NuGet package source for tool acquisition.
withToolSource(source: string): DotnetToolResourcemethod
withToolVersionbuilderSets the package version for a tool to use.
withToolVersion(version: string): DotnetToolResourcemethod
withUrlbuilderAdds or modifies displayed URLs
withUrl(url: ReferenceExpression, displayText?: string): IResourcemethod
withUrlForEndpointbuilderRegisters a callback to update the URL displayed for the endpoint with the specified name.
withUrlForEndpoint(endpointName: string, callback: (obj: ResourceUrlAnnotation) => Promise<void>): IResourcemethod
withUrlsbuilderRegisters a callback to customize the URLs displayed for the resource.
withUrls(callback: (obj: ResourceUrlsCallbackContext) => Promise<void>): IResourcemethod
withVolumebuilderAdds a volume to a container resource.
withVolume(target: string, name?: string, isReadOnly?: boolean): ContainerResourcemethod
withWorkingDirectorybuilderSets the working directory for the executable resource.
withWorkingDirectory(workingDirectory: string): ExecutableResourcemethod
workDirAdds a WORKDIR statement to a Dockerfile stage
workDir(path: string): DockerfileStageEnums
enum
CertificateTrustScope4 valuesenum
CommandResultFormat3 valuesenum
ContainerLifetime2 valuesenum
ContainerMountType2 valuesenum
DistributedApplicationOperation2 valuesenum
EndpointProperty8 valuesenum
HttpCommandResultMode4 valuesenum
IconVariant2 valuesenum
ImagePullPolicy4 valuesenum
InputType5 valuesenum
OtlpProtocol3 valuesenum
ProbeType3 valuesenum
ResourceCommandState3 valuesenum
ResourceCommandVisibility3 valuesenum
UrlDisplayLocation2 valuesenum
WaitBehavior2 values