IResource
interface IResource { createExecutionConfiguration(): IExecutionConfigurationBuilder; excludeFromManifest(): IResource; excludeFromMcp(): IResource; getResourceName(): string; getSerializedAnnotation(annotationId: string): string; hasSerializedAnnotation(annotationId: string): boolean; onBeforeResourceStarted(callback: (arg: BeforeResourceStartedEvent) => Promise<void>): IResource; onInitializeResource(callback: (arg: InitializeResourceEvent) => Promise<void>): IResource; onResourceReady(callback: (arg: ResourceReadyEvent) => Promise<void>): IResource; onResourceStopped(callback: (arg: ResourceStoppedEvent) => Promise<void>): IResource; subscribeHttpsEndpointsUpdate(callback: (obj: HttpsEndpointUpdateCallbackContext) => Promise<void>): IResource; withChildRelationship(child: IResource): IResource; withCommand(name: string, displayName: string, executeCommand: (arg: ExecuteCommandContext) => Promise<ExecuteCommandResult>, commandOptions?: CommandOptions): IResource; withContainerBuildOptions(callback: (arg: ContainerBuildOptionsCallbackContext) => Promise<void>): IResource; withContainerRegistry(registry: IResource): IResource; withDisplayOrder(order: number): IResource; withDockerfileBaseImage( buildImage?: string, runtimeImage?: string): IResource; withExplicitStart(): IResource; withHealthCheck(key: string): IResource; withHidden(): IResource; withHiddenOnCompletion( exitCode?: number, exitCodes?: number[]): IResource; withIconName( iconName: string, iconVariant?: IconVariant): IResource; withLifetimeOf(sourceBuilder: IResource): IResource; withParentProcessLifetime(parentProcessId: number): IResource; withParentRelationship(parent: IResource): IResource; withPersistentLifetime(): IResource; withPipelineConfiguration(callback: (obj: PipelineConfigurationContext) => Promise<void>): IResource; withPipelineStepFactory(stepName: string, callback: (arg: PipelineStepContext) => Promise<void>, dependsOn?: string[], requiredBy?: string[], tags?: string[], description?: string): IResource; withProcessCommand( commandName: string, displayName: string, options: ProcessCommandExportOptions): IResource; withProcessCommandFactory(commandName: string, displayName: string, createProcessSpec: (arg: ExecuteCommandContext) => Promise<ProcessCommandSpecExportData>, options?: ProcessCommandResultExportOptions): IResource; withRelationship( resourceBuilder: IResource, type: string): IResource; withRequiredCommand( command: string, helpLink?: string): IResource; withRequiredCommandValidation(command: string, validationCallback: (arg: RequiredCommandValidationContext) => Promise<RequiredCommandValidationResult>, helpLink?: string): IResource; withResourceTypeDisplayName(resourceTypeDisplayName: string): IResource; withSerializedAnnotation( annotationId: string, json: string): IResource; withSessionLifetime(): IResource; withTags(tags: string[]): IResource; withTerminal(configure?: (obj: TerminalOptions) => Promise<void>): IResource; withTrait( name: string, value: string): IResource; withUrl( url: string | ReferenceExpression, displayText?: string): IResource; withUrlForEndpoint(endpointName: string, callback: (obj: ResourceUrlAnnotation) => Promise<void>): IResource; withUrls(callback: (obj: ResourceUrlsCallbackContext) => Promise<void>): IResource;}Methods
createExecutionConfiguration(): IExecutionConfigurationBuilderReturns
IExecutionConfigurationBuilder excludeFromManifest(): IResourceReturns
IResource excludeFromMcp(): IResourceReturns
IResource getResourceName getResourceName(): stringReturns
stringgetSerializedAnnotation getSerializedAnnotation(annotationId: string): stringParameters
annotationId stringThe stable annotation identifier.Returns
stringhasSerializedAnnotation hasSerializedAnnotation(annotationId: string): booleanParameters
annotationId stringThe stable annotation identifier.Returns
booleanonBeforeResourceStarted(callback: (arg: BeforeResourceStartedEvent) => Promise<void>): IResourceParameters
callback(arg: BeforeResourceStartedEvent) => Promise<void> The callback to invoke when the event fires.Returns
IResource onInitializeResource(callback: (arg: InitializeResourceEvent) => Promise<void>): IResourceParameters
callback(arg: InitializeResourceEvent) => Promise<void> The callback to invoke when the event fires.Returns
IResource onResourceReady(callback: (arg: ResourceReadyEvent) => Promise<void>): IResourceParameters
callback(arg: ResourceReadyEvent) => Promise<void> The callback to invoke when the event fires.Returns
IResource onResourceStopped(callback: (arg: ResourceStoppedEvent) => Promise<void>): IResourceParameters
callback(arg: ResourceStoppedEvent) => Promise<void> The callback to invoke when the event fires.Returns
IResource subscribeHttpsEndpointsUpdate(callback: (obj: HttpsEndpointUpdateCallbackContext) => Promise<void>): IResourceParameters
callback(obj: HttpsEndpointUpdateCallbackContext) => Promise<void> The callback to invoke when HTTPS is enabled. Receives an `HttpsEndpointUpdateCallbackContext` providing access to the service provider, resource, and application model.Returns
IResource withChildRelationship(child: IResource): IResourceParameters
childIResource The child of `builder`.Returns
IResource withCommand(name: string, displayName: string, executeCommand: (arg: ExecuteCommandContext) => Promise<ExecuteCommandResult>, commandOptions?: CommandOptions): IResourceParameters
namestringThe name of the command. The name uniquely identifies the command.displayName stringThe display name visible in UI.executeCommand (arg: ExecuteCommandContext) => Promise<ExecuteCommandResult> A callback that is executed when the command is executed. The callback is run inside the Aspire host. The callback result is used to indicate success or failure in the UI.commandOptions CommandOptions optionalOptional configuration for the command.Returns
IResource withContainerBuildOptions(callback: (arg: ContainerBuildOptionsCallbackContext) => Promise<void>): IResourceParameters
callback(arg: ContainerBuildOptionsCallbackContext) => Promise<void> An async callback to configure container build options.Returns
IResource withContainerRegistry(registry: IResource): IResourceParameters
registryIResource The container registry resource builder.Returns
IResource withDisplayOrder(order: number): IResourceParameters
ordernumberA relative sort key. Higher values appear first, consistent with `DisplayOrder`. Resources without a display order are treated as having an order of 0, so a negative value moves a resource after them.Returns
IResource withDockerfileBaseImage( buildImage?: string, runtimeImage?: string): IResourceParameters
buildImage stringoptionalThe base image to use for the build stage. If null, uses the default build image.runtimeImage stringoptionalThe base image to use for the runtime stage. If null, uses the default runtime image.Returns
IResource withExplicitStart(): IResourceReturns
IResource withHealthCheck(key: string): IResourceParameters
keystringThe key for the health check.Returns
IResource withIconName( iconName: string, iconVariant?: IconVariant): IResourceParameters
iconName stringThe name of the FluentUI icon to use. See https://aka.ms/fluentui-system-icons for available icons.iconVariant IconVariant optional= FilledThe variant of the icon (Regular or Filled). Defaults to Filled.Returns
IResource withLifetimeOf(sourceBuilder: IResource): IResourceParameters
sourceBuilder IResource The resource builder whose lifetime should be used.Returns
IResource withParentProcessLifetime(parentProcessId: number): IResourceParameters
parentProcessId numberThe ID of the parent process to monitor.Returns
IResource withParentRelationship(parent: IResource): IResourceParameters
parentIResource The parent of `builder`.Returns
IResource withPersistentLifetime(): IResourceReturns
IResource withPipelineConfiguration(callback: (obj: PipelineConfigurationContext) => Promise<void>): IResourceParameters
callback(obj: PipelineConfigurationContext) => Promise<void> The callback function to execute during the configuration phase.Returns
IResource withPipelineStepFactory(stepName: string, callback: (arg: PipelineStepContext) => Promise<void>, dependsOn?: string[], requiredBy?: string[], tags?: string[], description?: string): IResourceParameters
stepName stringThe unique name of the pipeline step.callback(arg: PipelineStepContext) => Promise<void> The callback to execute when the step runs.dependsOn string[]optionalOptional step names that this step depends on.requiredBy string[]optionalOptional step names that require this step.tagsstring[]optionalOptional tags that categorize this step.descriptionstringoptionalAn optional human-readable description of the step.Returns
IResource withProcessCommand( commandName: string, displayName: string, options: ProcessCommandExportOptions): IResourceParameters
commandName stringdisplayName stringoptionsProcessCommandExportOptions Returns
IResource withProcessCommandFactory(commandName: string, displayName: string, createProcessSpec: (arg: ExecuteCommandContext) => Promise<ProcessCommandSpecExportData>, options?: ProcessCommandResultExportOptions): IResourceParameters
commandName stringdisplayName stringcreateProcessSpec (arg: ExecuteCommandContext) => Promise<ProcessCommandSpecExportData> optionsProcessCommandResultExportOptions optionalReturns
IResource withRelationship( resourceBuilder: IResource, type: string): IResourceParameters
resourceBuilder IResource The resource builder that the relationship is to.typestringThe relationship type.Returns
IResource withRequiredCommand( command: string, helpLink?: string): IResourceParameters
commandstringThe command string (file name or path) that should be validated.helpLink stringoptionalAn optional help link URL to guide users when the command is missing.Returns
IResource withRequiredCommandValidation(command: string, validationCallback: (arg: RequiredCommandValidationContext) => Promise<RequiredCommandValidationResult>, helpLink?: string): IResourceParameters
commandstringThe command string (file name or path) that should be validated.validationCallback (arg: RequiredCommandValidationContext) => Promise<RequiredCommandValidationResult> A callback that validates the resolved command path. Receives a `RequiredCommandValidationContext` and returns a `RequiredCommandValidationResult`.helpLink stringoptionalAn optional help link URL to guide users when the command is missing or fails validation.Returns
IResource withResourceTypeDisplayName(resourceTypeDisplayName: string): IResourceParameters
resourceTypeDisplayName stringThe type label, such as Redis or PostgreSQL Server.Returns
IResource withSerializedAnnotation withSerializedAnnotation( annotationId: string, json: string): IResourceParameters
annotationId stringThe stable annotation identifier.jsonstringThe serialized JSON payload.Returns
IResource withSessionLifetime(): IResourceReturns
IResource withTerminal(configure?: (obj: TerminalOptions) => Promise<void>): IResourceParameters
configure(obj: TerminalOptions) => Promise<void> optionalAn optional callback to configure the terminal options.Returns
IResource withTrait( name: string, value: string): IResourceParameters
namestringThe case-sensitive trait name.valuestringThe trait value. Do not include secrets.Returns
IResource withUrl( url: string | ReferenceExpression, displayText?: string): IResourceParameters
urlstring | ReferenceExpression displayText stringoptionalReturns
IResource withUrlForEndpoint(endpointName: string, callback: (obj: ResourceUrlAnnotation) => Promise<void>): IResourceParameters
endpointName stringThe name of the endpoint to customize the URL for.callback(obj: ResourceUrlAnnotation) => Promise<void> The callback that will customize the URL.Returns
IResource withUrls(callback: (obj: ResourceUrlsCallbackContext) => Promise<void>): IResourceParameters
callback(obj: ResourceUrlsCallbackContext) => Promise<void> The callback that will customize URLs for the resource.Returns
IResource