IDistributedApplicationBuilder
Interface
interface IDistributedApplicationBuilder { readonly appHostDirectory: string; readonly environment: IHostEnvironment; readonly eventing: IDistributedApplicationEventing; readonly executionContext: DistributedApplicationExecutionContext; readonly pipeline: IDistributedApplicationPipeline; readonly userSecretsManager: IUserSecretsManager; addConnectionString( name: string, environmentVariableNameOrExpression?: ReferenceExpression): IResourceWithConnectionString; addContainer( name: string, image: AddContainerOptions): ContainerResource; addContainerRegistry( name: string, endpoint: ParameterResource, repository?: ParameterResource): ContainerRegistryResource; addCSharpApp( name: string, path: string, options?: ProjectResourceOptions): CSharpAppResource; addDockerfile( name: string, contextPath: string, dockerfilePath?: string, stage?: string): ContainerResource; addDockerfileBuilder(name: string, contextPath: string, callback: (arg: DockerfileBuilderCallbackContext) => Promise<void>, stage?: string): ContainerResource; addDockerfileFactory(name: string, contextPath: string, dockerfileFactory: (arg: DockerfileFactoryContext) => Promise<string>, stage?: string): ContainerResource; addDotnetTool( name: string, packageId: string): DotnetToolResource; addEventingSubscriber(subscribe: (arg: EventingSubscriberRegistrationContext) => Promise<void>): void; addExecutable( name: string, command: string, workingDirectory: string, args: string[]): ExecutableResource; addExternalService( name: string, url: ParameterResource): ExternalServiceResource; addParameter( name: string, value?: string, publishValueAsDefault?: boolean, secret?: boolean): ParameterResource; addParameterFromConfiguration( name: string, configurationKey: string, secret?: boolean): ParameterResource; addParameterWithGeneratedValue( name: string, value: GenerateParameterDefault, secret?: boolean, persist?: boolean): ParameterResource; addProject( name: string, projectPath: string, launchProfileOrOptions?: ProjectResourceOptions): ProjectResource; build(): DistributedApplication; getConfiguration(): IConfiguration; subscribeAfterPublish(callback: (arg: AfterPublishEvent) => Promise<void>): DistributedApplicationEventSubscription; subscribeAfterResourcesCreated(callback: (arg: AfterResourcesCreatedEvent) => Promise<void>): DistributedApplicationEventSubscription; subscribeBeforePublish(callback: (arg: BeforePublishEvent) => Promise<void>): DistributedApplicationEventSubscription; subscribeBeforeStart(callback: (arg: BeforeStartEvent) => Promise<void>): DistributedApplicationEventSubscription; tryAddEventingSubscriber(subscribe: (arg: EventingSubscriberRegistrationContext) => Promise<void>): void;}28 members
Properties
property
appHostDirectorystringgetDirectory of the project where the app host is located. Defaults to the content root if there's no project.
property
environmentIHostEnvironmentgetGets the Environment property
property
eventingIDistributedApplicationEventinggetEventing infrastructure for AppHost lifecycle.
property
executionContextDistributedApplicationExecutionContextgetExecution context for this invocation of the AppHost.
property
pipelineIDistributedApplicationPipelinegetGets the deployment pipeline for this distributed application.
property
userSecretsManagerIUserSecretsManagergetGets the service for managing user secrets.
Methods
Adds a connection string resource
addConnectionString( name: string, environmentVariableNameOrExpression?: ReferenceExpression): IResourceWithConnectionStringParameters
namestringenvironmentVariableNameOrExpressionReferenceExpressionoptionalReturns
IResourceWithConnectionStringAdds a container resource to the application.
addContainer( name: string, image: AddContainerOptions): ContainerResourceParameters
namestringimageAddContainerOptionsReturns
ContainerResourceAdds a container registry resource
addContainerRegistry( name: string, endpoint: ParameterResource, repository?: ParameterResource): ContainerRegistryResourceParameters
namestringendpointParameterResourcerepositoryParameterResourceoptionalReturns
ContainerRegistryResourceAdds a C# application resource
addCSharpApp( name: string, path: string, options?: ProjectResourceOptions): CSharpAppResourceParameters
namestringpathstringoptionsProjectResourceOptionsoptionalReturns
CSharpAppResourceAdds a Dockerfile to the application model that can be treated like a container resource.
addDockerfile( name: string, contextPath: string, dockerfilePath?: string, stage?: string): ContainerResourceParameters
namestringcontextPathstringdockerfilePathstringoptionalstagestringoptionalReturns
ContainerResourceAdds a container resource built from a programmatically generated Dockerfile
addDockerfileBuilder(name: string, contextPath: string, callback: (arg: DockerfileBuilderCallbackContext) => Promise<void>, stage?: string): ContainerResourceParameters
namestringcontextPathstringcallback(arg: DockerfileBuilderCallbackContext) => Promise<void>stagestringoptionalReturns
ContainerResourceAdds 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): ContainerResourceParameters
namestringcontextPathstringdockerfileFactory(arg: DockerfileFactoryContext) => Promise<string>stagestringoptionalReturns
ContainerResourceAdds a .NET tool resource to the application model.
addDotnetTool( name: string, packageId: string): DotnetToolResourceParameters
namestringpackageIdstringReturns
DotnetToolResourcemethod
addEventingSubscriberAdds an ATS-friendly eventing subscriber callback to the distributed-application builder.
addEventingSubscriber(subscribe: (arg: EventingSubscriberRegistrationContext) => Promise<void>): voidParameters
subscribe(arg: EventingSubscriberRegistrationContext) => Promise<void>Adds an executable resource to the application model.
addExecutable( name: string, command: string, workingDirectory: string, args: string[]): ExecutableResourceParameters
namestringcommandstringworkingDirectorystringargsstring[]Returns
ExecutableResourceAdds an external service resource
addExternalService( name: string, url: ParameterResource): ExternalServiceResourceParameters
namestringurlParameterResourceReturns
ExternalServiceResourceAdds a parameter resource
addParameter( name: string, value?: string, publishValueAsDefault?: boolean, secret?: boolean): ParameterResourceParameters
namestringvaluestringoptionalpublishValueAsDefaultbooleanoptional= Falsesecretbooleanoptional= FalseReturns
ParameterResourceAdds a parameter resource to the application, with a value coming from configuration.
addParameterFromConfiguration( name: string, configurationKey: string, secret?: boolean): ParameterResourceParameters
namestringconfigurationKeystringsecretbooleanoptional= FalseReturns
ParameterResourceAdds a parameter with a generated default value
addParameterWithGeneratedValue( name: string, value: GenerateParameterDefault, secret?: boolean, persist?: boolean): ParameterResourceParameters
namestringvalueGenerateParameterDefaultsecretbooleanoptional= Falsepersistbooleanoptional= FalseReturns
ParameterResourceAdds a .NET project resource
addProject( name: string, projectPath: string, launchProfileOrOptions?: ProjectResourceOptions): ProjectResourceParameters
namestringprojectPathstringlaunchProfileOrOptionsProjectResourceOptionsoptionalReturns
ProjectResourcemethod
buildBuilds the distributed application
build(): DistributedApplicationReturns
DistributedApplicationmethod
getConfigurationGets the application configuration.
getConfiguration(): IConfigurationReturns
IConfigurationmethod
subscribeAfterPublishSubscribes to the AfterPublish event, which fires after the application is published.
subscribeAfterPublish(callback: (arg: AfterPublishEvent) => Promise<void>): DistributedApplicationEventSubscriptionParameters
callback(arg: AfterPublishEvent) => Promise<void>Returns
DistributedApplicationEventSubscriptionSubscribes to the AfterResourcesCreated event, which fires after all resources are created.
subscribeAfterResourcesCreated(callback: (arg: AfterResourcesCreatedEvent) => Promise<void>): DistributedApplicationEventSubscriptionParameters
callback(arg: AfterResourcesCreatedEvent) => Promise<void>Returns
DistributedApplicationEventSubscriptionmethod
subscribeBeforePublishSubscribes to the BeforePublish event, which fires before the application is published.
subscribeBeforePublish(callback: (arg: BeforePublishEvent) => Promise<void>): DistributedApplicationEventSubscriptionParameters
callback(arg: BeforePublishEvent) => Promise<void>Returns
DistributedApplicationEventSubscriptionmethod
subscribeBeforeStartSubscribes to the BeforeStart event, which fires before the application starts.
subscribeBeforeStart(callback: (arg: BeforeStartEvent) => Promise<void>): DistributedApplicationEventSubscriptionParameters
callback(arg: BeforeStartEvent) => Promise<void>Returns
DistributedApplicationEventSubscriptionmethod
tryAddEventingSubscriberAttempts to add an ATS-friendly eventing subscriber callback to the distributed-application builder.
tryAddEventingSubscriber(subscribe: (arg: EventingSubscriberRegistrationContext) => Promise<void>): voidParameters
subscribe(arg: EventingSubscriberRegistrationContext) => Promise<void>