Aspire.Hosting
Official
📦 Aspire.Hostingv17.0.0Import path
apphost/modules/aspire247Functions
160Types
160 types, 247 functions and 222 members
Handles
handle
AfterPublishEvent2 membershandle
AfterResourcesCreatedEvent2 membersinterface
AspireStore2 membershandle
BeforePublishEvent2 membershandle
BeforeResourceStartedEvent2 membershandle
BeforeStartEvent2 membershandle
CommandLineArgsCallbackContext4 membershandle
CommandLineArgsEditor2 membersinterface
ComputeEnvironmentResourcemarkerinterface
Configuration5 membersinterface
ConfigurationSectionmarkerhandle
ConnectionStringAvailableEvent2 membershandle
ContainerBuildOptionsCallbackContext11 membershandle
ContainerFileSystemCallbackContext5 membershandle
ContainerFileSystemItemhandle
ContainerImagePushOptions2 membershandle
ContainerImagePushOptionsCallbackContext3 membershandle
ContainerImageReference2 membershandle
ContainerMountAnnotation4 membershandle
ContainerPortReference2 membershandle
ContainerRegistryResourcehandle
ContainerResource22 membershandle
CSharpAppResourcehandle
DistributedApplication1 membersinterface
DistributedApplicationBuilder30 membersinterface
DistributedApplicationEventmarkerinterface
DistributedApplicationEventing1 membershandle
DistributedApplicationEventSubscriptionhandle
DistributedApplicationExecutionContext7 membershandle
DistributedApplicationExecutionContextOptionshandle
DistributedApplicationModel2 membersinterface
DistributedApplicationPipeline3 membersinterface
DistributedApplicationResourceEventmarkerhandle
DistributedApplicationResourceEventSubscriptionhandle
DockerfileBuilder3 membershandle
DockerfileBuilderCallbackContext4 membershandle
DockerfileFactoryContext1 membershandle
DockerfileStage14 membersinterface
DotnetProgramResourcemarkerhandle
DotnetToolResource6 membershandle
EndpointReference20 membershandle
EndpointReferenceExpression3 membershandle
EndpointUpdateContext11 membershandle
EnvironmentCallbackContext4 membershandle
EnvironmentEditor1 membershandle
EventingSubscriberRegistrationContext6 membershandle
ExecutableResource5 membershandle
ExecuteCommandContext5 membersinterface
ExecutionConfigurationBuilder5 membersinterface
ExecutionConfigurationResult2 membersinterface
ExpressionValuemarkerhandle
ExternalServiceResource1 membersinterface
HostEnvironment4 membershandle
HttpCommandPrepareRequestContext4 membershandle
HttpsCertificateConfigurationCallbackAnnotationContext9 membershandle
HttpsEndpointUpdateCallbackContext4 membershandle
IComputeResource4 membershandle
IContainerFilesDestinationResource1 membershandle
InitializeResourceEvent5 membershandle
InputsDialogValidationContext4 membershandle
InputsInteractionResult2 membershandle
InteractionInputBuilder4 membershandle
InteractionInputCollection5 membershandle
InteractionInputLoadContext2 membershandle
InteractionLoadingInput3 membersinterface
InteractionService13 membershandle
LogFacade4 membersinterface
Logger5 membersinterface
LoggerFactory1 membershandle
ParameterResource6 membershandle
PipelineConfigurationContext3 membershandle
PipelineContext6 membershandle
PipelineEditor2 membershandle
PipelineStep8 membershandle
PipelineStepContext8 membershandle
PipelineStepFactoryContext2 membershandle
PipelineSummary2 membershandle
ProgressContext1 membershandle
ProjectResource5 membershandle
ProjectResourceOptions3 membershandle
ReferenceExpressionBuilder5 membersinterface
ReportingStep6 membersinterface
ReportingTask4 membershandle
RequiredCommandValidationContext5 membershandle
RequiredCommandValidationResult2 membersinterface
Resourcemarker42 membershandle
ResourceCommandService1 membershandle
ResourceEndpointsAllocatedEvent2 membershandle
ResourceLoggerService2 membershandle
ResourceNotificationService6 membershandle
ResourceReadyEvent2 membershandle
ResourceStoppedEvent2 membershandle
ResourceUrlsCallbackContext5 membershandle
ResourceUrlsEditor3 membersinterface
ResourceWithArgsmarker4 membersinterface
ResourceWithConnectionString3 membersinterface
ResourceWithContainerFiles2 membersinterface
ResourceWithEndpointsmarker15 membersinterface
ResourceWithEnvironmentmarker10 membersinterface
ResourceWithParentmarkerinterface
ResourceWithWaitSupportmarker3 membersinterface
ServiceProvider9 membershandle
UpdateCommandStateContext2 membersinterface
UserSecretsManager6 membersDTOs
struct
AddContainerOptions2 fieldsstruct
BoolInteractionResult2 fieldsstruct
CertificateTrustExecutionConfigurationContext4 fieldsstruct
CertificateTrustExecutionConfigurationExportData3 fieldsstruct
CommandOptions11 fieldsstruct
CommandProgressOptions3 fieldsstruct
CommandResultData3 fieldsstruct
ContainerFilesOptions3 fieldsstruct
CreateBuilderOptions8 fieldsstruct
CreateInteractionInputOptions12 fieldsstruct
DynamicLoadingOptions2 fieldsstruct
ExecuteCommandResult5 fieldsstruct
GenerateParameterDefault9 fieldsstruct
HealthCheckResult3 fieldsstruct
HttpCommandExportOptions11 fieldsstruct
HttpCommandRequestExportData4 fieldsstruct
HttpsCertificateExecutionConfigurationContext4 fieldsstruct
HttpsCertificateExecutionConfigurationExportData8 fieldsstruct
HttpsCertificateInfo3 fieldsstruct
InputInteractionResult2 fieldsstruct
InteractionChoiceOption2 fieldsstruct
InteractionInput15 fieldsstruct
InteractionInputsDialogOptions6 fieldsstruct
InteractionMessageBoxOptions6 fieldsstruct
InteractionNotificationOptions8 fieldsstruct
InteractionProgressOptions4 fieldsstruct
ParameterCustomInputOptions10 fieldsstruct
ProcessCommandExportOptions12 fieldsstruct
ProcessCommandResultExportOptions4 fieldsstruct
ProcessCommandSpecExportData7 fieldsstruct
ReferenceEnvironmentInjectionOptions4 fieldsstruct
ResourceEventDto6 fieldsstruct
ResourceUrlAnnotation5 fieldsstruct
RunConfiguration1 fieldsstruct
TerminalOptions2 fieldsstruct
UpdateCommandStateResourceSnapshot5 fieldsEnums
enum
CertificateTrustScope4 valuesenum
CommandResultFormat3 valuesenum
ContainerImageDestination2 valuesenum
ContainerImageFormat2 valuesenum
ContainerLifetime2 valuesenum
ContainerMountType2 valuesenum
ContainerTargetPlatform7 valuesenum
DistributedApplicationOperation2 valuesenum
EndpointProperty10 valuesenum
HttpCommandResultMode4 valuesenum
IconVariant2 valuesenum
ImagePullPolicy4 valuesenum
InputType6 valuesenum
MessageIntent6 valuesenum
OtlpProtocol3 valuesenum
ProbeType3 valuesenum
ResourceCommandState3 valuesenum
ResourceCommandVisibility3 valuesenum
UrlDisplayLocation2 valuesenum
WaitBehavior2 valuesFunctions
Package functions
Configuration
method
ExistsChecks whether a configuration section exists.
Exists(key string) (bool, error)method
GetChildrenGets the child sections of a configuration handle.
GetChildren() ([]ConfigurationSection, error)method
GetConfigValueGets a configuration value by key.
GetConfigValue(key string) (*string, error)method
GetConnectionStringGets a connection string by name.
GetConnectionString(name string) (*string, error)method
GetSectionGets a configuration section by key.
GetSection(key string) ConfigurationSectionContainerFileSystemCallbackContext
method
CreateCertificateFileCreates a PEM container certificate file entry with the OpenSSL subject-hash symlink.
CreateCertificateFile(name string, options ...*CreateCertificateFileOptions) ContainerFileSystemItemmethod
CreateDirectoryCreates a container directory entry containing the specified child entries.
CreateDirectory(name string, entries []ContainerFileSystemItem, options ...*CreateDirectoryOptions) ContainerFileSystemItemmethod
CreateFileCreates a container file entry with inline contents or a host source path.
CreateFile(name string, options ...*CreateFileOptions) ContainerFileSystemItemContainerResource
method
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
WithBindMountbuilderAdds a bind mount to a container resource.
WithBindMount(source string, target string, options ...*WithBindMountOptions) ContainerResourcemethod
WithBuildArgbuilderAdds a build argument when the container is built from a Dockerfile.
WithBuildArg(name string, value any) ContainerResourcemethod
WithBuildSecretbuilderAdds a secret build argument when the container is built from a Dockerfile.
WithBuildSecret(name string, value ParameterResource) ContainerResourcemethod
WithContainerCertificatePathsbuilderAdds container certificate path overrides used for certificate trust at run time.
WithContainerCertificatePaths(options ...*WithContainerCertificatePathsOptions) ContainerResourcemethod
WithContainerFilesbuilderCreates or updates files and folders in a container by copying them from a source path on the host.
WithContainerFiles(destinationPath string, sourcePath string, options ...*ContainerFilesOptions) ContainerResourcemethod
WithContainerFilesCallbackbuilderCreates or updates files and/or folders at the destination path in the container using entries produced by a callback.
WithContainerFilesCallback(destinationPath string, callback func(arg1 ContainerFileSystemCallbackContext, arg2 *CancellationToken) []ContainerFileSystemItem, options ...*ContainerFilesOptions) ContainerResourcemethod
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
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
WithDockerfilebuilderCauses Aspire to build the specified container image from a Dockerfile.
WithDockerfile(contextPath string, options ...*WithDockerfileOptions) ContainerResourcemethod
WithDockerfileBuilderbuilderConfigures the resource to use a programmatically generated Dockerfile
WithDockerfileBuilder(contextPath string, callback func(arg DockerfileBuilderCallbackContext), options ...*WithDockerfileBuilderOptions) ContainerResourcemethod
WithDockerfileFactorybuilderBuilds the specified container image from a Dockerfile generated by an asynchronous factory function.
WithDockerfileFactory(contextPath string, dockerfileFactory func(arg DockerfileFactoryContext) string, options ...*WithDockerfileFactoryOptions) ContainerResourcemethod
WithEntrypointbuilderSets the Entrypoint for the container.
WithEntrypoint(entrypoint string) ContainerResourcemethod
WithImagebuilderAllows overriding the image on a container.
WithImage(image string, options ...*WithImageOptions) ContainerResourcemethod
WithImagePullPolicybuilderSets the pull policy for the container resource.
WithImagePullPolicy(pullPolicy ImagePullPolicy) ContainerResourcemethod
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
WithVolumebuilderAdds a volume to a container resource.
WithVolume(target string, options ...*WithVolumeOptions) ContainerResourceDistributedApplicationBuilder
method
AddConnectionStringbuilderAdds a connection string resource
AddConnectionString(name string, options ...*AddConnectionStringOptions) ResourceWithConnectionStringmethod
AddContainerbuilderAdds a container resource to the application.
AddContainer(name string, image any) ContainerResourcemethod
AddContainerRegistrybuilderAdds a container registry resource
AddContainerRegistry(name string, endpoint any, options ...*AddContainerRegistryOptions) ContainerRegistryResourcemethod
AddCSharpAppbuilderAdds a C# application resource
AddCSharpApp(name string, path string, options ...*AddCSharpAppOptions) CSharpAppResourcemethod
AddDockerfilebuilderAdds a Dockerfile to the application model that can be treated like a container resource.
AddDockerfile(name string, contextPath string, options ...*AddDockerfileOptions) ContainerResourcemethod
AddDockerfileBuilderbuilderAdds a container resource built from a programmatically generated Dockerfile
AddDockerfileBuilder(name string, contextPath string, callback func(arg DockerfileBuilderCallbackContext), options ...*AddDockerfileBuilderOptions) 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 func(arg DockerfileFactoryContext) string, options ...*AddDockerfileFactoryOptions) 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 func(arg EventingSubscriberRegistrationContext)) errormethod
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 any) ExternalServiceResourcemethod
AddHealthCheckAdds a custom health check callback to the distributed-application builder.
AddHealthCheck(name string, check func(...any) *HealthCheckResult) errormethod
AddParameterbuilderAdds a parameter resource
AddParameter(name string, options ...*AddParameterOptions) ParameterResourcemethod
AddParameterFromConfigurationbuilderAdds a parameter resource to the application, with a value coming from configuration.
AddParameterFromConfiguration(name string, configurationKey string, options ...*AddParameterFromConfigurationOptions) ParameterResourcemethod
AddParameterWithGeneratedValuebuilderAdds a parameter with a generated default value
AddParameterWithGeneratedValue(name string, value *GenerateParameterDefault, options ...*AddParameterWithGeneratedValueOptions) ParameterResourcemethod
AddProjectbuilderAdds a .NET project resource
AddProject(name string, projectPath string, options ...*AddProjectOptions) ProjectResourcemethod
GetConfigurationGets the application configuration.
GetConfiguration() Configurationmethod
SubscribeAfterPublishSubscribes to the AfterPublish event, which fires after the application is published.
SubscribeAfterPublish(callback func(arg AfterPublishEvent)) DistributedApplicationEventSubscriptionmethod
SubscribeAfterResourcesCreatedSubscribes to the AfterResourcesCreated event, which fires after all resources are created.
SubscribeAfterResourcesCreated(callback func(arg AfterResourcesCreatedEvent)) DistributedApplicationEventSubscriptionmethod
SubscribeBeforePublishSubscribes to the BeforePublish event, which fires before the application is published.
SubscribeBeforePublish(callback func(arg BeforePublishEvent)) DistributedApplicationEventSubscriptionmethod
SubscribeBeforeStartSubscribes to the BeforeStart event, which fires before the application starts.
SubscribeBeforeStart(callback func(arg BeforeStartEvent)) DistributedApplicationEventSubscriptionmethod
TryAddEventingSubscriberAttempts to add an ATS-friendly eventing subscriber callback to the distributed-application builder.
TryAddEventingSubscriber(subscribe func(arg EventingSubscriberRegistrationContext)) errormethod
WithOutputDiffingAdds an opt-in target that checks for stale generated pipeline output.
WithOutputDiffing(options ...*WithOutputDiffingOptions) DistributedApplicationBuilderDistributedApplicationModel
DistributedApplicationPipeline
method
AddStepAdds an application-level pipeline step in a TypeScript-friendly shape.
AddStep(stepName string, callback func(arg PipelineStepContext), options ...*AddStepOptions) errormethod
ConfigureRegisters a pipeline configuration callback in a TypeScript-friendly shape.
Configure(callback func(arg PipelineConfigurationContext)) errormethod
DisableBuildOnlyContainerValidationDisables the publish and deploy validation that requires build-only containers to be consumed by another resource.
DisableBuildOnlyContainerValidation() DistributedApplicationPipelineDockerfileBuilder
method
AddContainerFilesStagesAdds Dockerfile stages for published container files
AddContainerFilesStages(resource Resource, options ...*AddContainerFilesStagesOptions) DockerfileBuildermethod
ArgAdds a global ARG statement to the Dockerfile
Arg(name string, options ...*ArgOptions) DockerfileBuildermethod
FromAdds a FROM statement to start a Dockerfile stage
From(image string, options ...*FromOptions) DockerfileStageDockerfileStage
method
AddContainerFilesAdds COPY --from statements for published container files
AddContainerFiles(resource Resource, rootDestinationPath string, options ...*AddContainerFilesOptions) DockerfileStagemethod
ArgAdds an ARG statement to a Dockerfile stage
Arg(name string, options ...*ArgOptions) DockerfileStagemethod
CmdAdds a CMD statement to a Dockerfile stage
Cmd(command []string) DockerfileStagemethod
CommentAdds a comment to a Dockerfile stage
Comment(comment string) DockerfileStagemethod
CopyAdds a COPY statement to a Dockerfile stage
Copy(source string, destination string, options ...*CopyOptions) DockerfileStagemethod
CopyFromAdds a COPY --from statement to a Dockerfile stage
CopyFrom(from string, source string, destination string, options ...*CopyFromOptions) DockerfileStagemethod
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
ExposeAdds an EXPOSE statement to a Dockerfile stage
Expose(port float64) DockerfileStagemethod
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
UserAdds a USER statement to a Dockerfile stage
User(user string) DockerfileStagemethod
WorkDirAdds a WORKDIR statement to a Dockerfile stage
WorkDir(path string) DockerfileStageDotnetToolResource
method
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) DotnetToolResourceEventingSubscriberRegistrationContext
method
OnAfterPublishSubscribes to the AfterPublish event from an eventing subscriber registration context.
OnAfterPublish(callback func(arg AfterPublishEvent)) DistributedApplicationEventSubscriptionmethod
OnAfterResourcesCreatedSubscribes to the AfterResourcesCreated event from an eventing subscriber registration context.
OnAfterResourcesCreated(callback func(arg AfterResourcesCreatedEvent)) DistributedApplicationEventSubscriptionmethod
OnBeforePublishSubscribes to the BeforePublish event from an eventing subscriber registration context.
OnBeforePublish(callback func(arg BeforePublishEvent)) DistributedApplicationEventSubscriptionmethod
OnBeforeStartSubscribes to the BeforeStart event from an eventing subscriber registration context.
OnBeforeStart(callback func(arg BeforeStartEvent)) DistributedApplicationEventSubscriptionExecutableResource
method
PublishAsDockerFilebuilderPublishes an executable as a Docker file
PublishAsDockerFile(configure func(obj ContainerResource)) ExecutableResourcemethod
WithExecutableCommandbuilderSets the command for the executable resource.
WithExecutableCommand(command string) ExecutableResourcemethod
WithExecutableDebugSupportbuilderAdds VS Code-compatible debug metadata for an executable resource.
WithExecutableDebugSupport(launchConfigurationType string, scriptPath string, options ...*WithExecutableDebugSupportOptions) ExecutableResourcemethod
WithVolumebuilderAdds a volume to an executable resource.
WithVolume(target string, name string, env string, options ...*ExecutableResourceWithVolumeOptions) ExecutableResourcemethod
WithWorkingDirectorybuilderSets the working directory for the executable resource.
WithWorkingDirectory(workingDirectory string) ExecutableResourceExecutionConfigurationBuilder
method
BuildBuilds the execution configuration for the specified builder.
Build(executionContext DistributedApplicationExecutionContext, options ...*BuildOptions) ExecutionConfigurationResultmethod
WithArgumentsConfigAdds a command line arguments configuration gatherer to the builder.
WithArgumentsConfig() ExecutionConfigurationBuildermethod
WithCertificateTrustConfigAdds a certificate trust configuration gatherer to the builder.
WithCertificateTrustConfig(configContextFactory func(arg CertificateTrustScope) *CertificateTrustExecutionConfigurationContext) ExecutionConfigurationBuildermethod
WithEnvironmentVariablesConfigAdds an environment variables configuration gatherer to the builder.
WithEnvironmentVariablesConfig() ExecutionConfigurationBuildermethod
WithHttpsCertificateConfigAdds an HTTPS certificate configuration gatherer using certificate metadata instead of a raw X509 certificate.
WithHttpsCertificateConfig(configContextFactory func(arg *HttpsCertificateInfo) *HttpsCertificateExecutionConfigurationContext) ExecutionConfigurationBuilderExecutionConfigurationResult
method
GetCertificateTrustDataGets certificate trust execution-configuration data when present.
GetCertificateTrustData() (*CertificateTrustExecutionConfigurationExportData, error)method
GetHttpsCertificateDataGets HTTPS certificate execution-configuration data when present.
GetHttpsCertificateData() (*HttpsCertificateExecutionConfigurationExportData, error)ExternalServiceResource
HostEnvironment
method
IsDevelopmentChecks if the environment is Development.
IsDevelopment() (bool, error)method
IsEnvironmentChecks if the environment matches the specified name.
IsEnvironment(environmentName string) (bool, error)method
IsProductionChecks if the environment is Production.
IsProduction() (bool, error)method
IsStagingChecks if the environment is Staging.
IsStaging() (bool, error)IComputeResource
method
WithComputeEnvironmentbuilderConfigures the compute environment for the compute resource.
WithComputeEnvironment(computeEnvironmentResource ComputeEnvironmentResource) IComputeResourcemethod
WithImagePushOptionsbuilderAdds an asynchronous callback to configure container image push options for the resource.
WithImagePushOptions(callback func(arg ContainerImagePushOptionsCallbackContext)) IComputeResourcemethod
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) IComputeResourceIContainerFilesDestinationResource
InteractionService
method
CreateBooleanInputCreates a boolean (checkbox) input.
CreateBooleanInput(name string, options ...*CreateInteractionInputOptions) InteractionInputBuildermethod
CreateChoiceInputCreates a choice input that selects from a list of options.
CreateChoiceInput(name string, options ...*CreateChoiceInputOptions) InteractionInputBuildermethod
CreateFileInputCreates a file input.
CreateFileInput(name string, options ...*CreateInteractionInputOptions) InteractionInputBuildermethod
CreateNumberInputCreates a numeric input.
CreateNumberInput(name string, options ...*CreateInteractionInputOptions) InteractionInputBuildermethod
CreateSecretInputCreates a secret (masked) text input.
CreateSecretInput(name string, options ...*CreateInteractionInputOptions) InteractionInputBuildermethod
CreateTextInputCreates a single-line text input.
CreateTextInput(name string, options ...*CreateInteractionInputOptions) InteractionInputBuildermethod
IsAvailableGets a value indicating whether the interaction service is available to prompt the user.
IsAvailable() (bool, error)method
PromptConfirmationPrompts the user for confirmation with an OK/Cancel dialog.
PromptConfirmation(title string, message string, options ...*PromptConfirmationOptions) (*BoolInteractionResult, error)method
PromptInputPrompts the user for a single input.
PromptInput(title string, message string, input InteractionInputBuilder, options ...*PromptInputOptions) (*InputInteractionResult, error)method
PromptInputsPrompts the user for multiple inputs.
PromptInputs(title string, message string, inputs []InteractionInputBuilder, options ...*PromptInputsOptions) InputsInteractionResultmethod
PromptMessageBoxPrompts the user with a message box dialog.
PromptMessageBox(title string, message string, options ...*PromptMessageBoxOptions) (*BoolInteractionResult, error)method
PromptNotificationPrompts the user with a notification.
PromptNotification(title string, message string, options ...*PromptNotificationOptions) (*BoolInteractionResult, error)method
PromptProgressDisplays a progress dialog with an indeterminate progress indicator.
PromptProgress(message string, options ...*PromptProgressOptions) (*BoolInteractionResult, error)Logger
method
LogLogs a message with a specified log level.
Log(level string, message string) errormethod
LogDebugLogs a debug message.
LogDebug(message string) errormethod
LogErrorLogs an error message.
LogError(message string) errormethod
LogInformationLogs an information message.
LogInformation(message string) errormethod
LogWarningLogs a warning message.
LogWarning(message string) errorLoggerFactory
ParameterResource
method
AsOptionalbuilderMarks the parameter resource as optional.
AsOptional() ParameterResourcemethod
AsRequiredbuilderMarks the parameter resource as required.
AsRequired() ParameterResourcemethod
WithCustomInputbuilderSets a custom input for the parameter resource from a polyglot AppHost.
WithCustomInput(options *ParameterCustomInputOptions) ParameterResourcemethod
WithDescriptionbuilderSets the description of the parameter resource.
WithDescription(description string, options ...*WithDescriptionOptions) ParameterResourceProjectResource
method
DisableForwardedHeadersbuilderConfigures the project to disable forwarded headers when being published.
DisableForwardedHeaders() ProjectResourcemethod
PublishAsDockerFilebuilderPublishes a project as a Docker file with optional container configuration
PublishAsDockerFile(options ...*PublishAsDockerFileOptions) ProjectResourcemethod
WithEndpointsInEnvironmentbuilderIncludes only the specified project endpoint names in environment-variable injection.
WithEndpointsInEnvironment(endpointNames []string) ProjectResourcemethod
WithReplicasbuilderConfigures how many replicas of the project should be created for the project.
WithReplicas(replicas float64) ProjectResourcemethod
WithVolumebuilderAdds a volume to a project resource.
WithVolume(target string, name string, env string, options ...*ProjectResourceWithVolumeOptions) ProjectResourceReportingStep
method
CompleteStepCompletes the reporting step with plain-text completion text.
CompleteStep(completionText string, options ...*CompleteStepOptions) errormethod
CompleteStepMarkdownCompletes the reporting step with Markdown-formatted completion text.
CompleteStepMarkdown(markdownString string, options ...*CompleteStepMarkdownOptions) errormethod
CreateMarkdownTaskCreates a reporting task with Markdown-formatted status text.
CreateMarkdownTask(markdownString string, options ...*CreateMarkdownTaskOptions) ReportingTaskmethod
CreateTaskCreates a reporting task with plain-text status text.
CreateTask(statusText string, options ...*CreateTaskOptions) ReportingTaskmethod
LogStepLogs a plain-text message for the reporting step.
LogStep(level string, message string) errormethod
LogStepMarkdownLogs a Markdown-formatted message for the reporting step.
LogStepMarkdown(level string, markdownString string) errorReportingTask
method
CompleteTaskCompletes the reporting task with plain-text completion text.
CompleteTask(options ...*CompleteTaskOptions) errormethod
CompleteTaskMarkdownCompletes the reporting task with Markdown-formatted completion text.
CompleteTaskMarkdown(markdownString string, options ...*CompleteTaskMarkdownOptions) errormethod
UpdateTaskUpdates the reporting task with plain-text status text.
UpdateTask(statusText string, options ...*UpdateTaskOptions) errormethod
UpdateTaskMarkdownUpdates the reporting task with Markdown-formatted status text.
UpdateTaskMarkdown(markdownString string, options ...*UpdateTaskMarkdownOptions) errorResource
method
CreateExecutionConfigurationCreates an execution configuration builder for the specified resource.
CreateExecutionConfiguration() ExecutionConfigurationBuildermethod
ExcludeFromManifestbuilderExcludes a resource from being published to the manifest.
ExcludeFromManifest() Resourcemethod
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() Resourcemethod
GetResourceNameGets the name of the resource from a builder.
GetResourceName() (string, error)method
GetSerializedAnnotationGets a serialized ATS annotation payload from a resource.
GetSerializedAnnotation(annotationId string) (string, error)method
HasSerializedAnnotationDetermines whether a resource has a serialized ATS annotation with the specified ID.
HasSerializedAnnotation(annotationId string) (bool, error)method
OnBeforeResourceStartedbuilderSubscribes to the BeforeResourceStarted event.
OnBeforeResourceStarted(callback func(arg BeforeResourceStartedEvent)) Resourcemethod
OnInitializeResourcebuilderSubscribes to the InitializeResource event.
OnInitializeResource(callback func(arg InitializeResourceEvent)) Resourcemethod
OnResourceReadybuilderSubscribes to the ResourceReady event.
OnResourceReady(callback func(arg ResourceReadyEvent)) Resourcemethod
OnResourceStoppedbuilderSubscribes to the ResourceStopped event.
OnResourceStopped(callback func(arg ResourceStoppedEvent)) Resourcemethod
SubscribeHttpsEndpointsUpdatebuilderSubscribes to the
BeforeStartEvent and invokes the specified callback when an HTTPS certificate is determined to be available for the resource. This is used to conditionally update endpoint URI schemes or perform other HTTPS-related configuration at startup.SubscribeHttpsEndpointsUpdate(callback func(obj HttpsEndpointUpdateCallbackContext)) Resourcemethod
WithChildRelationshipbuilderSets a child relationship
WithChildRelationship(child Resource) Resourcemethod
WithCommandbuilderAdds a resource command
WithCommand(name string, displayName string, executeCommand func(arg ExecuteCommandContext) *ExecuteCommandResult, options ...*WithCommandOptions) Resourcemethod
WithContainerBuildOptionsbuilderConfigures container build options for a compute resource using an async callback.
WithContainerBuildOptions(callback func(arg ContainerBuildOptionsCallbackContext)) Resourcemethod
WithContainerRegistrybuilderConfigures the resource to use the specified container registry for container image operations.
WithContainerRegistry(registry Resource) Resourcemethod
WithDisplayOrderbuilderSets the default display order of the resource in lists of resources, such as the dashboard's. A saved ordering takes precedence. Repeated calls replace the order.
WithDisplayOrder(order float64) Resourcemethod
WithDockerfileBaseImagebuilderConfigures custom base images for generated Dockerfiles.
WithDockerfileBaseImage(options ...*WithDockerfileBaseImageOptions) Resourcemethod
WithExplicitStartbuilderPrevents resource from starting automatically
WithExplicitStart() Resourcemethod
WithHealthCheckbuilderAdds a health check by key
WithHealthCheck(key string) Resourcemethod
WithHiddenbuilderHides the resource from default resource lists
WithHidden() Resourcemethod
WithHiddenOnCompletionbuilderHides the resource from default resource lists after successful completion
WithHiddenOnCompletion(options ...*WithHiddenOnCompletionOptions) Resourcemethod
WithIconNamebuilderSpecifies the icon to use when displaying the resource in the dashboard.
WithIconName(iconName string, options ...*WithIconNameOptions) Resourcemethod
WithLifetimeOfbuilderConfigures a resource to match the lifetime of another resource.
WithLifetimeOf(sourceBuilder Resource) Resourcemethod
WithParentProcessLifetimebuilderConfigures a resource to use a persistent lifetime that ends when a parent process exits.
WithParentProcessLifetime(parentProcessId float64) Resourcemethod
WithParentRelationshipbuilderSets the parent relationship
WithParentRelationship(parent Resource) Resourcemethod
WithPersistentLifetimebuilderConfigures a resource to use a persistent lifetime.
WithPersistentLifetime() Resourcemethod
WithPipelineConfigurationbuilderRegisters a callback to be executed during the pipeline configuration phase, allowing modification of step dependencies and relationships.
WithPipelineConfiguration(callback func(obj PipelineConfigurationContext)) Resourcemethod
WithPipelineStepFactorybuilderAdds a pipeline step to the resource that will be executed during deployment.
WithPipelineStepFactory(stepName string, callback func(arg PipelineStepContext), options ...*WithPipelineStepFactoryOptions) Resourcemethod
WithProcessCommandbuilderAdds a command to the resource that starts a local process when invoked.
WithProcessCommand(commandName string, displayName string, options *ProcessCommandExportOptions) Resourcemethod
WithProcessCommandFactorybuilderAdds a command to the resource that starts a local process created by a callback when invoked.
WithProcessCommandFactory(commandName string, displayName string, createProcessSpec func(arg ExecuteCommandContext) *ProcessCommandSpecExportData, options ...*ProcessCommandResultExportOptions) Resourcemethod
WithRelationshipbuilderAdds a relationship to another resource using its builder.
WithRelationship(resourceBuilder Resource, type_ string) Resourcemethod
WithRequiredCommandbuilderDeclares that a resource requires a specific command/executable to be available on the local machine PATH before it can start.
WithRequiredCommand(command string, options ...*WithRequiredCommandOptions) Resourcemethod
WithRequiredCommandValidationbuilderDeclares that a resource requires a specific command/executable to be available on the local machine PATH before it can start, with custom validation logic.
WithRequiredCommandValidation(command string, validationCallback func(arg RequiredCommandValidationContext) RequiredCommandValidationResult, options ...*WithRequiredCommandValidationOptions) Resourcemethod
WithResourceTypeDisplayNamebuilderOverrides the human-readable resource type label.
WithResourceTypeDisplayName(resourceTypeDisplayName string) Resourcemethod
WithSerializedAnnotationStores a serialized ATS annotation payload on a resource, replacing any existing annotation with the same ID.
WithSerializedAnnotation(annotationId string, json string) Resourcemethod
WithSessionLifetimebuilderConfigures a resource to use a session lifetime.
WithSessionLifetime() Resourcemethod
WithTagsbuilderAdds AppHost-defined dashboard tags that users cannot remove. Repeated calls add tags.
WithTags(tags []string) Resourcemethod
WithTerminalbuilderAdds an interactive terminal session to a resource with an optional callback to configure its initial dimensions.
WithTerminal(options ...*WithTerminalOptions) Resourcemethod
WithTraitbuilderAdds immutable, non-sensitive metadata to a resource. Repeated names add multiple values.
WithTrait(name string, value string) Resourcemethod
WithUrlbuilderAdds or modifies displayed URLs
WithUrl(url any, options ...*WithUrlOptions) Resourcemethod
WithUrlForEndpointbuilderRegisters a callback to update the URL displayed for the endpoint with the specified name.
WithUrlForEndpoint(endpointName string, callback func(obj *ResourceUrlAnnotation)) Resourcemethod
WithUrlsbuilderRegisters a callback to customize the URLs displayed for the resource.
WithUrls(callback func(obj ResourceUrlsCallbackContext)) ResourceResourceCommandService
ResourceLoggerService
ResourceNotificationService
method
PublishResourceUpdatePublishes an update for a resource's state.
PublishResourceUpdate(resource Resource, options ...*PublishResourceUpdateOptions) errormethod
TryGetResourceStateTries to get the current state of a resource.
TryGetResourceState(resourceName string) (*ResourceEventDto, error)method
WaitForDependenciesWaits for all dependencies of a resource to be ready.
WaitForDependencies(resource Resource) errormethod
WaitForResourceHealthyWaits for a resource to become healthy.
WaitForResourceHealthy(resourceName string) (*ResourceEventDto, error)method
WaitForResourceStateWaits for a resource to reach a specified state.
WaitForResourceState(resourceName string, options ...*WaitForResourceStateOptions) errormethod
WaitForResourceStatesWaits for a resource to reach one of the specified states.
WaitForResourceStates(resourceName string, targetStates []string) (string, error)ResourceWithArgs
method
WithArgsbuilderAdds arguments to be passed to a resource that supports arguments when it is launched.
WithArgs(args []string) ResourceWithArgsmethod
WithArgsCallbackbuilderAdds a callback to be executed with a list of command-line arguments when a resource is started.
WithArgsCallback(callback func(obj CommandLineArgsCallbackContext)) ResourceWithArgsmethod
WithArgsReplacebuilderReplaces the arguments to be passed to a resource that supports arguments when it is launched.
WithArgsReplace(args []string) ResourceWithArgsmethod
WithCertificateTrustEnvironmentbuilderConfigures environment variables that point to Aspire-managed certificate trust paths.
WithCertificateTrustEnvironment(certificateBundleEnvironmentVariable string, options ...*WithCertificateTrustEnvironmentOptions) ResourceWithArgsResourceWithConnectionString
method
GetConnectionPropertyRetrieves the value of a specified connection property from the resource's connection properties.
GetConnectionProperty(key string) *ReferenceExpressionmethod
OnConnectionStringAvailablebuilderSubscribes to the ConnectionStringAvailable event.
OnConnectionStringAvailable(callback func(arg ConnectionStringAvailableEvent)) ResourceWithConnectionStringmethod
WithConnectionPropertybuilderAdds a connection property annotation to the resource being built.
WithConnectionProperty(name string, value any) ResourceWithConnectionStringResourceWithContainerFiles
method
ClearContainerFilesSourcesbuilderRemoves any container files source annotation from the resource being built.
ClearContainerFilesSources() ResourceWithContainerFilesmethod
WithContainerFilesSourcebuilderAdds a container files source annotation to the resource being built, specifying the path to the container files source.
WithContainerFilesSource(sourcePath string) ResourceWithContainerFilesResourceWithEndpoints
method
AsHttp2ServicebuilderConfigures a resource to mark all endpoints' transport as HTTP/2. This is useful for HTTP/2 services that need prior knowledge.
AsHttp2Service() ResourceWithEndpointsmethod
GetEndpointGets an endpoint reference
GetEndpoint(name string) EndpointReferencemethod
OnResourceEndpointsAllocatedbuilderSubscribes to the ResourceEndpointsAllocated event.
OnResourceEndpointsAllocated(callback func(arg ResourceEndpointsAllocatedEvent)) ResourceWithEndpointsmethod
WithEndpointbuilderAdds a network endpoint
WithEndpoint(options ...*WithEndpointOptions) ResourceWithEndpointsmethod
WithEndpointCallbackbuilderUpdates a named endpoint via callback
WithEndpointCallback(endpointName string, callback func(obj EndpointUpdateContext), options ...*WithEndpointCallbackOptions) ResourceWithEndpointsmethod
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 bool) ResourceWithEndpointsmethod
WithExternalHttpEndpointsbuilderMarks existing http or https endpoints on a resource as external.
WithExternalHttpEndpoints() ResourceWithEndpointsmethod
WithHttpCommandbuilderAdds an HTTP resource command
WithHttpCommand(path string, displayName string, options ...*HttpCommandExportOptions) ResourceWithEndpointsmethod
WithHttpEndpointbuilderAdds an HTTP endpoint
WithHttpEndpoint(options ...*WithHttpEndpointOptions) ResourceWithEndpointsmethod
WithHttpEndpointCallbackbuilderUpdates an HTTP endpoint via callback
WithHttpEndpointCallback(callback func(obj EndpointUpdateContext), options ...*WithHttpEndpointCallbackOptions) ResourceWithEndpointsmethod
WithHttpHealthCheckbuilderAdds a health check to the resource which is mapped to a specific endpoint.
WithHttpHealthCheck(options ...*WithHttpHealthCheckOptions) ResourceWithEndpointsmethod
WithHttpProbebuilderAdds an HTTP health probe to the resource
WithHttpProbe(probeType ProbeType, options ...*WithHttpProbeOptions) ResourceWithEndpointsmethod
WithHttpsEndpointbuilderAdds an HTTPS endpoint
WithHttpsEndpoint(options ...*WithHttpsEndpointOptions) ResourceWithEndpointsmethod
WithHttpsEndpointCallbackbuilderUpdates an HTTPS endpoint via callback
WithHttpsEndpointCallback(callback func(obj EndpointUpdateContext), options ...*WithHttpsEndpointCallbackOptions) ResourceWithEndpointsmethod
WithMcpServerbuilderMarks the resource as hosting a Model Context Protocol (MCP) server on the specified endpoint.
WithMcpServer(options ...*WithMcpServerOptions) ResourceWithEndpointsResourceWithEnvironment
method
WithCertificateTrustScopebuilderSets the certificate trust scope
WithCertificateTrustScope(scope CertificateTrustScope) ResourceWithEnvironmentmethod
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 bool) ResourceWithEnvironmentmethod
WithEnvironmentbuilderSets an environment variable
WithEnvironment(name string, value any) ResourceWithEnvironmentmethod
WithEnvironmentCallbackbuilderAllows for the population of environment variables on a resource.
WithEnvironmentCallback(callback func(arg EnvironmentCallbackContext)) ResourceWithEnvironmentmethod
WithHttpsCertificateConfigurationbuilderAdds a callback that allows configuring the resource to use a specific HTTPS/TLS certificate key pair for server authentication.
WithHttpsCertificateConfiguration(callback func(arg HttpsCertificateConfigurationCallbackAnnotationContext)) ResourceWithEnvironmentmethod
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(options ...*WithHttpsDeveloperCertificateOptions) ResourceWithEnvironmentmethod
WithOtlpExporterbuilderConfigures OTLP telemetry export
WithOtlpExporter(options ...*WithOtlpExporterOptions) ResourceWithEnvironmentmethod
WithoutHttpsCertificatebuilderDisable HTTPS/TLS server certificate configuration for the resource. No HTTPS/TLS termination configuration will be applied.
WithoutHttpsCertificate() ResourceWithEnvironmentmethod
WithReferencebuilderAdds a reference to another resource
WithReference(source any, options ...*WithReferenceOptions) ResourceWithEnvironmentmethod
WithReferenceEnvironmentbuilderConfigures how information is injected into environment variables when the resource references other resources.
WithReferenceEnvironment(options *ReferenceEnvironmentInjectionOptions) ResourceWithEnvironmentResourceWithWaitSupport
method
WaitForbuilderWaits for another resource to be ready
WaitFor(dependency Resource, options ...*WaitForOptions) ResourceWithWaitSupportmethod
WaitForCompletionbuilderWaits for the dependency resource to enter the Exited or Finished state before starting the resource.
WaitForCompletion(dependency Resource, options ...*WaitForCompletionOptions) ResourceWithWaitSupportmethod
WaitForStartbuilderWaits for another resource to start
WaitForStart(dependency Resource, options ...*WaitForStartOptions) ResourceWithWaitSupportServiceProvider
method
GetAspireStoreGets the Aspire store from the service provider.
GetAspireStore() AspireStoremethod
GetDistributedApplicationModelGets the distributed application model from the service provider.
GetDistributedApplicationModel() DistributedApplicationModelmethod
GetEventingGets the distributed application eventing service from the service provider.
GetEventing() DistributedApplicationEventingmethod
GetInteractionServiceGets the interaction service from the service provider.
GetInteractionService() InteractionServicemethod
GetLoggerFactoryGets the logger factory from the service provider.
GetLoggerFactory() LoggerFactorymethod
GetResourceCommandServiceGets the resource command service from the service provider.
GetResourceCommandService() ResourceCommandServicemethod
GetResourceLoggerServiceGets the resource logger service from the service provider.
GetResourceLoggerService() ResourceLoggerServicemethod
GetResourceNotificationServiceGets the resource notification service from the service provider.
GetResourceNotificationService() ResourceNotificationServicemethod
GetUserSecretsManagerGets the user secrets manager from the service provider.
GetUserSecretsManager() UserSecretsManagerUserSecretsManager
method
GetOrSetSecretGets a secret value if it exists in configuration, or sets it to the provided value if it does not.
GetOrSetSecret(resourceBuilder Resource, name string, value string) errormethod
SaveStateJsonSaves state to user secrets from a JSON string.
SaveStateJson(json string, options ...*SaveStateJsonOptions) errorExported values
WellKnownPipelineSteps.BeforeStartstring= "before-start"The step that runs before the application starts.
WellKnownPipelineSteps.Buildstring= "build"The well-known step for building resources.
WellKnownPipelineSteps.BuildPrereqstring= "build-prereq"The prerequisite step that runs before any build operations.
WellKnownPipelineSteps.CheckContainerRuntimestring= "check-container-runtime"The step that checks whether the container runtime (e.g., Docker or Podman) is running. Build steps that need a container runtime should depend on this step.
WellKnownPipelineSteps.Deploystring= "deploy"Aggregation step for all deploy operations. All deploy steps should be required by this step.
WellKnownPipelineSteps.DeployPrereqstring= "deploy-prereq"The prerequisite step that runs before any deploy operations.
WellKnownPipelineSteps.Destroystring= "destroy"Aggregation step for all destroy operations. All destroy steps should be required by this step.
WellKnownPipelineSteps.DestroyPrereqstring= "destroy-prereq"The prerequisite step that runs before any destroy operations.
WellKnownPipelineSteps.Diagnosticsstring= "diagnostics"The diagnostic step that dumps dependency graph information for troubleshooting.
WellKnownPipelineSteps.ProcessParametersstring= "process-parameters"The step that prompts for parameter values before build, publish, or deployment operations.
WellKnownPipelineSteps.Publishstring= "publish"Aggregation step for all publish operations. All publish steps should be required by this step.
WellKnownPipelineSteps.PublishPrereqstring= "publish-prereq"The prerequisite step that runs before any publish operations.
WellKnownPipelineSteps.Pushstring= "push"The meta-step that coordinates all push operations. All push steps should be required by this step.
WellKnownPipelineSteps.PushPrereqstring= "push-prereq"The prerequisite step that runs before any push operations.
WellKnownPipelineSteps.ValidateComputeEnvironmentsstring= "validate-compute-environments"The step that validates compute resources are assigned to unambiguous compute environments.
WellKnownPipelineTags.BuildComputestring= "build-compute"Tag for steps that build compute resources.
WellKnownPipelineTags.DeployComputestring= "deploy-compute"Tag for steps that deploy to compute infrastructure.
WellKnownPipelineTags.ProvisionInfrastructurestring= "provision-infra"Tag for steps that provision infrastructure resources.
WellKnownPipelineTags.PushContainerImagestring= "push-container-image"Tag for steps that push container images to a registry.