122 references to ApplicationBuilder
Aspire.Hosting (20)
ContainerResourceBuilderExtensions.cs (2)
99var annotation = new ContainerMountAnnotation(Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory), target, ContainerMountType.BindMount, isReadOnly); 345var fullyQualifiedContextPath = Path.GetFullPath(contextPath, builder.ApplicationBuilder.AppHostDirectory);
IDistributedApplicationBuilder.cs (1)
95/// the <see cref="IResourceBuilder{T}.ApplicationBuilder"/>. In this case an extension method is used to generate a stable node name for RabbitMQ for local
OtlpConfigurationExtensions.cs (2)
121AddOtlpEnvironment(builder.Resource, builder.ApplicationBuilder.Configuration, builder.ApplicationBuilder.Environment);
ProjectResourceBuilderExtensions.cs (7)
299if (builder.ApplicationBuilder.ExecutionContext.IsRunMode && builder.ApplicationBuilder.Environment.IsDevelopment()) 311if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 333var appHostDefaultLaunchProfileName = builder.ApplicationBuilder.Configuration["AppHost:DefaultLaunchProfileName"] 384if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 410if (builder.ApplicationBuilder.ExecutionContext.IsRunMode) 753var host = builder.ApplicationBuilder.ExecutionContext.IsRunMode &&
ResourceBuilderExtensions.cs (5)
700var parentBuilder = builder.ApplicationBuilder.CreateResourceBuilder(dependencyResourceWithParent.Parent); 851builder.ApplicationBuilder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((@event, ct) => 867builder.ApplicationBuilder.Eventing.Subscribe<BeforeResourceStartedEvent>(builder.Resource, (@event, ct) => 875builder.ApplicationBuilder.Services.AddLogging(configure => 882builder.ApplicationBuilder.Services.AddHealthChecks().AddUrlGroup((UriHealthCheckOptions options) =>
Utils\ImageNameGenerator.cs (1)
14var bytes = Encoding.UTF8.GetBytes(builder.ApplicationBuilder.AppHostDirectory);
Utils\VolumeNameGenerator.cs (2)
31var safeApplicationName = Sanitize(builder.ApplicationBuilder.Environment.ApplicationName).ToLowerInvariant(); 32var applicationHash = builder.ApplicationBuilder.Configuration["AppHost:Sha256"]![..10].ToLowerInvariant();
Aspire.Hosting.AWS (1)
CDK\CDKExtensions.cs (1)
86return builder.ApplicationBuilder
Aspire.Hosting.Azure.AppContainers (4)
AzureContainerAppContainerExtensions.cs (2)
36if (!container.ApplicationBuilder.ExecutionContext.IsPublishMode) 41container.ApplicationBuilder.AddAzureContainerAppsInfrastructure();
AzureContainerAppProjectExtensions.cs (2)
37if (!project.ApplicationBuilder.ExecutionContext.IsPublishMode) 42project.ApplicationBuilder.AddAzureContainerAppsInfrastructure();
Aspire.Hosting.Azure.CosmosDB (4)
AzureCosmosDBExtensions.cs (4)
113if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 128builder.ApplicationBuilder.Eventing.Subscribe<ConnectionStringAvailableEvent>(builder.Resource, async (@event, ct) => 141builder.ApplicationBuilder.Services.AddHealthChecks().AddAzureCosmosDB(sp => 151var surrogateBuilder = builder.ApplicationBuilder.CreateResourceBuilder(surrogate);
Aspire.Hosting.Azure.EventHubs (7)
AzureEventHubsExtensions.cs (7)
115if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 145var storageResource = builder.ApplicationBuilder 163builder.ApplicationBuilder.Eventing.Subscribe<ConnectionStringAvailableEvent>(builder.Resource, async (@event, ct) => 183builder.ApplicationBuilder.Services.AddHealthChecks().AddAzureEventHub( 193var surrogateBuilder = builder.ApplicationBuilder.CreateResourceBuilder(surrogate); 197builder.ApplicationBuilder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((e, ct) => 199var eventHubsEmulatorResources = builder.ApplicationBuilder.Resources.OfType<AzureEventHubsResource>().Where(x => x is { } eventHubsResource && eventHubsResource.IsEmulator);
Aspire.Hosting.Azure.Functions (1)
AzureFunctionsProjectResourceExtensions.cs (1)
157if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode)
Aspire.Hosting.Azure.PostgreSQL (14)
AzurePostgresExtensions.cs (14)
36builder.ApplicationBuilder.AddAzureProvisioning(); 53var postgres = CreatePostgreSqlFlexibleServer(infrastructure, builder.ApplicationBuilder, builder.Resource.Databases); 70var resourceBuilder = builder.ApplicationBuilder.CreateResourceBuilder(resource) 212return builder.ApplicationBuilder.AddResource(azurePostgresDatabase); 217var innerBuilder = builder.ApplicationBuilder.CreateResourceBuilder(azureResource.InnerResource); 222return builder.ApplicationBuilder.CreateResourceBuilder(azurePostgresDatabase); 249if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 255var azureDatabases = builder.ApplicationBuilder.Resources 260RemoveAzureResources(builder.ApplicationBuilder, azureResource, azureDatabases); 263builder.ApplicationBuilder.CreateResourceBuilder(azureResource.UserNameParameter) : 266builder.ApplicationBuilder.CreateResourceBuilder(azureResource.PasswordParameter) : 269var postgresContainer = builder.ApplicationBuilder.AddPostgres( 336ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(builder.ApplicationBuilder, $"{builder.Resource.Name}-password"); 512builder.ApplicationBuilder, $"{builder.Resource.Name}-username", secret: false, generatedUserName);
Aspire.Hosting.Azure.Redis (5)
AzureRedisExtensions.cs (5)
35builder.ApplicationBuilder.AddAzureProvisioning(); 61var resourceBuilder = builder.ApplicationBuilder.CreateResourceBuilder(resource) 182if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 188builder.ApplicationBuilder.Resources.Remove(azureResource); 190var redisContainer = builder.ApplicationBuilder.AddRedis(azureResource.Name);
Aspire.Hosting.Azure.Sql (11)
AzureSqlExtensions.cs (11)
20builder.ApplicationBuilder.AddAzureProvisioning(); 24CreateSqlServer(infrastructure, builder.ApplicationBuilder, builder.Resource.Databases); 28var azureSqlDatabase = builder.ApplicationBuilder.CreateResourceBuilder(resource); 33if (builder.ApplicationBuilder.ExecutionContext.IsRunMode) 130return builder.ApplicationBuilder.AddResource(azureSqlDatabase); 135var innerBuilder = builder.ApplicationBuilder.CreateResourceBuilder(azureResource.InnerResource); 140return builder.ApplicationBuilder.CreateResourceBuilder(azureSqlDatabase); 167if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 173var azureDatabases = builder.ApplicationBuilder.Resources 178RemoveAzureResources(builder.ApplicationBuilder, azureResource, azureDatabases); 180var sqlContainer = builder.ApplicationBuilder.AddSqlServer(azureResource.Name);
Aspire.Hosting.Azure.Storage (7)
AzureStorageExtensions.cs (7)
92if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 109builder.ApplicationBuilder.Eventing.Subscribe<BeforeResourceStartedEvent>(builder.Resource, async (@event, ct) => 123builder.ApplicationBuilder.Services.AddHealthChecks().AddAzureBlobStorage(sp => 133var surrogateBuilder = builder.ApplicationBuilder.CreateResourceBuilder(surrogate); 223return builder.ApplicationBuilder.AddResource(resource); 235return builder.ApplicationBuilder.AddResource(resource); 247return builder.ApplicationBuilder.AddResource(resource);
Aspire.Hosting.Azure.WebPubSub (1)
AzureWebPubSubExtensions.cs (1)
130var hubBuilder = builder.ApplicationBuilder.CreateResourceBuilder(hubResource);
Aspire.Hosting.Dapr (2)
IDistributedApplicationComponentBuilderExtensions.cs (2)
55builder.ApplicationBuilder.AddDapr(); 57var sidecarBuilder = builder.ApplicationBuilder.AddResource(new DaprSidecarResource($"{builder.Resource.Name}-dapr"))
Aspire.Hosting.Kafka (5)
KafkaBuilderExtensions.cs (5)
96if (builder.ApplicationBuilder.Resources.OfType<KafkaUIContainerResource>().SingleOrDefault() is { } existingKafkaUIResource) 98var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingKafkaUIResource); 107var kafkaUiBuilder = builder.ApplicationBuilder.AddResource(kafkaUi) 113builder.ApplicationBuilder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((e, ct) => 115var kafkaResources = builder.ApplicationBuilder.Resources.OfType<KafkaServerResource>();
Aspire.Hosting.Keycloak (1)
KeycloakResourceBuilderExtensions.cs (1)
155var importDirectoryFullPath = Path.GetFullPath(importDirectory, builder.ApplicationBuilder.AppHostDirectory);
Aspire.Hosting.Milvus (2)
MilvusBuilderExtensions.cs (2)
104return builder.ApplicationBuilder.AddResource(milvusDatabaseResource); 137var resourceBuilder = builder.ApplicationBuilder.AddResource(attuContainer)
Aspire.Hosting.MongoDB (4)
MongoDBBuilderExtensions.cs (4)
109builder.ApplicationBuilder.Eventing.Subscribe<ConnectionStringAvailableEvent>(mongoDBDatabase, async (@event, ct) => 120builder.ApplicationBuilder.Services.AddHealthChecks().AddMongoDb(sp => connectionString ?? throw new InvalidOperationException("Connection string is unavailable"), name: healthCheckKey); 122return builder.ApplicationBuilder 143var resourceBuilder = builder.ApplicationBuilder.AddResource(mongoExpressContainer)
Aspire.Hosting.MySql (5)
MySqlBuilderExtensions.cs (5)
81return builder.ApplicationBuilder.AddResource(mySqlDatabase); 98if (builder.ApplicationBuilder.Resources.OfType<PhpMyAdminContainerResource>().Any()) 108var phpMyAdminContainerBuilder = builder.ApplicationBuilder.AddResource(phpMyAdminContainer) 115builder.ApplicationBuilder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((e, ct) => 117var mySqlInstances = builder.ApplicationBuilder.Resources.OfType<MySqlServerResource>();
Aspire.Hosting.NodeJs (1)
NodeExtensions.cs (1)
72.WithEnvironment("NODE_ENV", builder.ApplicationBuilder.Environment.IsDevelopment() ? "development" : "production");
Aspire.Hosting.Oracle (1)
OracleDatabaseBuilderExtensions.cs (1)
75return builder.ApplicationBuilder.AddResource(oracleDatabase);
Aspire.Hosting.PostgreSQL (12)
PostgresBuilderExtensions.cs (12)
121return builder.ApplicationBuilder.AddResource(postgresDatabase); 138if (builder.ApplicationBuilder.Resources.OfType<PgAdminContainerResource>().SingleOrDefault() is { } existingPgAdminResource) 140var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingPgAdminResource); 149var pgAdminContainerBuilder = builder.ApplicationBuilder.AddResource(pgAdminContainer) 158builder.ApplicationBuilder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((e, ct) => 161var postgresInstances = builder.ApplicationBuilder.Resources.OfType<PostgresServerResource>(); 271if (builder.ApplicationBuilder.Resources.OfType<PgWebContainerResource>().SingleOrDefault() is { } existingPgWebResource) 273var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingPgWebResource); 282var pgwebContainerBuilder = builder.ApplicationBuilder.AddResource(pgwebContainer) 293builder.ApplicationBuilder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>(async (e, ct) => 295var adminResource = builder.ApplicationBuilder.Resources.OfType<PgWebContainerResource>().Single(); 297var postgresInstances = builder.ApplicationBuilder.Resources.OfType<PostgresDatabaseResource>();
Aspire.Hosting.RabbitMQ (1)
RabbitMQBuilderExtensions.cs (1)
240if (builder.ApplicationBuilder.ExecutionContext.IsRunMode)
Aspire.Hosting.Redis (12)
RedisBuilderExtensions.cs (12)
81if (builder.ApplicationBuilder.Resources.OfType<RedisCommanderResource>().SingleOrDefault() is { } existingRedisCommanderResource) 83var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingRedisCommanderResource); 92var resourceBuilder = builder.ApplicationBuilder.AddResource(resource) 98builder.ApplicationBuilder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((e, ct) => 100var redisInstances = builder.ApplicationBuilder.Resources.OfType<RedisResource>(); 146if (builder.ApplicationBuilder.Resources.OfType<RedisInsightResource>().SingleOrDefault() is { } existingRedisCommanderResource) 148var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingRedisCommanderResource); 157var resourceBuilder = builder.ApplicationBuilder.AddResource(resource) 166builder.ApplicationBuilder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((e, ct) => 172builder.ApplicationBuilder.Eventing.Subscribe<ResourceReadyEvent>(resource, async (e, ct) => 174var redisInstances = builder.ApplicationBuilder.Resources.OfType<RedisResource>(); 185var redisInsightResource = builder.ApplicationBuilder.Resources.OfType<RedisInsightResource>().Single();
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
80return builder.ApplicationBuilder.AddResource(sqlServerDatabase);