withCommand
Method
interface ContainerResource { // ... omitted for brevity withCommand( name: string, displayName: string, executeCommand: callback, commandOptions?: CommandOptions): IResource;}Signature
method
withCommand builderAdds a resource command
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 Applies to
This method applies to the following types: