111 references to Port
Aspire.Hosting (5)
ApplicationModel\EndpointReference.cs (2)
176EndpointProperty.Port => Binding("port"), 446EndpointProperty.Port => new(allocatedEndpoint.Port.ToString(CultureInfo.InvariantCulture)),
ApplicationModel\HostUrl.cs (1)
84var port = await targetEndpoint.Property(EndpointProperty.Port).GetValueAsync(context, cancellationToken).ConfigureAwait(false);
ApplicationModel\IComputeEnvironmentResource.cs (1)
64EndpointProperty.Port => ReferenceExpression.Create($"{port.ToString(CultureInfo.InvariantCulture)}"),
ProjectResourceBuilderExtensions.cs (1)
1211context.EnvironmentVariables[KnownAspNetCoreConfigNames.HttpsPort] = e.Property(EndpointProperty.Port);
Aspire.Hosting.Azure.AppContainers (2)
AzureContainerAppEnvironmentResource.cs (1)
454EndpointProperty.Port => ReferenceExpression.Create($"{port.ToString(CultureInfo.InvariantCulture)}"),
BaseContainerAppContext.cs (1)
213EndpointProperty.Port => port.ToString(CultureInfo.InvariantCulture),
Aspire.Hosting.Azure.AppService (2)
AzureAppServiceEnvironmentResource.cs (1)
582EndpointProperty.Port => ReferenceExpression.Create($"{port.ToString(CultureInfo.InvariantCulture)}"),
AzureAppServiceWebsiteContext.cs (1)
948EndpointProperty.Port => mapping.Port.ToString(CultureInfo.InvariantCulture),
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBEmulatorConnectionString.cs (1)
14: ReferenceExpression.Create($"AccountKey={CosmosConstants.EmulatorAccountKey};AccountEndpoint=https://{endpoint.Property(EndpointProperty.IPV4Host)}:{endpoint.Property(EndpointProperty.Port)};DisableServerCertificateValidation=True;");
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsResource.cs (1)
81ReferenceExpression.Create($"{EmulatorEndpoint.Property(EndpointProperty.Port)}") :
Aspire.Hosting.Azure.Functions (1)
DurableTask\DurableTaskSchedulerResource.cs (1)
36return ReferenceExpression.Create($"Endpoint={grpcEndpoint.Property(EndpointProperty.Scheme)}://{grpcEndpoint.Property(EndpointProperty.Host)}:{grpcEndpoint.Property(EndpointProperty.Port)};Authentication=None");
Aspire.Hosting.Azure.Sandboxes (2)
AzureSandboxEndpointPropertyValueProvider.cs (2)
88EndpointProperty.Port => "443", 106EndpointProperty.Port => uri.Port.ToString(CultureInfo.InvariantCulture),
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusResource.cs (1)
71ReferenceExpression.Create($"{EmulatorEndpoint.Property(EndpointProperty.Port)}") :
Aspire.Hosting.Azure.Storage (1)
AzureStorageEmulatorConnectionString.cs (1)
35builder.Append($"{key}={endpoint.Property(EndpointProperty.Scheme)}://{endpoint.Property(EndpointProperty.IPV4Host)}:{endpoint.Property(EndpointProperty.Port)}/devstoreaccount1;");
Aspire.Hosting.Azure.Tests (9)
AzureAppServiceTests.cs (1)
1201[InlineData(EndpointProperty.Port, "443")]
AzureContainerAppExpressEndpointTests.cs (4)
44EndpointProperty.HostAndPort, EndpointProperty.Port, EndpointProperty.TargetPort, 108[EndpointProperty.Port] = "443", 126[InlineData(EndpointProperty.Port, "443")] 147[InlineData(EndpointProperty.Port)]
AzureContainerAppsTests.cs (3)
424context.EnvironmentVariables["PORT"] = httpEp.Property(EndpointProperty.Port); 530context.EnvironmentVariables["PORT"] = httpEp.Property(EndpointProperty.Port); 2888[InlineData(EndpointProperty.Port, "443")]
src\Aspire.Hosting.Azure.Storage\AzureStorageEmulatorConnectionString.cs (1)
35builder.Append($"{key}={endpoint.Property(EndpointProperty.Scheme)}://{endpoint.Property(EndpointProperty.IPV4Host)}:{endpoint.Property(EndpointProperty.Port)}/devstoreaccount1;");
Aspire.Hosting.DevTunnels (1)
DevTunnelResource.cs (1)
106return await GetResolvedEndpointPortAsync(EndpointProperty.Port, cancellationToken).ConfigureAwait(false)
Aspire.Hosting.Docker (1)
DockerComposeServiceResourceExtensions.cs (1)
141EndpointProperty.Port => mapping.InternalPort,
Aspire.Hosting.Garnet (1)
GarnetResource.cs (1)
43public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port);
Aspire.Hosting.Kafka (2)
KafkaBuilderExtensions.cs (1)
247? ReferenceExpression.Create($"PLAINTEXT://localhost:29092,PLAINTEXT_HOST://localhost:{primaryEndpoint.Property(EndpointProperty.Port)},PLAINTEXT_INTERNAL://{resource.Name}:{internalEndpoint.Property(EndpointProperty.TargetPort)}")
KafkaServerResource.cs (1)
40public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port);
Aspire.Hosting.Kubernetes (2)
KubernetesResource.cs (2)
614_ => GetEndpointValue(mapping, epExpr.Property, embedded && epExpr.Property is EndpointProperty.Port or EndpointProperty.TargetPort) 793EndpointProperty.Port => GetPort(servicePort),
Aspire.Hosting.Kubernetes.Tests (1)
KubernetesPublisherTests.cs (1)
71.WithEnvironment("PORT", web.GetEndpoint("HTTP").Property(EndpointProperty.Port));
Aspire.Hosting.Maui (1)
MauiOtlpExtensions.cs (1)
328var allocatedPort = await TryGetEndpointPortAsync(endpointReference, EndpointProperty.Port, cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Milvus (1)
MilvusServerResource.cs (1)
50public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port);
Aspire.Hosting.MongoDB (1)
MongoDBServerResource.cs (1)
52public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port);
Aspire.Hosting.MySql (2)
MySqlServerResource.cs (2)
47public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port); 59$"Server={PrimaryEndpoint.Property(EndpointProperty.Host)};Port={PrimaryEndpoint.Property(EndpointProperty.Port)};User ID={DefaultUserName};Password={PasswordParameter}");
Aspire.Hosting.Nats (1)
NatsServerResource.cs (1)
47public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port);
Aspire.Hosting.Oracle (1)
OracleDatabaseServerResource.cs (1)
44public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port);
Aspire.Hosting.PostgreSQL (2)
PostgresServerResource.cs (2)
61$"Host={PrimaryEndpoint.Property(EndpointProperty.Host)};Port={PrimaryEndpoint.Property(EndpointProperty.Port)};Username={UserNameReference};Password={PasswordParameter}"); 117public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port);
Aspire.Hosting.Qdrant (2)
QdrantServerResource.cs (2)
50public EndpointReferenceExpression GrpcPort => PrimaryEndpoint.Property(EndpointProperty.Port); 65public EndpointReferenceExpression HttpPort => HttpEndpoint.Property(EndpointProperty.Port);
Aspire.Hosting.RabbitMQ (1)
RabbitMQServerResource.cs (1)
53public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port);
Aspire.Hosting.Radius (2)
Publishing\RadiusInfrastructureBuilder.cs (1)
3383case EndpointProperty.Port or EndpointProperty.TargetPort:
RadiusEnvironmentResource.cs (1)
209EndpointProperty.Port => GuardedAddress(endpointReference, () => ReferenceExpression.Create($"{RadiusServiceDiscovery.ToInvariantString(port.Value)}")),
Aspire.Hosting.Radius.Tests (5)
Publishing\BackingResourceContractTests.cs (1)
127[InlineData(EndpointProperty.Port)]
Publishing\BackingResourceProjectionTests.cs (1)
91.WithEnvironment("CUSTOM_PORT", cache.GetEndpoint("tcp").Property(EndpointProperty.Port))
Publishing\BackingResourceValueResolutionTests.cs (2)
987.WithEnvironment("CACHE_PORT", cache.GetEndpoint("tcp").Property(EndpointProperty.Port)); 1190var port = cache.GetEndpoint("tcp").Property(EndpointProperty.Port);
RadiusEnvironmentResourceTests.cs (1)
95[InlineData(EndpointProperty.Port, "8080")]
Aspire.Hosting.Redis (1)
RedisResource.cs (1)
62public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port);
Aspire.Hosting.Seq (1)
SeqResource.cs (1)
33public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port);
Aspire.Hosting.SqlServer (2)
SqlServerServerResource.cs (2)
44public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port); 53$"Server={PrimaryEndpoint.Property(EndpointProperty.IPV4Host)},{PrimaryEndpoint.Property(EndpointProperty.Port)};User ID={DefaultUserName};Password={PasswordParameter};TrustServerCertificate=true");
Aspire.Hosting.Tests (47)
ComputeEnvironmentValidationTests.cs (1)
88[InlineData(EndpointProperty.Port, "8080")]
Dcp\DcpExecutorTests.cs (30)
771.WithArgs(c => c.Args.Add(endpoint.Property(EndpointProperty.Port))); 811c.Args.Add(executable.GetEndpoint("http").Property(EndpointProperty.Port)); 5016Assert.Equal(allocatedPort.ToString(CultureInfo.InvariantCulture), await database.GetEndpoint("NoPortTargetPortSet").Property(EndpointProperty.Port).GetValueAsync()); 5032database.WithEnvironment("PUBLIC_PORT", database.GetEndpoint("NoPortTargetPortSet").Property(EndpointProperty.Port)); 5033database.WithEnvironment("PUBLIC_PORT_AGAIN", database.GetEndpoint("NoPortTargetPortSet").Property(EndpointProperty.Port)); 10293.WithEnvironment("EXE_PROXIED_PORT", executable.GetEndpoint("proxied").Property(EndpointProperty.Port)) 10294.WithEnvironment("EXE_NOTPROXIED_PORT", executable.GetEndpoint("notProxied").Property(EndpointProperty.Port)); 10300.WithEnvironment("EXE_PROXIED_PORT", executable.GetEndpoint("proxied").Property(EndpointProperty.Port)) 10301.WithEnvironment("EXE_NOTPROXIED_PORT", executable.GetEndpoint("notProxied").Property(EndpointProperty.Port)); 10484c.EnvironmentVariables["EXEC_PORT"] = executable.GetEndpoint("http").Property(EndpointProperty.Port); 10519c.EnvironmentVariables["EXEC_PORT"] = executable.GetEndpoint("http").Property(EndpointProperty.Port); 10560c.Args.Add(executable.GetEndpoint("http").Property(EndpointProperty.Port)); 10796c.Args.Add(executable.GetEndpoint("http").Property(EndpointProperty.Port)); 10833.WithEnvironment("EXEC_PORT", executable.GetEndpoint("http").Property(EndpointProperty.Port)); 10864.WithEnvironment("EXECUTABLE_PORT", executable.GetEndpoint("http").Property(EndpointProperty.Port)); 10897$"{containerEndpoint.Property(EndpointProperty.Scheme)}://{containerEndpoint.Property(EndpointProperty.Host)}:{containerEndpoint.Property(EndpointProperty.Port)}")) 10898.WithEnvironment("HOST_PORT", executable.GetEndpoint("unused").Property(EndpointProperty.Port)); 10942.WithEnvironment("TARGET_PORT", targetEndpoint.Property(EndpointProperty.Port)); 10986project.GetEndpoint("http", KnownNetworkIdentifiers.DefaultAspireContainerNetwork).Property(EndpointProperty.Port)); 11025target.GetEndpoint("http", KnownNetworkIdentifiers.DefaultAspireContainerNetwork).Property(EndpointProperty.Port)); 11062executable.GetEndpoint("http", KnownNetworkIdentifiers.DefaultAspireContainerNetwork).Property(EndpointProperty.Port)); 11131executable.GetEndpoint("udp", KnownNetworkIdentifiers.DefaultAspireContainerNetwork).Property(EndpointProperty.Port)); 11186target.GetEndpoint("http", KnownNetworkIdentifiers.DefaultAspireContainerNetwork).Property(EndpointProperty.Port)); 11227context.EnvironmentVariables["CONTAINER_PORT"] = containerEndpoint.Property(EndpointProperty.Port); 11276executable.GetEndpoint("http", KnownNetworkIdentifiers.DefaultAspireContainerNetwork).Property(EndpointProperty.Port)); 11316.WithEnvironment("TARGET_PORT", containerEndpoint.Property(EndpointProperty.Port)); 11318.WithEnvironment("TARGET_PORT", target.GetEndpoint("http").Property(EndpointProperty.Port)); 11374.WithEnvironment("EXEC_A_PORT", executableA.GetEndpoint("http").Property(EndpointProperty.Port)); 11380.WithEnvironment("EXEC_B_PORT", executableB.GetEndpoint("http").Property(EndpointProperty.Port)) 11437.WithEnvironment("UPSTREAM_PORT", upstreamExecutable.GetEndpoint("http").Property(EndpointProperty.Port))
EndpointReferenceTests.cs (6)
127var portExpr = endpointRef.Property(EndpointProperty.Port); 227var expr3 = endpointRef.Property(EndpointProperty.Port); 354[InlineData(EndpointProperty.Port, ResourceKind.Host, ResourceKind.Host, "1234")] 355[InlineData(EndpointProperty.Port, ResourceKind.Host, ResourceKind.Container, "1234")] 356[InlineData(EndpointProperty.Port, ResourceKind.Container, ResourceKind.Host, "1234")] 357[InlineData(EndpointProperty.Port, ResourceKind.Container, ResourceKind.Container, "4567")]
ExpressionResolverTests.cs (6)
380{ "TwoFullEndpoints", ReferenceExpression.Create($"Test1={Endpoint1.Property(EndpointProperty.Scheme)}://{Endpoint1.Property(EndpointProperty.IPV4Host)}:{Endpoint1.Property(EndpointProperty.Port)}/;Test2={Endpoint2.Property(EndpointProperty.Scheme)}://{Endpoint2.Property(EndpointProperty.Host)}:{Endpoint2.Property(EndpointProperty.Port)}/;") }, 384{ "OnlyPort", ReferenceExpression.Create($"Port={Endpoint1.Property(EndpointProperty.Port)};") }, 386{ "PortBeforeHost", ReferenceExpression.Create($"Port={Endpoint1.Property(EndpointProperty.Port)};Host={Endpoint1.Property(EndpointProperty.Host)};") }, 387{ "FullAndPartial", ReferenceExpression.Create($"Test1={Endpoint1.Property(EndpointProperty.Scheme)}://{Endpoint1.Property(EndpointProperty.IPV4Host)}:{Endpoint1.Property(EndpointProperty.Port)}/;Test2={Endpoint2.Property(EndpointProperty.Scheme)}://localhost:{Endpoint2.Property(EndpointProperty.Port)}/;") },
ResourceDependencyTests.cs (1)
55.WithEnvironment("API_PORT", api.GetEndpoint("http").Property(EndpointProperty.Port));
WithEnvironmentTests.cs (3)
68.WithEnvironment("PORT", $"{endpoint.Property(EndpointProperty.Port)}") 116.WithEnvironment("URL", $"{endpoint.Property(EndpointProperty.Host)}:{endpoint.Property(EndpointProperty.Port)}"); 468var portProperty = endpoint.Property(EndpointProperty.Port);
Aspire.Hosting.Valkey (1)
ValkeyResource.cs (1)
48public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port);
Aspire.Hosting.Yarp (1)
YarpResourceExtensions.cs (1)
72.WithEnvironment("ASPNETCORE_HTTPS_PORT", resource.GetEndpoint("https").Property(EndpointProperty.Port))
AspireWithNode.AppHost (1)
AppHost.cs (1)
44ctx.EnvironmentVariables["HTTPS_REDIRECT_PORT"] = httpsEndpoint.Property(EndpointProperty.Port);
Stress.AppHost (5)
AppHost.cs (5)
25.WithArgs(c => c.Args.Add(manualArgEndpoint.Property(EndpointProperty.Port))); 29.WithArgs(c => c.Args.Add(manualArgEndpoint.Property(EndpointProperty.Port))); 34.WithArgs(c => c.Args.Add(manualArgEndpoint.Property(EndpointProperty.Port))); 38.WithArgs(c => c.Args.Add(manualArgEndpoint.Property(EndpointProperty.Port))) 76.WithEnvironment("PORT", $"{serviceBuilder.GetEndpoint("http").Property(EndpointProperty.Port)}")