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
appHostDirectory string get Directory of the project where the app host is located. Defaults to the content root if there's no project.
property
environment IHostEnvironment get Gets the Environment property
property
eventing IDistributedApplicationEventing get Eventing infrastructure for AppHost lifecycle.
property
executionContext DistributedApplicationExecutionContext get Execution context for this invocation of the AppHost.
property
pipeline IDistributedApplicationPipeline get Gets the deployment pipeline for this distributed application.
property
userSecretsManager IUserSecretsManager get Gets the service for managing user secrets.
Methods
Adds a connection string resource
addConnectionString( name: string, environmentVariableNameOrExpression?: ReferenceExpression): IResourceWithConnectionStringParameters
name string environmentVariableNameOrExpression ReferenceExpression optional Returns
IResourceWithConnectionString Adds a container resource to the application.
addContainer( name: string, image: AddContainerOptions): ContainerResourceParameters
name string image AddContainerOptions Returns
ContainerResource Adds a container registry resource
addContainerRegistry( name: string, endpoint: ParameterResource, repository?: ParameterResource): ContainerRegistryResourceParameters
name string endpoint ParameterResource repository ParameterResource optional Returns
ContainerRegistryResource Adds a C# application resource
addCSharpApp( name: string, path: string, options?: ProjectResourceOptions): CSharpAppResourceParameters
name string path string options ProjectResourceOptions optional Returns
CSharpAppResource Adds a Dockerfile to the application model that can be treated like a container resource.
addDockerfile( name: string, contextPath: string, dockerfilePath?: string, stage?: string): ContainerResourceParameters
name string contextPath string dockerfilePath string optional stage string optional Returns
ContainerResource Adds a container resource built from a programmatically generated Dockerfile
addDockerfileBuilder(name: string, contextPath: string, callback: (arg: DockerfileBuilderCallbackContext) => Promise<void>, stage?: string): ContainerResourceParameters
name string contextPath string callback (arg: DockerfileBuilderCallbackContext) => Promise<void> stage string optional Returns
ContainerResource Adds 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
name string contextPath string dockerfileFactory (arg: DockerfileFactoryContext) => Promise<string> stage string optional Returns
ContainerResource Adds a .NET tool resource to the application model.
addDotnetTool( name: string, packageId: string): DotnetToolResourceParameters
name string packageId string Returns
DotnetToolResource method
addEventingSubscriber Adds 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
name string command string workingDirectory string args string[] Returns
ExecutableResource Adds an external service resource
addExternalService( name: string, url: ParameterResource): ExternalServiceResourceParameters
name string url ParameterResource Returns
ExternalServiceResource Adds a parameter resource
addParameter( name: string, value?: string, publishValueAsDefault?: boolean, secret?: boolean): ParameterResourceParameters
name string value string optional publishValueAsDefault boolean optional = False secret boolean optional = False Returns
ParameterResource Adds a parameter resource to the application, with a value coming from configuration.
addParameterFromConfiguration( name: string, configurationKey: string, secret?: boolean): ParameterResourceParameters
name string configurationKey string secret boolean optional = False Returns
ParameterResource Adds a parameter with a generated default value
addParameterWithGeneratedValue( name: string, value: GenerateParameterDefault, secret?: boolean, persist?: boolean): ParameterResourceParameters
name string value GenerateParameterDefault secret boolean optional = False persist boolean optional = False Returns
ParameterResource Adds a .NET project resource
addProject( name: string, projectPath: string, launchProfileOrOptions?: ProjectResourceOptions): ProjectResourceParameters
name string projectPath string launchProfileOrOptions ProjectResourceOptions optional Returns
ProjectResource method
build Builds the distributed application
build(): DistributedApplicationReturns
DistributedApplication method
getConfiguration Gets the application configuration.
getConfiguration(): IConfigurationReturns
IConfiguration method
subscribeAfterPublish Subscribes to the AfterPublish event, which fires after the application is published.
subscribeAfterPublish(callback: (arg: AfterPublishEvent) => Promise<void>): DistributedApplicationEventSubscriptionParameters
callback (arg: AfterPublishEvent) => Promise<void> Returns
DistributedApplicationEventSubscription Subscribes to the AfterResourcesCreated event, which fires after all resources are created.
subscribeAfterResourcesCreated(callback: (arg: AfterResourcesCreatedEvent) => Promise<void>): DistributedApplicationEventSubscriptionParameters
callback (arg: AfterResourcesCreatedEvent) => Promise<void> Returns
DistributedApplicationEventSubscription method
subscribeBeforePublish Subscribes to the BeforePublish event, which fires before the application is published.
subscribeBeforePublish(callback: (arg: BeforePublishEvent) => Promise<void>): DistributedApplicationEventSubscriptionParameters
callback (arg: BeforePublishEvent) => Promise<void> Returns
DistributedApplicationEventSubscription method
subscribeBeforeStart Subscribes to the BeforeStart event, which fires before the application starts.
subscribeBeforeStart(callback: (arg: BeforeStartEvent) => Promise<void>): DistributedApplicationEventSubscriptionParameters
callback (arg: BeforeStartEvent) => Promise<void> Returns
DistributedApplicationEventSubscription method
tryAddEventingSubscriber Attempts 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>