DistributedApplicationBuilder
A builder for creating instances of Distributed.
type DistributedApplicationBuilder interface{}Properties
AppHostDirectory stringgetAppHostDirectory() (string, error)EnvironmentHostEnvironment getEnvironment() HostEnvironmentEventingDistributedApplicationEventing getEventing() DistributedApplicationEventingExecutionContext DistributedApplicationExecutionContext getExecutionContext() DistributedApplicationExecutionContextPipelineDistributedApplicationPipeline getPipeline() DistributedApplicationPipelineUserSecretsManager UserSecretsManager getUserSecretsManager() UserSecretsManagerMethods
AddConnectionString( name string, options ...*AddConnectionStringOptions,) ResourceWithConnectionStringParameters
namestringoptions...*AddConnectionStringOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddConnectionStringOptions argument.
EnvironmentVariableNameOrExpression anyReturns
ResourceWithConnectionString Returns a handle; failures surface later via Err().
AddContainer( name string, image any,) ContainerResourceParameters
namestringThe name of the resource.imageanyThe image name or image options for the container.Returns
ContainerResource The resource builder.
Returns a handle; failures surface later via Err().
AddContainerRegistry( name string, endpoint any, options ...*AddContainerRegistryOptions,) ContainerRegistryResourceParameters
namestringendpointanyoptions...*AddContainerRegistryOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddContainerRegistryOptions argument.
RepositoryanyReturns
ContainerRegistryResource Returns a handle; failures surface later via Err().
AddCSharpApp( name string, path string, options ...*AddCSharpAppOptions,) CSharpAppResourceParameters
namestringpathstringoptions...*AddCSharpAppOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddCSharpAppOptions argument.
Options*ProjectResourceOptions Returns
CSharpAppResource Returns a handle; failures surface later via Err().
AddDockerfile( name string, contextPath string, options ...*AddDockerfileOptions,) ContainerResourceParameters
namestringThe name of the resource.contextPath stringPath to be used as the context for the container image build.options...*AddDockerfileOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddDockerfileOptions argument.
DockerfilePath *stringPath to the Dockerfile relative to the contextPath . Defaults to "Dockerfile" if not specified.Stage*stringThe stage representing the image to be published in a multi-stage Dockerfile.Returns
ContainerResource The resource builder.
Returns a handle; failures surface later via Err().
AddDockerfileBuilder( name string, contextPath string, callback func(arg DockerfileBuilderCallbackContext), options ...*AddDockerfileBuilderOptions,) ContainerResourceParameters
namestringThe name of the resource.contextPath stringPath to be used as the context for the container image build.callbackfunc(arg DockerfileBuilderCallbackContext) callbackA callback that uses the DockerfileBuilder API to construct the Dockerfile.options...*AddDockerfileBuilderOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddDockerfileBuilderOptions argument.
Stage*stringThe stage representing the image to be published in a multi-stage Dockerfile.Returns
ContainerResource The resource builder.
Returns a handle; failures surface later via Err().
AddDockerfileFactory( name string, contextPath string, dockerfileFactory func(arg DockerfileFactoryContext) string, options ...*AddDockerfileFactoryOptions,) ContainerResourceParameters
namestringThe name of the resource.contextPath stringPath to be used as the context for the container image build.dockerfileFactory func(arg DockerfileFactoryContext) string callbackAn asynchronous function that returns the Dockerfile content as a string.options...*AddDockerfileFactoryOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddDockerfileFactoryOptions argument.
Stage*stringThe stage representing the image to be published in a multi-stage Dockerfile.Returns
ContainerResource The resource builder.
Returns a handle; failures surface later via Err().
AddDotnetTool( name string, packageId string,) DotnetToolResourceParameters
namestringThe name of the resource.packageId stringThe package id of the tool.Returns
DotnetToolResource The resource builder.
Returns a handle; failures surface later via Err().
AddEventingSubscriber AddEventingSubscriber(subscribe func(arg EventingSubscriberRegistrationContext)) errorParameters
subscribefunc(arg EventingSubscriberRegistrationContext) callbackThe callback that registers the event subscriptions.Returns
errorReturns error.
AddExecutable( name string, command string, workingDirectory string, args []string,) ExecutableResourceParameters
namestringThe name of the resource.commandstringThe executable path. This can be a fully qualified path or a executable to run from the shell/command line.workingDirectory stringThe working directory of the executable.args[]string The arguments to the executable.Returns
ExecutableResource The resource builder.
Returns a handle; failures surface later via Err().
AddExternalService( name string, url any,) ExternalServiceResourceParameters
namestringurlanyReturns
ExternalServiceResource Returns a handle; failures surface later via Err().
AddHealthCheck AddHealthCheck( name string, check func(...any) *HealthCheckResult,) errorParameters
namestringThe health check registration name.checkfunc(...any) *HealthCheckResult callbackThe callback that evaluates the health check.Returns
errorReturns error.
AddParameter( name string, options ...*AddParameterOptions,) ParameterResourceParameters
namestringoptions...*AddParameterOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddParameterOptions argument.
Value*stringPublishValueAsDefault *boolSecret*boolReturns
ParameterResource Returns a handle; failures surface later via Err().
AddParameterFromConfiguration( name string, configurationKey string, options ...*AddParameterFromConfigurationOptions,) ParameterResourceParameters
namestringName of parameter resourceconfigurationKey stringConfiguration key used to get the value of the parameteroptions...*AddParameterFromConfigurationOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddParameterFromConfigurationOptions argument.
Secret*boolOptional flag indicating whether the parameter should be regarded as secret.Returns
ParameterResource Resource builder for the parameter.
Returns a handle; failures surface later via Err().
AddParameterWithGeneratedValue( name string, value *GenerateParameterDefault, options ...*AddParameterWithGeneratedValueOptions,) ParameterResourceParameters
namestringvalue*GenerateParameterDefault options...*AddParameterWithGeneratedValueOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddParameterWithGeneratedValueOptions argument.
Secret*boolPersist*boolReturns
ParameterResource Returns a handle; failures surface later via Err().
AddProject( name string, projectPath string, options ...*AddProjectOptions,) ProjectResourceParameters
namestringprojectPath stringoptions...*AddProjectOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*AddProjectOptions argument.
LaunchProfileOrOptions anyReturns
ProjectResource Returns a handle; failures surface later via Err().
BuildBuild() (DistributedApplication, error)Returns
(DistributedApplication, error) A new Distributed instance.
Returns (DistributedApplication, error).
GetConfiguration GetConfiguration() ConfigurationReturns
ConfigurationThe configuration handle.
Returns a handle; failures surface later via Err().
SubscribeAfterPublish SubscribeAfterPublish(callback func(arg AfterPublishEvent)) DistributedApplicationEventSubscriptionParameters
callbackfunc(arg AfterPublishEvent) callbackA callback that receives the exported event when the event fires.Returns
DistributedApplicationEventSubscription A subscription handle that can be used to unsubscribe.
Returns a handle; failures surface later via Err().
SubscribeAfterResourcesCreated(callback func(arg AfterResourcesCreatedEvent)) DistributedApplicationEventSubscriptionParameters
callbackfunc(arg AfterResourcesCreatedEvent) callbackA callback that receives the exported event when the event fires.Returns
DistributedApplicationEventSubscription A subscription handle that can be used to unsubscribe.
Returns a handle; failures surface later via Err().
SubscribeBeforePublish SubscribeBeforePublish(callback func(arg BeforePublishEvent)) DistributedApplicationEventSubscriptionParameters
callbackfunc(arg BeforePublishEvent) callbackA callback that receives the exported event when the event fires.Returns
DistributedApplicationEventSubscription A subscription handle that can be used to unsubscribe.
Returns a handle; failures surface later via Err().
SubscribeBeforeStart SubscribeBeforeStart(callback func(arg BeforeStartEvent)) DistributedApplicationEventSubscriptionParameters
callbackfunc(arg BeforeStartEvent) callbackA callback that receives the exported event when the event fires.Returns
DistributedApplicationEventSubscription A subscription handle that can be used to unsubscribe.
Returns a handle; failures surface later via Err().
TryAddEventingSubscriber TryAddEventingSubscriber(subscribe func(arg EventingSubscriberRegistrationContext)) errorParameters
subscribefunc(arg EventingSubscriberRegistrationContext) callbackThe callback that registers the event subscriptions.Returns
errorReturns error.
WithOutputDiffing WithOutputDiffing(options ...*WithOutputDiffingOptions) DistributedApplicationBuilderParameters
options...*WithOutputDiffingOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*WithOutputDiffingOptions argument.
TargetStep *stringThe step whose completed output is compared. Defaults to publish.DiffStepName *stringThe comparison target name. When null, uses the target name followed by -and-diff .Description*stringAn optional description of the comparison target.Returns
DistributedApplicationBuilder The I for chaining.
Returns a handle; failures surface later via Err().
Applies to
This interface applies to the following types: