120 references to ApplicationBuilder
Aspire.Hosting (20)
ContainerResourceBuilderExtensions.cs (2)
99var annotation = new ContainerMountAnnotation(Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory), target, ContainerMountType.BindMount, isReadOnly); 350var 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)
705var parentBuilder = builder.ApplicationBuilder.CreateResourceBuilder(dependencyResourceWithParent.Parent); 860builder.ApplicationBuilder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((@event, ct) => 876builder.ApplicationBuilder.Eventing.Subscribe<BeforeResourceStartedEvent>(builder.Resource, (@event, ct) => 884builder.ApplicationBuilder.Services.AddLogging(configure => 891builder.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.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)
112if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 127builder.ApplicationBuilder.Eventing.Subscribe<ConnectionStringAvailableEvent>(builder.Resource, async (@event, ct) => 140builder.ApplicationBuilder.Services.AddHealthChecks().AddAzureCosmosDB(sp => 150var 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)
35builder.ApplicationBuilder.AddAzureProvisioning(); 52var postgres = CreatePostgreSqlFlexibleServer(infrastructure, builder.ApplicationBuilder, builder.Resource.Databases); 69var resourceBuilder = builder.ApplicationBuilder.CreateResourceBuilder(resource) 170return builder.ApplicationBuilder.AddResource(azurePostgresDatabase); 175var innerBuilder = builder.ApplicationBuilder.CreateResourceBuilder(azureResource.InnerResource); 180return builder.ApplicationBuilder.CreateResourceBuilder(azurePostgresDatabase); 207if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 213var azureDatabases = builder.ApplicationBuilder.Resources 218RemoveAzureResources(builder.ApplicationBuilder, azureResource, azureDatabases); 221builder.ApplicationBuilder.CreateResourceBuilder(azureResource.UserNameParameter) : 224builder.ApplicationBuilder.CreateResourceBuilder(azureResource.PasswordParameter) : 227var postgresContainer = builder.ApplicationBuilder.AddPostgres( 294ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter(builder.ApplicationBuilder, $"{builder.Resource.Name}-password"); 474builder.ApplicationBuilder, $"{builder.Resource.Name}-username", secret: false, generatedUserName);
Aspire.Hosting.Azure.Redis (5)
AzureRedisExtensions.cs (5)
34builder.ApplicationBuilder.AddAzureProvisioning(); 60var resourceBuilder = builder.ApplicationBuilder.CreateResourceBuilder(resource) 152if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 158builder.ApplicationBuilder.Resources.Remove(azureResource); 160var redisContainer = builder.ApplicationBuilder.AddRedis(azureResource.Name);
Aspire.Hosting.Azure.Sql (10)
AzureSqlExtensions.cs (10)
20builder.ApplicationBuilder.AddAzureProvisioning(); 24CreateSqlServer(infrastructure, builder.ApplicationBuilder, builder.Resource.Databases); 28var azureSqlDatabase = builder.ApplicationBuilder.CreateResourceBuilder(resource); 114return builder.ApplicationBuilder.AddResource(azureSqlDatabase); 119var innerBuilder = builder.ApplicationBuilder.CreateResourceBuilder(azureResource.InnerResource); 124return builder.ApplicationBuilder.CreateResourceBuilder(azureSqlDatabase); 151if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 157var azureDatabases = builder.ApplicationBuilder.Resources 162RemoveAzureResources(builder.ApplicationBuilder, azureResource, azureDatabases); 164var sqlContainer = builder.ApplicationBuilder.AddSqlServer(azureResource.Name);
Aspire.Hosting.Azure.Storage (7)
AzureStorageExtensions.cs (7)
91if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 108builder.ApplicationBuilder.Eventing.Subscribe<BeforeResourceStartedEvent>(builder.Resource, async (@event, ct) => 122builder.ApplicationBuilder.Services.AddHealthChecks().AddAzureBlobStorage(sp => 132var surrogateBuilder = builder.ApplicationBuilder.CreateResourceBuilder(surrogate); 222return builder.ApplicationBuilder.AddResource(resource); 234return builder.ApplicationBuilder.AddResource(resource); 246return builder.ApplicationBuilder.AddResource(resource);
Aspire.Hosting.Azure.WebPubSub (1)
AzureWebPubSubExtensions.cs (1)
131var 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>(); 272if (builder.ApplicationBuilder.Resources.OfType<PgWebContainerResource>().SingleOrDefault() is { } existingPgWebResource) 274var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingPgWebResource); 283var pgwebContainerBuilder = builder.ApplicationBuilder.AddResource(pgwebContainer) 296builder.ApplicationBuilder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>(async (e, ct) => 298var adminResource = builder.ApplicationBuilder.Resources.OfType<PgWebContainerResource>().Single(); 300var 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>(); 148if (builder.ApplicationBuilder.Resources.OfType<RedisInsightResource>().SingleOrDefault() is { } existingRedisCommanderResource) 150var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingRedisCommanderResource); 159var resourceBuilder = builder.ApplicationBuilder.AddResource(resource) 168builder.ApplicationBuilder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((e, ct) => 174builder.ApplicationBuilder.Eventing.Subscribe<ResourceReadyEvent>(resource, async (e, ct) => 176var redisInstances = builder.ApplicationBuilder.Resources.OfType<RedisResource>(); 187var redisInsightResource = builder.ApplicationBuilder.Resources.OfType<RedisInsightResource>().Single();
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
80return builder.ApplicationBuilder.AddResource(sqlServerDatabase);