Implemented interface member:
property
Name
Aspire.Hosting.ApplicationModel.IResource.Name
1 write to Name
Aspire.Hosting (1)
ApplicationModel\Resource.cs (1)
32Name = name;
348 references to Name
Aspire.Hosting (3)
ApplicationModel\ParameterResource.cs (1)
64public string ValueExpression => $"{{{Name}.value}}";
ApplicationModel\Resource.cs (1)
37return $@"Type = {GetType().Name}, Name = ""{Name}"", Annotations = {Annotations.Count}";
Publishing\ManifestPublishingContext.cs (1)
218Writer.WriteString("value", $"{{{parameter.Name}.inputs.value}}");
Aspire.Hosting.Azure (1)
AzureProvisioningResourceExtensions.cs (1)
72parameterName ??= Infrastructure.NormalizeBicepIdentifier(parameterResourceBuilder.Resource.Name);
Aspire.Hosting.Azure.AppConfiguration (1)
AzureAppConfigurationExtensions.cs (1)
32Tags = { { "aspire-resource-name", infrastructure.AspireResource.Name } }
Aspire.Hosting.Azure.AppContainers (2)
AzureContainerAppsInfrastructure.cs (2)
717if (!KeyVaultRefs.TryGetValue(secretOutputReference.Resource.Name, out var kv)) 724KeyVaultRefs[secretOutputReference.Resource.Name] = kv;
Aspire.Hosting.Azure.CognitiveServices (2)
AzureOpenAIExtensions.cs (2)
38CustomSubDomainName = ToLower(Take(Concat(infrastructure.AspireResource.Name, GetUniqueString(GetResourceGroup().Id)), 24)), 43Tags = { { "aspire-resource-name", infrastructure.AspireResource.Name } }
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
59Tags = { { "aspire-resource-name", infrastructure.AspireResource.Name } }
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsExtensions.cs (1)
46Tags = { { "aspire-resource-name", infrastructure.AspireResource.Name } }
Aspire.Hosting.Azure.Functions (2)
AzureFunctionsProjectResourceExtensions.cs (1)
44.FirstOrDefault(r => r.Name == storageResourceName);
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (1)
28return projectMetadata.GetLaunchSettings(projectResource.Name);
Aspire.Hosting.Azure.KeyVault (1)
AzureKeyVaultResourceExtensions.cs (1)
49keyVault.Tags["aspire-resource-name"] = infrastructure.AspireResource.Name;
Aspire.Hosting.Azure.PostgreSQL (2)
AzurePostgresExtensions.cs (2)
331Tags = { { "aspire-resource-name", infrastructure.AspireResource.Name } } 474builder.ApplicationBuilder, $"{builder.Resource.Name}-username", secret: false, generatedUserName);
Aspire.Hosting.Azure.Redis (1)
AzureRedisExtensions.cs (1)
211Tags = { { "aspire-resource-name", infrastructure.AspireResource.Name } }
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusExtensions.cs (1)
41Tags = { { "aspire-resource-name", infrastructure.AspireResource.Name } }
Aspire.Hosting.Azure.SignalR (1)
AzureSignalRExtensions.cs (1)
45Tags = { { "aspire-resource-name", infrastructure.AspireResource.Name } }
Aspire.Hosting.Azure.Sql (3)
AzureSqlExtensions.cs (2)
164var sqlContainer = builder.ApplicationBuilder.AddSqlServer(azureResource.Name); 216Tags = { { "aspire-resource-name", infrastructure.AspireResource.Name } }
AzureSqlServerResource.cs (1)
31: base(innerResource.Name, configureInfrastructure)
Aspire.Hosting.Azure.Storage (1)
AzureStorageExtensions.cs (1)
51Tags = { { "aspire-resource-name", infrastructure.AspireResource.Name } }
Aspire.Hosting.Azure.Tests (46)
AzureBicepResourceTests.cs (14)
330Assert.Equal("cosmos", cosmos.Resource.Name); 424Assert.Equal("cosmos", cosmos.Resource.Name); 505Assert.Equal("appInsights", appInsights.Resource.Name); 562Assert.Equal("appInsights", appInsights.Resource.Name); 628Assert.Equal("appInsights", appInsights.Resource.Name); 681Assert.Equal("logAnalyticsWorkspace", logAnalyticsWorkspace.Resource.Name); 1618Assert.Equal("sb", serviceBus.Resource.Name); 1727Assert.Equal("wps1", wps.Resource.Name); 1794Assert.Equal("wps1", wps.Resource.Name); 1894Assert.Equal("storage", storage.Resource.Name); 2053Assert.Equal("storage", storage.Resource.Name); 2211Assert.Equal("storage", storage.Resource.Name); 2370Assert.Equal("storage", storage.Resource.Name); 2528Assert.Equal("search", search.Resource.Name);
AzureCosmosDBEmulatorFunctionalTests.cs (7)
48await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running, cts.Token); 50await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 54await rns.WaitForResourceHealthyAsync(resource.Resource.Name, cts.Token); 56await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token); 93hb.Configuration[$"ConnectionStrings:{db.Resource.Name}"] = await db.Resource.ConnectionStringExpression.GetValueAsync(default); 94hb.AddAzureCosmosClient(db.Resource.Name); 95hb.AddCosmosDbContext<EFCoreCosmosDbContext>(db.Resource.Name, databaseName);
AzureEventHubsExtensionsTests.cs (4)
49await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running, cts.Token); 51await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 55await rns.WaitForResourceHealthyAsync(resource.Resource.Name, cts.Token); 57await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token);
AzureFunctionsTests.cs (7)
107Assert.NotEqual(AzureFunctionsProjectResourceExtensions.DefaultAzureFunctionsHostStorageName, storageResources.Name); 108Assert.StartsWith(AzureFunctionsProjectResourceExtensions.DefaultAzureFunctionsHostStorageName, storageResources.Name); 126r => r.Name.StartsWith(AzureFunctionsProjectResourceExtensions.DefaultAzureFunctionsHostStorageName)); 128Assert.Equal("my-own-storage", storageResource.Name); 147r => r.Name.StartsWith(AzureFunctionsProjectResourceExtensions.DefaultAzureFunctionsHostStorageName)); 160Assert.NotEqual(AzureFunctionsProjectResourceExtensions.DefaultAzureFunctionsHostStorageName, resource.Name); 161Assert.StartsWith(AzureFunctionsProjectResourceExtensions.DefaultAzureFunctionsHostStorageName, resource.Name);
AzurePostgresExtensionsTests.cs (2)
154"administratorLogin": "{{{userName?.Resource.Name ?? "postgres-data-username"}}.value}", 155"administratorLoginPassword": "{{{password?.Resource.Name ?? "postgres-data-password"}}.value}",
AzureStorageEmulatorFunctionalTests.cs (6)
50await rns.WaitForResourceAsync(storage.Resource.Name, KnownResourceStates.Running, cts.Token); 52await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 56await rns.WaitForResourceHealthyAsync(blobs.Resource.Name, cts.Token); 57await rns.WaitForResourceHealthyAsync(queues.Resource.Name, cts.Token); 58await rns.WaitForResourceHealthyAsync(tables.Resource.Name, cts.Token); 60await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token);
AzureWebPubSubExtensionsTests.cs (6)
37Assert.Equal(hubName, hub.Resource.Name); 69Assert.Equal("wps1", wps.Resource.Name); 144Assert.Equal("wps1", wps.Resource.Name); 219Assert.Equal("wps1", wps.Resource.Name); 295Assert.Equal("wps1", wps.Resource.Name); 402Assert.Equal("wps1", wps.Resource.Name);
Aspire.Hosting.Azure.WebPubSub (1)
AzureWebPubSubExtensions.cs (1)
52Tags = { { "aspire-resource-name", infrastructure.AspireResource.Name } }
Aspire.Hosting.Dapr (11)
DaprDistributedApplicationLifecycleHook.cs (11)
381string componentDirectory = Path.Combine(_onDemandResourcesRootPath, component.Name); 385string componentPath = Path.Combine(componentDirectory, $"{component.Name}.yaml"); 399onDemandResourcesPaths.Add(component.Name, componentPath); 414_logger.LogInformation("Using default Dapr pub-sub for component '{ComponentName}'.", component.Name); 417string newContent = defaultContent.Replace("name: pubsub", $"name: {component.Name}"); 423_logger.LogInformation("Using in-memory Dapr pub-sub for component '{ComponentName}'.", component.Name); 437_logger.LogInformation("Using default Dapr state store for component '{ComponentName}'.", component.Name); 440string newContent = defaultContent.Replace("name: statestore", $"name: {component.Name}"); 446_logger.LogInformation("Using in-memory Dapr state store for component '{ComponentName}'.", component.Name); 461name: {component.Name} 476name: {component.Name}
Aspire.Hosting.Elasticsearch (1)
ElasticsearchBuilderExtensions.cs (1)
66throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{elasticsearch.Name}' resource but the connection string was null.");
Aspire.Hosting.Elasticsearch.Tests (12)
AddElasticsearchTests.cs (2)
27Assert.Equal("elasticsearch", containerResource.Name); 89Assert.Equal("elasticsearch", containerResource.Name);
ElasticsearchFunctionalTests.cs (10)
47hb.Configuration[$"ConnectionStrings:{elasticsearch.Resource.Name}"] = await elasticsearch.Resource.ConnectionStringExpression.GetValueAsync(default); 49hb.AddElasticsearchClient(elasticsearch.Resource.Name); 110hb.Configuration[$"ConnectionStrings:{elasticsearch1.Resource.Name}"] = await elasticsearch1.Resource.ConnectionStringExpression.GetValueAsync(default); 112hb.AddElasticsearchClient(elasticsearch1.Resource.Name); 155hb.Configuration[$"ConnectionStrings:{elasticsearch2.Resource.Name}"] = await elasticsearch2.Resource.ConnectionStringExpression.GetValueAsync(default); 157hb.AddElasticsearchClient(elasticsearch2.Resource.Name); 231await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running, cts.Token); 233await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 237await rns.WaitForResourceAsync(resource.Resource.Name, (re => re.Snapshot.HealthStatus == Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus.Healthy), cts.Token); 239await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token);
Aspire.Hosting.Garnet.Tests (10)
AddGarnetTests.cs (2)
25Assert.Equal("myGarnet", containerResource.Name); 53Assert.Equal("myGarnet", containerResource.Name);
GarnetFunctionalTests.cs (8)
44await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running, cts.Token); 46await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 50await rns.WaitForResourceHealthyAsync(resource.Resource.Name, cts.Token); 52await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token); 78hb.Configuration[$"ConnectionStrings:{garnet.Resource.Name}"] = await garnet.Resource.ConnectionStringExpression.GetValueAsync(default); 80hb.AddRedisClient(garnet.Resource.Name); 157hb.Configuration[$"ConnectionStrings:{garnet1.Resource.Name}"] = $"{await garnet1.Resource.ConnectionStringExpression.GetValueAsync(default)}"; 208hb.Configuration[$"ConnectionStrings:{garnet2.Resource.Name}"] = $"{await garnet2.Resource.ConnectionStringExpression.GetValueAsync(default)}";
Aspire.Hosting.Kafka.Tests (8)
AddKafkaTests.cs (1)
26Assert.Equal("kafka", containerResource.Name);
KafkaFunctionalTests.cs (7)
45await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running, cts.Token); 47await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 51await rns.WaitForResourceHealthyAsync(resource.Resource.Name, cts.Token); 53await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token); 76hb.Configuration[$"ConnectionStrings:{kafka.Resource.Name}"] = await kafka.Resource.ConnectionStringExpression.GetValueAsync(default); 169hb.Configuration[$"ConnectionStrings:{kafka1.Resource.Name}"] = await kafka1.Resource.ConnectionStringExpression.GetValueAsync(default); 221hb.Configuration[$"ConnectionStrings:{kafka2.Resource.Name}"] = await kafka2.Resource.ConnectionStringExpression.GetValueAsync(default);
Aspire.Hosting.Keycloak.Tests (1)
KeycloakResourceBuilderTests.cs (1)
27Assert.Equal(resourceName, containerResource.Name);
Aspire.Hosting.Milvus (2)
MilvusBuilderExtensions.cs (2)
134containerName ??= $"{builder.Resource.Name}-attu"; 193context.EnvironmentVariables.Add("MILVUS_URL", $"{resource.PrimaryEndpoint.Scheme}://{resource.Name}:{resource.PrimaryEndpoint.TargetPort}");
Aspire.Hosting.Milvus.Tests (10)
AddMilvusTests.cs (1)
194Assert.Equal("my-milvus", milvusResource.Name);
MilvusFunctionalTests.cs (9)
32await app.WaitForTextAsync("Milvus Proxy successfully initialized and ready to serve", milvus.Resource.Name); 36hb.Configuration[$"ConnectionStrings:{db.Resource.Name}"] = await db.Resource.ConnectionStringExpression.GetValueAsync(default); 38hb.AddMilvusClient(db.Resource.Name); 104await app.WaitForTextAsync("Milvus Proxy successfully initialized and ready to serve", milvus1.Resource.Name); 110hb.Configuration[$"ConnectionStrings:{db1.Resource.Name}"] = await db1.Resource.ConnectionStringExpression.GetValueAsync(default); 112hb.AddMilvusClient(db1.Resource.Name); 152await app.WaitForTextAsync("Milvus Proxy successfully initialized and ready to serve", milvus2.Resource.Name); 158hb.Configuration[$"ConnectionStrings:{db2.Resource.Name}"] = await db2.Resource.ConnectionStringExpression.GetValueAsync(default); 160hb.AddMilvusClient(db2.Resource.Name);
Aspire.Hosting.MongoDB (1)
MongoDBBuilderExtensions.cs (1)
115throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{mongoDBDatabase.Name}' resource but the connection string was null.");
Aspire.Hosting.MongoDB.Tests (14)
AddMongoDBTests.cs (2)
27Assert.Equal("mongodb", containerResource.Name); 55Assert.Equal("mongodb", containerResource.Name);
MongoDbFunctionalTests.cs (12)
56await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running, cts.Token); 58await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 62await rns.WaitForResourceHealthyAsync(resource.Resource.Name, cts.Token); 64await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token); 89hb.Configuration[$"ConnectionStrings:{db.Resource.Name}"] = await db.Resource.ConnectionStringExpression.GetValueAsync(default); 91hb.AddMongoDBClient(db.Resource.Name); 149hb.Configuration[$"ConnectionStrings:{db1.Resource.Name}"] = await db1.Resource.ConnectionStringExpression.GetValueAsync(default); 151hb.AddMongoDBClient(db1.Resource.Name); 196hb.Configuration[$"ConnectionStrings:{db2.Resource.Name}"] = await db2.Resource.ConnectionStringExpression.GetValueAsync(default); 198hb.AddMongoDBClient(db2.Resource.Name); 317hb.Configuration[$"ConnectionStrings:{db.Resource.Name}"] = await db.Resource.ConnectionStringExpression.GetValueAsync(default); 319hb.AddMongoDBClient(db.Resource.Name);
Aspire.Hosting.MySql (3)
MySqlBuilderExtensions.cs (3)
46throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{resource.Name}' resource but the connection string was null."); 103containerName ??= $"{builder.Resource.Name}-phpmyadmin"; 159writer.WriteLine($"$cfg['Servers'][$i]['verbose'] = '{mySqlInstance.Name}';");
Aspire.Hosting.MySql.Tests (19)
AddMySqlTests.cs (5)
47Assert.Equal("mysql", containerResource.Name); 230Assert.Single(builder.Resources.OfType<ContainerResource>().Where(resource => resource.Name is "mySql-phpmyadmin")); 249Assert.Equal($"{mysql.Resource.Name}:{mysql.Resource.PrimaryEndpoint.TargetPort}", config["PMA_HOST"]); 290string pattern1 = $@"\$cfg\['Servers'\]\[\$i\]\['host'\] = '{mysql1.Resource.Name}:{mysql1.Resource.PrimaryEndpoint.TargetPort}';"; 291string pattern2 = $@"\$cfg\['Servers'\]\[\$i\]\['host'\] = '{mysql2.Resource.Name}:{mysql2.Resource.PrimaryEndpoint.TargetPort}';";
MySqlFunctionalTests.cs (14)
52await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running, cts.Token); 54await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 58await rns.WaitForResourceHealthyAsync(resource.Resource.Name, cts.Token); 60await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token); 93[$"ConnectionStrings:{db.Resource.Name}"] = await db.Resource.ConnectionStringExpression.GetValueAsync(default) 96hb.AddMySqlDataSource(db.Resource.Name); 166[$"ConnectionStrings:{db1.Resource.Name}"] = await db1.Resource.ConnectionStringExpression.GetValueAsync(default) 169hb.AddMySqlDataSource(db1.Resource.Name); 236[$"ConnectionStrings:{db2.Resource.Name}"] = await db2.Resource.ConnectionStringExpression.GetValueAsync(default) 239hb.AddMySqlDataSource(db2.Resource.Name); 342[$"ConnectionStrings:{db.Resource.Name}"] = await db.Resource.ConnectionStringExpression.GetValueAsync(default) 345hb.AddMySqlDataSource(db.Resource.Name); 412[$"ConnectionStrings:{db.Resource.Name}"] = await db.Resource.ConnectionStringExpression.GetValueAsync(default) 415hb.AddMySqlDbContext<TestDbContext>(db.Resource.Name);
Aspire.Hosting.Nats.Tests (16)
AddNatsTests.cs (2)
97Assert.Equal("nats", containerResource.Name); 139Assert.Equal("nats", containerResource.Name);
NatsFunctionalTests.cs (14)
37await app.WaitForTextAsync("Listening for client connections", nats.Resource.Name); 41hb.Configuration[$"ConnectionStrings:{nats.Resource.Name}"] = await nats.Resource.ConnectionStringExpression.GetValueAsync(default); 82await app.WaitForTextAsync("Listening for client connections", nats.Resource.Name); 87hb.Configuration[$"ConnectionStrings:{nats.Resource.Name}"] = connectionString; 126await app.WaitForTextAsync("Listening for client connections", nats.Resource.Name); 135hb.Configuration[$"ConnectionStrings:{nats.Resource.Name}"] = modifiedConnectionString; 187await app.WaitForTextAsync("Listening for client connections", nats1.Resource.Name); 192hb.Configuration[$"ConnectionStrings:{nats1.Resource.Name}"] = await nats1.Resource.ConnectionStringExpression.GetValueAsync(default); 235await app.WaitForTextAsync("Listening for client connections", nats2.Resource.Name); 240hb.Configuration[$"ConnectionStrings:{nats2.Resource.Name}"] = await nats2.Resource.ConnectionStringExpression.GetValueAsync(default); 347await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running, cts.Token); 349await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 353await rns.WaitForResourceHealthyAsync(resource.Resource.Name, cts.Token); 355await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token);
Aspire.Hosting.Oracle (1)
OracleDatabaseBuilderExtensions.cs (1)
42throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{oracleDatabaseServer.Name}' resource but the connection string was null.");
Aspire.Hosting.Oracle.Tests (12)
OracleFunctionalTests.cs (12)
52hb.Configuration[$"ConnectionStrings:{db.Resource.Name}"] = await db.Resource.ConnectionStringExpression.GetValueAsync(default); 54hb.AddOracleDatabaseDbContext<TestDbContext>(db.Resource.Name); 135hb.Configuration[$"ConnectionStrings:{db1.Resource.Name}"] = await db1.Resource.ConnectionStringExpression.GetValueAsync(default); 137hb.AddOracleDatabaseDbContext<TestDbContext>(db1.Resource.Name); 196hb.Configuration[$"ConnectionStrings:{db2.Resource.Name}"] = await db2.Resource.ConnectionStringExpression.GetValueAsync(default); 198hb.AddOracleDatabaseDbContext<TestDbContext>(db2.Resource.Name); 310hb.Configuration[$"ConnectionStrings:{db.Resource.Name}"] = await db.Resource.ConnectionStringExpression.GetValueAsync(default); 312hb.AddOracleDatabaseDbContext<TestDbContext>(db.Resource.Name); 375await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running, cts.Token); 377await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 381await rns.WaitForResourceHealthyAsync(resource.Resource.Name, cts.Token); 383await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token);
Aspire.Hosting.PostgreSQL (4)
PostgresBuilderExtensions.cs (4)
61throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{postgresServer.Name}' resource but the connection string was null."); 146containerName ??= $"{builder.Resource.Name}-pgadmin"; 185writer.WriteString("Name", postgresInstance.Name); 279containerName ??= $"{builder.Resource.Name}-pgweb";
Aspire.Hosting.PostgreSQL.Tests (19)
AddPostgresTests.cs (3)
476Assert.Equal(pg1.Resource.Name, servers.GetProperty("1").GetProperty("Name").GetString()); 486Assert.Equal(pg2.Resource.Name, servers.GetProperty("2").GetProperty("Name").GetString()); 614host = "{postgresDatabase.Parent.Name}"
PostgresFunctionalTests.cs (16)
56await rns.WaitForResourceAsync(postgres.Resource.Name, KnownResourceStates.Running, cts.Token); 59await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 65await rns.WaitForResourceHealthyAsync(postgres.Resource.Name, cts.Token); 68await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token); 90await app.WaitForTextAsync("Listening at", resourceName: adminBuilder.Resource.Name); 92var client = app.CreateHttpClient(adminBuilder.Resource.Name, "http"); 123[$"ConnectionStrings:{db.Resource.Name}"] = await db.Resource.ConnectionStringExpression.GetValueAsync(default) 126hb.AddNpgsqlDataSource(db.Resource.Name); 167await app.WaitForTextAsync("Starting server...", resourceName: pgWebBuilder.Resource.Name); 169var client = app.CreateHttpClient(pgWebBuilder.Resource.Name, "http"); 239[$"ConnectionStrings:{db1.Resource.Name}"] = await db1.Resource.ConnectionStringExpression.GetValueAsync(default) 242hb.AddNpgsqlDataSource(db1.Resource.Name); 300[$"ConnectionStrings:{db2.Resource.Name}"] = await db2.Resource.ConnectionStringExpression.GetValueAsync(default) 303hb.AddNpgsqlDataSource(db2.Resource.Name); 392[$"ConnectionStrings:{db.Resource.Name}"] = await db.Resource.ConnectionStringExpression.GetValueAsync(default) 395hb.AddNpgsqlDataSource(db.Resource.Name);
Aspire.Hosting.Python.Tests (2)
AddPythonAppTests.cs (2)
145Assert.Equal("pythonProject", pythonProjectResource.Name); 220Assert.Equal("pythonProject", pythonProjectResource.Name);
Aspire.Hosting.Qdrant (3)
QdrantBuilderExtensions.cs (3)
56?? throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{qdrant.Name}' resource but the connection string was null."); 138context.EnvironmentVariables[$"ConnectionStrings__{qdrantResource.Resource.Name}"] = qdrantResource.Resource.ConnectionStringExpression; 141context.EnvironmentVariables[$"ConnectionStrings__{qdrantResource.Resource.Name}_{QdrantServerResource.HttpEndpointName}"] = qdrantResource.Resource.HttpConnectionStringExpression;
Aspire.Hosting.Qdrant.Tests (11)
AddQdrantTests.cs (1)
290Assert.Equal("my-qdrant", qdrantResource.Name);
QdrantFunctionalTests.cs (10)
46[$"ConnectionStrings:{qdrant.Resource.Name}"] = await qdrant.Resource.ConnectionStringExpression.GetValueAsync(default) 49hb.AddQdrantClient(qdrant.Resource.Name); 130[$"ConnectionStrings:{qdrant1.Resource.Name}"] = await qdrant1.Resource.ConnectionStringExpression.GetValueAsync(default) 133hb.AddQdrantClient(qdrant1.Resource.Name); 175[$"ConnectionStrings:{qdrant2.Resource.Name}"] = await qdrant2.Resource.ConnectionStringExpression.GetValueAsync(default) 178hb.AddQdrantClient(qdrant2.Resource.Name); 247await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running, cts.Token); 249await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 253await rns.WaitForResourceAsync(resource.Resource.Name, (re => re.Snapshot.HealthStatus == HealthStatus.Healthy), cts.Token); 255await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token);
Aspire.Hosting.RabbitMQ (3)
RabbitMQBuilderExtensions.cs (3)
50throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{rabbitMq.Name}' resource but the connection string was null."); 191throw new DistributedApplicationException($"Cannot configure the RabbitMQ resource '{builder.Resource.Name}' to enable the management plugin as it uses an unrecognized container image registry, name, or tag."); 245var nodeName = $"{builder.Resource.Name}@localhost";
Aspire.Hosting.RabbitMQ.Tests (11)
AddRabbitMQTests.cs (1)
54Assert.Equal("rabbit", containerResource.Name);
RabbitMQFunctionalTests.cs (10)
46await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running, cts.Token); 48await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 52await rns.WaitForResourceHealthyAsync(resource.Resource.Name, cts.Token); 54await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token); 74hb.Configuration[$"ConnectionStrings:{rabbitMQ.Resource.Name}"] = await rabbitMQ.Resource.ConnectionStringExpression.GetValueAsync(default); 75hb.AddRabbitMQClient(rabbitMQ.Resource.Name); 134hb.Configuration[$"ConnectionStrings:{rabbitMQ1.Resource.Name}"] = await rabbitMQ1.Resource.ConnectionStringExpression.GetValueAsync(default); 136hb.AddRabbitMQClient(rabbitMQ1.Resource.Name); 191hb.Configuration[$"ConnectionStrings:{rabbitMQ2.Resource.Name}"] = await rabbitMQ2.Resource.ConnectionStringExpression.GetValueAsync(default); 193hb.AddRabbitMQClient(rabbitMQ2.Resource.Name);
Aspire.Hosting.Redis.Tests (37)
AddRedisTests.cs (4)
34Assert.Equal("myRedis", containerResource.Name); 62Assert.Equal("myRedis", containerResource.Name); 225Assert.Equal($"myredis1:{redis.Resource.Name}:6379:0", config["REDIS_HOSTS"]); 249Assert.Equal($"myredis1:{redis1.Resource.Name}:6379:0,myredis2:myredis2:6379:0", config["REDIS_HOSTS"]);
RedisFunctionalTests.cs (33)
50await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running, cts.Token); 52await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 56await rns.WaitForResourceHealthyAsync(resource.Resource.Name, cts.Token); 58await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token); 79await app.WaitForTextAsync("Redis Connection", resourceName: commanderBuilder.Resource.Name); 81var client = app.CreateHttpClient(commanderBuilder.Resource.Name, "http"); 84var path = $"/apiv2/server/R:{redis.Resource.Name}:{endpoint.TargetPort}:0/info"; 105[$"ConnectionStrings:{redis.Resource.Name}"] = await redis.Resource.GetConnectionStringAsync() 108hb.AddRedisClient(redis.Resource.Name); 169using var client1 = app1.CreateHttpClient($"{redis1.Resource.Name}-insight", "http"); 174Assert.Equal($"{redis1.Resource.Name}", firstRunDatabases[0].Name); 206using var client2 = app2.CreateHttpClient($"{redisInsightBuilder.Resource.Name}", "http"); 211Assert.Equal($"{redis2.Resource.Name}", secondRunDatabases[0].Name); 223var latestEvent = await rns.WaitForResourceHealthyAsync(redisInsightBuilder.Resource.Name, cts.Token); 258var client = app.CreateHttpClient(redisInsightBuilder.Resource.Name, "http"); 269Assert.Equal(redis1.Resource.Name, db.Name); 270Assert.Equal(redis1.Resource.Name, db.Host); 277Assert.Equal(redis2.Resource.Name, db.Name); 278Assert.Equal(redis2.Resource.Name, db.Host); 316[$"ConnectionStrings:{redis1.Resource.Name}"] = $"{await redis1.Resource.GetConnectionStringAsync()},allowAdmin=true" 319hb.AddRedisClient(redis1.Resource.Name); 352[$"ConnectionStrings:{redis2.Resource.Name}"] = await redis2.Resource.GetConnectionStringAsync() 355hb.AddRedisClient(redis2.Resource.Name); 402[$"ConnectionStrings:{redis1.Resource.Name}"] = $"{await redis1.Resource.GetConnectionStringAsync()},allowAdmin=true" 405hb.AddRedisClient(redis1.Resource.Name); 437[$"ConnectionStrings:{redis2.Resource.Name}"] = await redis2.Resource.GetConnectionStringAsync() 440hb.AddRedisClient(redis2.Resource.Name); 486[$"ConnectionStrings:{redis1.Resource.Name}"] = $"{await redis1.Resource.GetConnectionStringAsync()},allowAdmin=true" 489hb.AddRedisClient(redis1.Resource.Name); 516[$"ConnectionStrings:{redis2.Resource.Name}"] = await redis2.Resource.GetConnectionStringAsync() 519hb.AddRedisClient(redis2.Resource.Name); 589var httpClient = app.CreateHttpClient(redisInsightBuilder1.Resource.Name, "http"); 632var httpClient = app.CreateHttpClient(redisInsightBuilder2.Resource.Name, "http");
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
44throw new DistributedApplicationException($"ConnectionStringAvailableEvent was published for the '{sqlServer.Name}' resource but the connection string was null.");
Aspire.Hosting.SqlServer.Tests (12)
AddSqlServerTests.cs (1)
47Assert.Equal("sqlserver", containerResource.Name);
SqlServerFunctionalTests.cs (11)
46await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running, cts.Token); 48await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 52await rns.WaitForResourceHealthyAsync(resource.Resource.Name, cts.Token); 54await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token); 81hb.Configuration[$"ConnectionStrings:{tempDb.Resource.Name}"] = await tempDb.Resource.ConnectionStringExpression.GetValueAsync(default); 83hb.AddSqlServerDbContext<TestDbContext>(tempDb.Resource.Name); 84hb.AddSqlServerClient(tempDb.Resource.Name); 185[$"ConnectionStrings:{masterdb1.Resource.Name}"] = await masterdb1.Resource.ConnectionStringExpression.GetValueAsync(default), 188hb1.AddSqlServerClient(masterdb1.Resource.Name); 267[$"ConnectionStrings:{masterdb2.Resource.Name}"] = await masterdb2.Resource.ConnectionStringExpression.GetValueAsync(default), 270hb2.AddSqlServerClient(masterdb2.Resource.Name);
Aspire.Hosting.Testing.Tests (2)
TestingBuilderTests.cs (1)
142Assert.Contains(appModel.GetProjectResources(), p => p.Name == "myworker1");
TestingFactoryTests.cs (1)
39Assert.Contains(appModel.GetProjectResources(), p => p.Name == "myworker1");
Aspire.Hosting.Tests (34)
AddParameterTests.cs (8)
147var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>(), r => r.Name == "pass"); 151var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 197var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>(), r => r.Name == "pass"); 201var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 255var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>(), r => r.Name == "pass"); 259var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 310var parameterResource = Assert.Single(appModel.Resources.OfType<ParameterResource>(), r => r.Name == "val"); 314var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "val")).DefaultTimeout();
Dashboard\DashboardResourceTests.cs (4)
52Assert.Equal("aspire-dashboard", dashboard.Name); 178Assert.Equal("aspire-dashboard", dashboard.Name); 465Assert.Equal("aspire-dashboard", dashboard.Name); 520Assert.Equal("aspire-dashboard", dashboard.Name);
DistributedApplicationTests.cs (6)
197using var clientA = app.CreateHttpClient(testProgram.ServiceABuilder.Resource.Name, "http"); 198using var clientC = app.CreateHttpClient(testProgram.ServiceCBuilder.Resource.Name, "http"); 205var uri = app.GetEndpoint(testProgram.ServiceBBuilder.Resource.Name, "http"); 747var httpEndPoint = app.GetEndpoint(testProgram.ServiceABuilder.Resource.Name, endpointName: "http"); 765var httpsEndpoint = app.GetEndpoint(testProgram.ServiceABuilder.Resource.Name, endpointName: "https"); 812using var clientA = app.CreateHttpClient(servicea.Resource.Name, "http");
HealthCheckTests.cs (4)
88await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running).DefaultTimeout(TestConstants.LongTimeoutDuration); 90await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting).DefaultTimeout(TestConstants.LongTimeoutDuration); 94await rns.WaitForResourceHealthyAsync(resource.Resource.Name).DefaultTimeout(TestConstants.LongTimeoutDuration); 96await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running).DefaultTimeout(TestConstants.LongTimeoutDuration);
ProjectResourceTests.cs (2)
73Assert.Equal("projectName", resource.Name); 187Assert.Equal("projectName", resource.Name);
SlimTestProgramTests.cs (3)
34using var clientA = app.CreateHttpClient(testProgram.ServiceABuilder.Resource.Name, "http"); 37using var clientB = app.CreateHttpClient(testProgram.ServiceBBuilder.Resource.Name, "http"); 40using var clientC = app.CreateHttpClient(testProgram.ServiceCBuilder.Resource.Name, "http");
TestProgramFixture.cs (3)
69using var clientA = App.CreateHttpClient(TestProgram.ServiceABuilder.Resource.Name, "http"); 73using var clientB = App.CreateHttpClient(TestProgram.ServiceBBuilder.Resource.Name, "http"); 77using var clientC = App.CreateHttpClient(TestProgram.ServiceCBuilder.Resource.Name, "http");
WaitForTests.cs (3)
32await rns.WaitForResourceAsync(throwingResource.Resource.Name, KnownResourceStates.FailedToStart, abortCts.Token); 33await rns.WaitForResourceAsync(dependingContainerResource.Resource.Name, KnownResourceStates.FailedToStart, abortCts.Token); 34await rns.WaitForResourceAsync(dependingExecutableResource.Resource.Name, KnownResourceStates.FailedToStart, abortCts.Token);
WithEndpointTests.cs (1)
217Assert.Equal("foo", resource.Name);
Aspire.Hosting.Valkey.Tests (12)
AddValkeyTests.cs (2)
25Assert.Equal("myValkey", containerResource.Name); 53Assert.Equal("myValkey", containerResource.Name);
ValkeyFunctionalTests.cs (10)
36[$"ConnectionStrings:{valkey.Resource.Name}"] = await valkey.Resource.ConnectionStringExpression.GetValueAsync(default) 39hb.AddRedisClient(valkey.Resource.Name); 97[$"ConnectionStrings:{valkey1.Resource.Name}"] = $"{await valkey1.Resource.ConnectionStringExpression.GetValueAsync(default)},allowAdmin=true" 100hb.AddRedisClient(valkey1.Resource.Name); 148[$"ConnectionStrings:{valkey2.Resource.Name}"] = await valkey2.Resource.ConnectionStringExpression.GetValueAsync(default) 151hb.AddRedisClient(valkey2.Resource.Name); 221await rns.WaitForResourceAsync(resource.Resource.Name, KnownResourceStates.Running, cts.Token); 223await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Waiting, cts.Token); 227await rns.WaitForResourceHealthyAsync(resource.Resource.Name, cts.Token); 229await rns.WaitForResourceAsync(dependentResource.Resource.Name, KnownResourceStates.Running, cts.Token);
Aspire.Playground.Tests (3)
Infrastructure\DistributedApplicationExtensions.cs (3)
31builder.Configuration[$"Parameters:{parameter.Name}"] = parameter.Secret 218using (var checkHttpClient = app.CreateHttpClient(project.Name)) 246using var applyMigrationsHttpClient = app.CreateHttpClient(project.Name, useHttpClientFactory: false);
KafkaBasic.AppHost (2)
Program.cs (2)
11.WithArgs(kafka.Resource.Name); 15.WithArgs(kafka.Resource.Name);
TestProject.AppHost (1)
TestProgram.cs (1)
150root[project.Name] = projectJson;