137 references to ApplicationBuilder
Aspire.Hosting (26)
ContainerResourceBuilderExtensions.cs (2)
96var annotation = new ContainerMountAnnotation(Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory), target, ContainerMountType.BindMount, isReadOnly); 378var fullyQualifiedContextPath = Path.GetFullPath(contextPath, builder.ApplicationBuilder.AppHostDirectory);
ExecutableResourceBuilderExtensions.cs (3)
112if (!builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 124builder.ApplicationBuilder.Resources.Remove(builder.Resource); 127var cb = builder.ApplicationBuilder.AddResource(container);
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)
113AddOtlpEnvironment(builder.Resource, builder.ApplicationBuilder.Configuration, builder.ApplicationBuilder.Environment);
ProjectResourceBuilderExtensions.cs (10)
299if (builder.ApplicationBuilder.ExecutionContext.IsRunMode && builder.ApplicationBuilder.Environment.IsDevelopment()) 311if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 333var appHostDefaultLaunchProfileName = builder.ApplicationBuilder.Configuration["AppHost:DefaultLaunchProfileName"] 385if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 411if (builder.ApplicationBuilder.ExecutionContext.IsRunMode) 641if (!builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 653builder.ApplicationBuilder.Resources.Remove(builder.Resource); 656var cb = builder.ApplicationBuilder.AddResource(container); 803var host = builder.ApplicationBuilder.ExecutionContext.IsRunMode &&
ResourceBuilderExtensions.cs (5)
727var parentBuilder = builder.ApplicationBuilder.CreateResourceBuilder(dependencyResourceWithParent.Parent); 882builder.ApplicationBuilder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((@event, ct) => 898builder.ApplicationBuilder.Eventing.Subscribe<BeforeResourceStartedEvent>(builder.Resource, (@event, ct) => 906builder.ApplicationBuilder.Services.AddLogging(configure => 913builder.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 (6)
AzureContainerAppContainerExtensions.cs (2)
36if (!container.ApplicationBuilder.ExecutionContext.IsPublishMode) 41container.ApplicationBuilder.AddAzureContainerAppsInfrastructure();
AzureContainerAppExecutableExtensions.cs (2)
36if (!executable.ApplicationBuilder.ExecutionContext.IsPublishMode) 41executable.ApplicationBuilder.AddAzureContainerAppsInfrastructure();
AzureContainerAppProjectExtensions.cs (2)
37if (!project.ApplicationBuilder.ExecutionContext.IsPublishMode) 42project.ApplicationBuilder.AddAzureContainerAppsInfrastructure();
Aspire.Hosting.Azure.CosmosDB (5)
AzureCosmosDBExtensions.cs (5)
71if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 87builder.ApplicationBuilder.Eventing.Subscribe<ConnectionStringAvailableEvent>(builder.Resource, async (@event, ct) => 99builder.ApplicationBuilder.Eventing.Subscribe<ResourceReadyEvent>(builder.Resource, async (@event, ct) => 121builder.ApplicationBuilder.Services.AddHealthChecks().AddAzureCosmosDB( 131var surrogateBuilder = builder.ApplicationBuilder.CreateResourceBuilder(surrogate);
Aspire.Hosting.Azure.EventHubs (7)
AzureEventHubsExtensions.cs (7)
149if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 175var storageResource = builder.ApplicationBuilder 193builder.ApplicationBuilder.Eventing.Subscribe<ConnectionStringAvailableEvent>(builder.Resource, async (@event, ct) => 213builder.ApplicationBuilder.Services.AddHealthChecks().AddAzureEventHub( 223var surrogateBuilder = builder.ApplicationBuilder.CreateResourceBuilder(surrogate); 227builder.ApplicationBuilder.Eventing.Subscribe<BeforeResourceStartedEvent>(builder.Resource, (e, ct) => 229var 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.ServiceBus (6)
AzureServiceBusExtensions.cs (6)
231if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 260var sqlEdgeResource = builder.ApplicationBuilder 281builder.ApplicationBuilder.Eventing.Subscribe<BeforeResourceStartedEvent>(builder.Resource, async (@event, ct) => 283var serviceBusEmulatorResources = builder.ApplicationBuilder.Resources.OfType<AzureServiceBusResource>().Where(x => x is { } serviceBusResource && serviceBusResource.IsEmulator); 417var surrogateBuilder = builder.ApplicationBuilder.CreateResourceBuilder(surrogate); 425builder.ApplicationBuilder.Services.AddHealthChecks()
Aspire.Hosting.Azure.SignalR (2)
AzureSignalRExtensions.cs (2)
92if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 108var surrogateBuilder = builder.ApplicationBuilder.CreateResourceBuilder(surrogate);
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)
93if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) 110builder.ApplicationBuilder.Eventing.Subscribe<BeforeResourceStartedEvent>(builder.Resource, async (@event, ct) => 124builder.ApplicationBuilder.Services.AddHealthChecks().AddAzureBlobStorage(sp => 135var surrogateBuilder = builder.ApplicationBuilder 251return builder.ApplicationBuilder.AddResource(resource); 263return builder.ApplicationBuilder.AddResource(resource); 275return 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)
58builder.ApplicationBuilder.AddDapr(); 60var 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)
162var importFullPath = Path.GetFullPath(import, 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)
115builder.ApplicationBuilder.Eventing.Subscribe<ConnectionStringAvailableEvent>(mongoDBDatabase, async (@event, ct) => 128builder.ApplicationBuilder.Services.AddHealthChecks() 135return builder.ApplicationBuilder 156var 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)
251if (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);