266 references to EndpointProperty
Aspire.Hosting (40)
ApplicationModel\EndpointReference.cs (30)
73
public ValueTask<string?> GetValueAsync(CancellationToken cancellationToken = default) => Property(
EndpointProperty
.Url).GetValueAsync(cancellationToken);
81
public ValueTask<string?> GetValueAsync(ValueProviderContext context, CancellationToken cancellationToken = default) => Property(
EndpointProperty
.Url).GetValueAsync(context, cancellationToken);
93
internal string GetExpression(
EndpointProperty
property =
EndpointProperty
.Url)
97
EndpointProperty
.Url => Binding("url"),
98
EndpointProperty
.Host or
EndpointProperty
.IPV4Host => Binding("host"),
99
EndpointProperty
.Port => Binding("port"),
100
EndpointProperty
.Scheme => Binding("scheme"),
101
EndpointProperty
.TargetPort => Binding("targetPort"),
102
EndpointProperty
.HostAndPort => $"{Binding("host")}:{Binding("port")}",
112
/// <param name="property">The <see cref="
EndpointProperty
"/> enum value to use in the reference.</param>
113
/// <returns>An <see cref="EndpointReferenceExpression"/> representing the specified <see cref="
EndpointProperty
"/>.</returns>
114
public EndpointReferenceExpression Property(
EndpointProperty
property)
258
public class EndpointReferenceExpression(EndpointReference endpointReference,
EndpointProperty
property) : IManifestExpressionProvider, IValueProvider, IValueWithReferences
266
/// Gets the <see cref="
EndpointProperty
"/> for the property expression.
268
public
EndpointProperty
Property { get; } = property;
280
/// <returns>A <see cref="string"/> containing the selected <see cref="
EndpointProperty
"/> value.</returns>
281
/// <exception cref="InvalidOperationException">Throws when the selected <see cref="
EndpointProperty
"/> enumeration is not known.</exception>
292
/// <returns>A <see cref="string"/> containing the selected <see cref="
EndpointProperty
"/> value.</returns>
293
/// <exception cref="InvalidOperationException">Throws when the selected <see cref="
EndpointProperty
"/> enumeration is not known.</exception>
302
EndpointProperty
.Scheme => new(Endpoint.Scheme),
303
EndpointProperty
.IPV4Host when networkContext == KnownNetworkIdentifiers.LocalhostNetwork => "127.0.0.1",
304
EndpointProperty
.TargetPort when Endpoint.TargetPort is int port => new(port.ToString(CultureInfo.InvariantCulture)),
328
EndpointProperty
.Url => new(allocatedEndpoint.UriString),
329
EndpointProperty
.Host => new(allocatedEndpoint.Address),
330
EndpointProperty
.IPV4Host => new(allocatedEndpoint.Address),
331
EndpointProperty
.Port => new(allocatedEndpoint.Port.ToString(CultureInfo.InvariantCulture)),
332
EndpointProperty
.TargetPort => new(ComputeTargetPort(allocatedEndpoint)),
333
EndpointProperty
.HostAndPort => new($"{allocatedEndpoint.Address}:{allocatedEndpoint.Port.ToString(CultureInfo.InvariantCulture)}"),
Dashboard\DashboardEventHandlers.cs (4)
656
ReferenceExpression.Create($"{e.Property(
EndpointProperty
.Scheme)}://{e.EndpointAnnotation.TargetHost}:{e.Property(
EndpointProperty
.TargetPort)}");
702
aspnetCoreUrls.Append($"{e.Property(
EndpointProperty
.Scheme)}://{e.EndpointAnnotation.TargetHost}:{e.Property(
EndpointProperty
.TargetPort)}");
ProjectResourceBuilderExtensions.cs (5)
916
context.EnvironmentVariables["ASPNETCORE_HTTPS_PORT"] = e.Property(
EndpointProperty
.Port);
921
aspnetCoreUrls.Append($"{e.Property(
EndpointProperty
.Scheme)}://{e.EndpointAnnotation.TargetHost}:{e.Property(
EndpointProperty
.TargetPort)}");
966
ports.Append($"{e.Property(
EndpointProperty
.TargetPort)}");
998
var url = ReferenceExpression.Create($"{e.EndpointAnnotation.UriScheme}://{host}:{e.Property(
EndpointProperty
.TargetPort)}");
ResourceBuilderExtensions.cs (1)
942
context.EnvironmentVariables[env] = endpointReference.Property(
EndpointProperty
.TargetPort);
Aspire.Hosting.Azure.AppConfiguration (1)
AzureAppConfigurationResource.cs (1)
48
? ReferenceExpression.Create($"Endpoint={EmulatorEndpoint.Property(
EndpointProperty
.Url)};Id=anonymous;Secret=abcdefghijklmnopqrstuvwxyz1234567890;Anonymous=True")
Aspire.Hosting.Azure.AppContainers (10)
BaseContainerAppContext.cs (10)
187
private BicepValue<string> GetEndpointValue(EndpointMapping mapping,
EndpointProperty
property)
205
EndpointProperty
.Url => GetHostValue($"{scheme}://", suffix: isHttpIngress ? null : $":{port}"),
206
EndpointProperty
.Host or
EndpointProperty
.IPV4Host => GetHostValue(),
207
EndpointProperty
.Port => port.ToString(CultureInfo.InvariantCulture),
208
EndpointProperty
.HostAndPort => GetHostValue(suffix: $":{port}"),
209
EndpointProperty
.TargetPort => targetPort is null ? AllocateContainerPortParameter() : $"{targetPort}",
210
EndpointProperty
.Scheme => scheme,
230
var url = GetEndpointValue(mapping,
EndpointProperty
.Url);
507
Port = AsInt(GetEndpointValue(endpointMapping,
EndpointProperty
.TargetPort)),
Aspire.Hosting.Azure.AppService (11)
AzureAppServiceWebsiteContext.cs (11)
154
(GetEndpointValue(context._slotEndpointMapping[ep.EndpointName],
EndpointProperty
.Url), secretType) :
155
(GetEndpointValue(context._endpointMapping[ep.EndpointName],
EndpointProperty
.Url), secretType);
392
var targetPort = GetEndpointValue(mapping,
EndpointProperty
.TargetPort);
742
private BicepValue<string> GetEndpointValue(EndpointMapping mapping,
EndpointProperty
property)
746
EndpointProperty
.Url => BicepFunction.Interpolate($"{mapping.Scheme}://{mapping.Host}.azurewebsites.net"),
747
EndpointProperty
.Host => BicepFunction.Interpolate($"{mapping.Host}.azurewebsites.net"),
748
EndpointProperty
.Port => mapping.Port.ToString(CultureInfo.InvariantCulture),
749
EndpointProperty
.TargetPort => mapping.TargetPort?.ToString(CultureInfo.InvariantCulture) ?? (BicepValue<string>)AllocateParameter(new ContainerPortReference(Resource)),
750
EndpointProperty
.Scheme => mapping.Scheme,
751
EndpointProperty
.HostAndPort => BicepFunction.Interpolate($"{mapping.Host}.azurewebsites.net"),
752
EndpointProperty
.IPV4Host => BicepFunction.Interpolate($"{mapping.Host}.azurewebsites.net"),
Aspire.Hosting.Azure.CosmosDB (6)
AzureCosmosDBEmulatorConnectionString.cs (3)
13
? ReferenceExpression.Create($"AccountKey={CosmosConstants.EmulatorAccountKey};AccountEndpoint={endpoint.Property(
EndpointProperty
.Url)}")
14
: ReferenceExpression.Create($"AccountKey={CosmosConstants.EmulatorAccountKey};AccountEndpoint=https://{endpoint.Property(
EndpointProperty
.IPV4Host)}:{endpoint.Property(
EndpointProperty
.Port)};DisableServerCertificateValidation=True;");
AzureCosmosDBResource.cs (3)
102
ReferenceExpression.Create($"{EmulatorEndpoint.Property(
EndpointProperty
.Url)}") :
103
ReferenceExpression.Create($"https://{EmulatorEndpoint.Property(
EndpointProperty
.IPV4Host)}:{EmulatorEndpoint.Property(
EndpointProperty
.Port)}") :
Aspire.Hosting.Azure.EventHubs (5)
AzureEventHubsResource.cs (5)
65
ReferenceExpression.Create($"{EmulatorEndpoint.Property(
EndpointProperty
.Host)}") :
77
ReferenceExpression.Create($"{EmulatorEndpoint.Property(
EndpointProperty
.Port)}") :
88
ReferenceExpression.Create($"sb://{EmulatorEndpoint.Property(
EndpointProperty
.HostAndPort)}") :
102
builder.Append($"Endpoint=sb://{EmulatorEndpoint.Property(
EndpointProperty
.HostAndPort)};SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true");
212
yield return new("ConnectionString", ReferenceExpression.Create($"Endpoint={EmulatorEndpoint.Property(
EndpointProperty
.HostAndPort)};SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true"));
Aspire.Hosting.Azure.Functions (2)
AzureFunctionsProjectResourceExtensions.cs (2)
213
context.EnvironmentVariables["ASPNETCORE_URLS"] = ReferenceExpression.Create($"http://+:{endpoint.Property(
EndpointProperty
.TargetPort)}");
300
context.Args.Add(targetEndpoint.Property(
EndpointProperty
.TargetPort));
Aspire.Hosting.Azure.KeyVault (2)
AzureKeyVaultResource.cs (2)
56
ReferenceExpression.Create($"{EmulatorEndpoint.Property(
EndpointProperty
.Url)}") :
72
ReferenceExpression.Create($"{EmulatorEndpoint.Property(
EndpointProperty
.Url)}") :
Aspire.Hosting.Azure.PostgreSQL (1)
AzurePostgresFlexibleServerResource.cs (1)
90
ReferenceExpression.Create($"{InnerResource.PrimaryEndpoint.Property(
EndpointProperty
.HostAndPort)}") :
Aspire.Hosting.Azure.Redis (2)
AzureManagedRedisResource.cs (1)
95
ReferenceExpression.Create($"{InnerResource.PrimaryEndpoint.Property(
EndpointProperty
.Host)}") :
AzureRedisCacheResource.cs (1)
79
ReferenceExpression.Create($"{InnerResource.PrimaryEndpoint.Property(
EndpointProperty
.HostAndPort)}") :
Aspire.Hosting.Azure.ServiceBus (4)
AzureServiceBusResource.cs (4)
55
ReferenceExpression.Create($"{EmulatorEndpoint.Property(
EndpointProperty
.Host)}") :
67
ReferenceExpression.Create($"{EmulatorEndpoint.Property(
EndpointProperty
.Port)}") :
78
ReferenceExpression.Create($"sb://{EmulatorEndpoint.Property(
EndpointProperty
.HostAndPort)}") :
86
? ReferenceExpression.Create($"Endpoint=sb://{EmulatorEndpoint.Property(
EndpointProperty
.HostAndPort)};SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;")
Aspire.Hosting.Azure.SignalR (2)
AzureSignalRResource.cs (2)
52
ReferenceExpression.Create($"{EmulatorEndpoint.Property(
EndpointProperty
.Url)}") :
60
ReferenceExpression.Create($"Endpoint={EmulatorEndpoint.Property(
EndpointProperty
.Url)};AccessKey=ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGH;Version=1.0;"):
Aspire.Hosting.Azure.Sql (1)
AzureSqlServerResource.cs (1)
72
ReferenceExpression.Create($"{InnerResource!.PrimaryEndpoint.Property(
EndpointProperty
.Host)}") :
Aspire.Hosting.Azure.Storage (6)
AzureStorageEmulatorConnectionString.cs (3)
35
builder.Append($"{key}={endpoint.Property(
EndpointProperty
.Scheme)}://{endpoint.Property(
EndpointProperty
.IPV4Host)}:{endpoint.Property(
EndpointProperty
.Port)}/devstoreaccount1;");
AzureStorageResource.cs (3)
82
? ReferenceExpression.Create($"{EmulatorBlobEndpoint.Property(
EndpointProperty
.Url)}")
102
? ReferenceExpression.Create($"{EmulatorQueueEndpoint.Property(
EndpointProperty
.Url)}")
112
? ReferenceExpression.Create($"{EmulatorTableEndpoint.Property(
EndpointProperty
.Url)}")
Aspire.Hosting.Azure.Tests (16)
AzureContainerAppsTests.cs (12)
314
context.EnvironmentVariables["TARGET_PORT"] = httpEp.Property(
EndpointProperty
.TargetPort);
315
context.EnvironmentVariables["PORT"] = httpEp.Property(
EndpointProperty
.Port);
316
context.EnvironmentVariables["HOST"] = httpEp.Property(
EndpointProperty
.Host);
317
context.EnvironmentVariables["HOSTANDPORT"] = httpEp.Property(
EndpointProperty
.HostAndPort);
318
context.EnvironmentVariables["SCHEME"] = httpEp.Property(
EndpointProperty
.Scheme);
319
context.EnvironmentVariables["INTERNAL_HOSTANDPORT"] = internalEp.Property(
EndpointProperty
.HostAndPort);
391
context.EnvironmentVariables["TARGET_PORT"] = httpEp.Property(
EndpointProperty
.TargetPort);
392
context.EnvironmentVariables["PORT"] = httpEp.Property(
EndpointProperty
.Port);
393
context.EnvironmentVariables["HOST"] = httpEp.Property(
EndpointProperty
.Host);
394
context.EnvironmentVariables["HOSTANDPORT"] = httpEp.Property(
EndpointProperty
.HostAndPort);
395
context.EnvironmentVariables["SCHEME"] = httpEp.Property(
EndpointProperty
.Scheme);
396
context.EnvironmentVariables["INTERNAL_HOSTANDPORT"] = internalEp.Property(
EndpointProperty
.HostAndPort);
AzureProvisioningResourceExtensionsTests.cs (1)
21
var referenceExpression = ReferenceExpression.Create($"prefix:{endpointReference.Property(
EndpointProperty
.HostAndPort)}");
src\Aspire.Hosting.Azure.Storage\AzureStorageEmulatorConnectionString.cs (3)
35
builder.Append($"{key}={endpoint.Property(
EndpointProperty
.Scheme)}://{endpoint.Property(
EndpointProperty
.IPV4Host)}:{endpoint.Property(
EndpointProperty
.Port)}/devstoreaccount1;");
Aspire.Hosting.Docker (9)
DockerComposeServiceResourceExtensions.cs (9)
26
var url = GetValue(mapping,
EndpointProperty
.Url);
88
private static string GetValue(DockerComposeServiceResource.EndpointMapping mapping,
EndpointProperty
property)
92
EndpointProperty
.Url => GetHostValue($"{mapping.Scheme}://", $":{mapping.InternalPort}"),
93
EndpointProperty
.Host or
EndpointProperty
.IPV4Host => GetHostValue(),
94
EndpointProperty
.Port => mapping.InternalPort,
95
EndpointProperty
.HostAndPort => GetHostValue(suffix: $":{mapping.InternalPort}"),
96
EndpointProperty
.TargetPort => $"{mapping.InternalPort}",
97
EndpointProperty
.Scheme => mapping.Scheme,
Aspire.Hosting.Docker.Tests (2)
DockerComposePublisherTests.cs (2)
65
context.EnvironmentVariables["TP"] = resource.GetEndpoint("http").Property(
EndpointProperty
.TargetPort);
66
context.EnvironmentVariables["TPH2"] = resource.GetEndpoint("h2").Property(
EndpointProperty
.TargetPort);
Aspire.Hosting.Garnet (3)
GarnetResource.cs (3)
34
public EndpointReferenceExpression Host => PrimaryEndpoint.Property(
EndpointProperty
.Host);
39
public EndpointReferenceExpression Port => PrimaryEndpoint.Property(
EndpointProperty
.Port);
65
builder.Append($"{PrimaryEndpoint.Property(
EndpointProperty
.HostAndPort)}");
Aspire.Hosting.JavaScript (1)
JavaScriptHostingExtensions.cs (1)
532
c.Args.Add(targetEndpoint.Property(
EndpointProperty
.TargetPort));
Aspire.Hosting.Kafka (9)
KafkaBuilderExtensions.cs (6)
140
? ReferenceExpression.Create($"{endpoint.Resource.Name}:{endpoint.Property(
EndpointProperty
.TargetPort)}")
141
: ReferenceExpression.Create($"{endpoint.Property(
EndpointProperty
.HostAndPort)}");
218
? ReferenceExpression.Create($"PLAINTEXT://localhost:29092,PLAINTEXT_HOST://localhost:{primaryEndpoint.Port.ToString(CultureInfo.InvariantCulture)},PLAINTEXT_INTERNAL://{resource.Name}:{internalEndpoint.Property(
EndpointProperty
.TargetPort)}")
219
: ReferenceExpression.Create($"PLAINTEXT://{primaryEndpoint.Property(
EndpointProperty
.Host)}:29092,PLAINTEXT_HOST://{primaryEndpoint.Property(
EndpointProperty
.HostAndPort)},PLAINTEXT_INTERNAL://{internalEndpoint.Property(
EndpointProperty
.HostAndPort)}");
KafkaServerResource.cs (3)
31
public EndpointReferenceExpression Host => PrimaryEndpoint.Property(
EndpointProperty
.Host);
36
public EndpointReferenceExpression Port => PrimaryEndpoint.Property(
EndpointProperty
.Port);
48
ReferenceExpression.Create($"{PrimaryEndpoint.Property(
EndpointProperty
.HostAndPort)}");
Aspire.Hosting.Kubernetes (12)
KubernetesResource.cs (12)
266
Port = GetEndpointValue(endpointMapping,
EndpointProperty
.TargetPort),
392
var url = GetEndpointValue(mapping,
EndpointProperty
.Url);
422
var val = GetEndpointValue(mapping, epExpr.Property, embedded && epExpr.Property is
EndpointProperty
.Port or
EndpointProperty
.TargetPort);
458
private static string GetEndpointValue(EndpointMapping mapping,
EndpointProperty
property, bool embedded = false)
464
EndpointProperty
.Url => GetHostValue($"{scheme}://", suffix: GetPortSuffix()),
465
EndpointProperty
.Host or
EndpointProperty
.IPV4Host => GetHostValue(),
466
EndpointProperty
.Port => GetPort(),
467
EndpointProperty
.HostAndPort => GetHostValue(suffix: GetPortSuffix()),
468
EndpointProperty
.TargetPort => GetPort(),
469
EndpointProperty
.Scheme => scheme,
Aspire.Hosting.Milvus (3)
MilvusServerResource.cs (3)
41
public EndpointReferenceExpression Host => PrimaryEndpoint.Property(
EndpointProperty
.Host);
46
public EndpointReferenceExpression Port => PrimaryEndpoint.Property(
EndpointProperty
.Port);
69
public ReferenceExpression UriExpression => ReferenceExpression.Create($"{PrimaryEndpoint.Property(
EndpointProperty
.Url)}");
Aspire.Hosting.MongoDB (3)
MongoDBServerResource.cs (3)
39
public EndpointReferenceExpression Host => PrimaryEndpoint.Property(
EndpointProperty
.Host);
44
public EndpointReferenceExpression Port => PrimaryEndpoint.Property(
EndpointProperty
.Port);
101
builder.Append($"{PrimaryEndpoint.Property(
EndpointProperty
.HostAndPort)}");
Aspire.Hosting.MySql (4)
MySqlServerResource.cs (4)
38
public EndpointReferenceExpression Host => PrimaryEndpoint.Property(
EndpointProperty
.Host);
43
public EndpointReferenceExpression Port => PrimaryEndpoint.Property(
EndpointProperty
.Port);
55
$"Server={PrimaryEndpoint.Property(
EndpointProperty
.Host)};Port={PrimaryEndpoint.Property(
EndpointProperty
.Port)};User ID={DefaultUserName};Password={PasswordParameter}");
Aspire.Hosting.Nats (3)
NatsServerResource.cs (3)
38
public EndpointReferenceExpression Host => PrimaryEndpoint.Property(
EndpointProperty
.Host);
43
public EndpointReferenceExpression Port => PrimaryEndpoint.Property(
EndpointProperty
.Port);
96
builder.Append($"{PrimaryEndpoint.Property(
EndpointProperty
.HostAndPort)}");
Aspire.Hosting.Oracle (3)
OracleDatabaseServerResource.cs (3)
35
public EndpointReferenceExpression Host => PrimaryEndpoint.Property(
EndpointProperty
.Host);
40
public EndpointReferenceExpression Port => PrimaryEndpoint.Property(
EndpointProperty
.Port);
52
$"user id={DefaultUserName};password={PasswordParameter};data source={PrimaryEndpoint.Property(
EndpointProperty
.HostAndPort)}");
Aspire.Hosting.PostgreSQL (4)
PostgresServerResource.cs (4)
58
$"Host={PrimaryEndpoint.Property(
EndpointProperty
.Host)};Port={PrimaryEndpoint.Property(
EndpointProperty
.Port)};Username={UserNameReference};Password={PasswordParameter}");
109
public EndpointReferenceExpression Host => PrimaryEndpoint.Property(
EndpointProperty
.Host);
114
public EndpointReferenceExpression Port => PrimaryEndpoint.Property(
EndpointProperty
.Port);
Aspire.Hosting.Python (1)
PythonAppResourceBuilderExtensions.cs (1)
290
c.Args.Add(endpoint.Property(
EndpointProperty
.TargetPort));
Aspire.Hosting.Qdrant (8)
QdrantServerResource.cs (8)
41
public EndpointReferenceExpression GrpcHost => PrimaryEndpoint.Property(
EndpointProperty
.Host);
46
public EndpointReferenceExpression GrpcPort => PrimaryEndpoint.Property(
EndpointProperty
.Port);
56
public EndpointReferenceExpression HttpHost => HttpEndpoint.Property(
EndpointProperty
.Host);
61
public EndpointReferenceExpression HttpPort => HttpEndpoint.Property(
EndpointProperty
.Port);
68
$"Endpoint={PrimaryEndpoint.Property(
EndpointProperty
.Url)};Key={ApiKeyParameter}");
76
public ReferenceExpression UriExpression => ReferenceExpression.Create($"{PrimaryEndpoint.Property(
EndpointProperty
.Url)}");
83
$"Endpoint={HttpEndpoint.Property(
EndpointProperty
.Url)};Key={ApiKeyParameter}");
91
public ReferenceExpression HttpUriExpression => ReferenceExpression.Create($"{HttpEndpoint.Property(
EndpointProperty
.Url)}");
Aspire.Hosting.RabbitMQ (3)
RabbitMQServerResource.cs (3)
44
public EndpointReferenceExpression Host => PrimaryEndpoint.Property(
EndpointProperty
.Host);
49
public EndpointReferenceExpression Port => PrimaryEndpoint.Property(
EndpointProperty
.Port);
100
builder.Append($"{PrimaryEndpoint.Property(
EndpointProperty
.HostAndPort)}");
Aspire.Hosting.Redis (6)
RedisBuilderExtensions.cs (3)
204
ctx.Args.Add(redis.GetEndpoint(RedisResource.PrimaryEndpointName).Property(
EndpointProperty
.Port));
206
ctx.Args.Add(redis.GetEndpoint(RedisResource.SecondaryEndpointName).Property(
EndpointProperty
.Port));
345
context.EnvironmentVariables[$"RI_REDIS_HOST{counter}"] = redisInstance.PrimaryEndpoint.Property(
EndpointProperty
.Host);
RedisResource.cs (3)
43
public EndpointReferenceExpression Host => PrimaryEndpoint.Property(
EndpointProperty
.Host);
48
public EndpointReferenceExpression Port => PrimaryEndpoint.Property(
EndpointProperty
.Port);
68
builder.Append($"{PrimaryEndpoint.Property(
EndpointProperty
.HostAndPort)}");
Aspire.Hosting.Seq (4)
SeqResource.cs (4)
24
public EndpointReferenceExpression Host => PrimaryEndpoint.Property(
EndpointProperty
.Host);
29
public EndpointReferenceExpression Port => PrimaryEndpoint.Property(
EndpointProperty
.Port);
35
ReferenceExpression.Create($"{PrimaryEndpoint.Property(
EndpointProperty
.Url)}");
43
public ReferenceExpression UriExpression => ReferenceExpression.Create($"{PrimaryEndpoint.Property(
EndpointProperty
.Url)}");
Aspire.Hosting.SqlServer (4)
SqlServerServerResource.cs (4)
35
public EndpointReferenceExpression Host => PrimaryEndpoint.Property(
EndpointProperty
.Host);
40
public EndpointReferenceExpression Port => PrimaryEndpoint.Property(
EndpointProperty
.Port);
49
$"Server={PrimaryEndpoint.Property(
EndpointProperty
.IPV4Host)},{PrimaryEndpoint.Property(
EndpointProperty
.Port)};User ID={DefaultUserName};Password={PasswordParameter};TrustServerCertificate=true");
Aspire.Hosting.Tests (63)
EndpointReferenceTests.cs (37)
36
var endpointExpr = endpointRef.Property(
EndpointProperty
.Url);
56
var endpointExpr = endpointRef.Property(
EndpointProperty
.Url);
70
var hostExpr = endpointRef.Property(
EndpointProperty
.Host);
89
var portExpr = endpointRef.Property(
EndpointProperty
.Port);
108
var schemeExpr = endpointRef.Property(
EndpointProperty
.Scheme);
122
var ipv4Expr = endpointRef.Property(
EndpointProperty
.IPV4Host);
136
var targetPortExpr = endpointRef.Property(
EndpointProperty
.TargetPort);
150
var targetPortExpr = endpointRef.Property(
EndpointProperty
.TargetPort);
169
var endpointExpr = endpointRef.Property(
EndpointProperty
.Url);
187
var expr1 = endpointRef.Property(
EndpointProperty
.Url);
188
var expr2 = endpointRef.Property(
EndpointProperty
.Host);
189
var expr3 = endpointRef.Property(
EndpointProperty
.Port);
289
[InlineData(
EndpointProperty
.Url, ResourceKind.Host, ResourceKind.Host, "blah://localhost:1234")]
290
[InlineData(
EndpointProperty
.Url, ResourceKind.Host, ResourceKind.Container, "blah://localhost:1234")]
291
[InlineData(
EndpointProperty
.Url, ResourceKind.Container, ResourceKind.Host, "blah://host.docker.internal:1234")]
292
[InlineData(
EndpointProperty
.Url, ResourceKind.Container, ResourceKind.Container, "blah://destination.dev.internal:4567")]
293
[InlineData(
EndpointProperty
.Host, ResourceKind.Host, ResourceKind.Host, "localhost")]
294
[InlineData(
EndpointProperty
.Host, ResourceKind.Host, ResourceKind.Container, "localhost")]
295
[InlineData(
EndpointProperty
.Host, ResourceKind.Container, ResourceKind.Host, "host.docker.internal")]
296
[InlineData(
EndpointProperty
.Host, ResourceKind.Container, ResourceKind.Container, "destination.dev.internal")]
297
[InlineData(
EndpointProperty
.IPV4Host, ResourceKind.Host, ResourceKind.Host, "127.0.0.1")]
298
[InlineData(
EndpointProperty
.IPV4Host, ResourceKind.Host, ResourceKind.Container, "127.0.0.1")]
299
[InlineData(
EndpointProperty
.IPV4Host, ResourceKind.Container, ResourceKind.Host, "host.docker.internal")]
300
[InlineData(
EndpointProperty
.IPV4Host, ResourceKind.Container, ResourceKind.Container, "destination.dev.internal")]
301
[InlineData(
EndpointProperty
.Port, ResourceKind.Host, ResourceKind.Host, "1234")]
302
[InlineData(
EndpointProperty
.Port, ResourceKind.Host, ResourceKind.Container, "1234")]
303
[InlineData(
EndpointProperty
.Port, ResourceKind.Container, ResourceKind.Host, "1234")]
304
[InlineData(
EndpointProperty
.Port, ResourceKind.Container, ResourceKind.Container, "4567")]
305
[InlineData(
EndpointProperty
.Scheme, ResourceKind.Host, ResourceKind.Host, "blah")]
306
[InlineData(
EndpointProperty
.Scheme, ResourceKind.Host, ResourceKind.Container, "blah")]
307
[InlineData(
EndpointProperty
.Scheme, ResourceKind.Container, ResourceKind.Host, "blah")]
308
[InlineData(
EndpointProperty
.Scheme, ResourceKind.Container, ResourceKind.Container, "blah")]
309
[InlineData(
EndpointProperty
.HostAndPort, ResourceKind.Host, ResourceKind.Host, "localhost:1234")]
310
[InlineData(
EndpointProperty
.HostAndPort, ResourceKind.Host, ResourceKind.Container, "localhost:1234")]
311
[InlineData(
EndpointProperty
.HostAndPort, ResourceKind.Container, ResourceKind.Host, "host.docker.internal:1234")]
312
[InlineData(
EndpointProperty
.HostAndPort, ResourceKind.Container, ResourceKind.Container, "destination.dev.internal:4567")]
313
public async Task PropertyResolutionTest(
EndpointProperty
property, ResourceKind sourceKind, ResourceKind destinationKind, object expectedResult)
ExpressionResolverTests.cs (19)
298
ReferenceExpression.Create($"{PrimaryEndpoint.Property(
EndpointProperty
.Url)}");
322
{ "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)}/;") },
323
{ "Url", ReferenceExpression.Create($"Url={Endpoint1.Property(
EndpointProperty
.Url)};") },
325
{ "OnlyHost", ReferenceExpression.Create($"Host={Endpoint1.Property(
EndpointProperty
.Host)};") },
326
{ "OnlyPort", ReferenceExpression.Create($"Port={Endpoint1.Property(
EndpointProperty
.Port)};") },
327
{ "HostAndPort", ReferenceExpression.Create($"HostPort={Endpoint1.Property(
EndpointProperty
.HostAndPort)}") },
328
{ "PortBeforeHost", ReferenceExpression.Create($"Port={Endpoint1.Property(
EndpointProperty
.Port)};Host={Endpoint1.Property(
EndpointProperty
.Host)};") },
329
{ "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)}/;") },
334
{ "UrlEncodedHost", ReferenceExpression.Create($"Host={Endpoint3.Property(
EndpointProperty
.Host):uri};") },
ResourceDependencyTests.cs (1)
51
.WithEnvironment("API_PORT", api.GetEndpoint("http").Property(
EndpointProperty
.Port));
WithEnvironmentTests.cs (6)
242
.WithEnvironment("PORT", $"{endpoint.Property(
EndpointProperty
.Port)}")
243
.WithEnvironment("TARGET_PORT", $"{endpoint.Property(
EndpointProperty
.TargetPort)}")
290
.WithEnvironment("URL", $"{endpoint.Property(
EndpointProperty
.Host)}:{endpoint.Property(
EndpointProperty
.Port)}");
325
.WithEnvironment("TARGET_PORT", $"{endpoint.Property(
EndpointProperty
.TargetPort)}");
456
var portProperty = endpoint.Property(
EndpointProperty
.Port);
Aspire.Hosting.Valkey (3)
ValkeyResource.cs (3)
39
public EndpointReferenceExpression Host => PrimaryEndpoint.Property(
EndpointProperty
.Host);
44
public EndpointReferenceExpression Port => PrimaryEndpoint.Property(
EndpointProperty
.Port);
65
builder.Append($"{PrimaryEndpoint.Property(
EndpointProperty
.HostAndPort)}");
Aspire.Hosting.Yarp (5)
YarpResourceExtensions.cs (5)
88
.WithEnvironment("ASPNETCORE_HTTPS_PORT", resource.GetEndpoint("https").Property(
EndpointProperty
.Port))
89
.WithEnvironment("ASPNETCORE_URLS", $"{resource.GetEndpoint("https").Property(
EndpointProperty
.Scheme)}://*:{resource.GetEndpoint("https").Property(
EndpointProperty
.TargetPort)};{resource.GetEndpoint("http").Property(
EndpointProperty
.Scheme)}://*:{resource.GetEndpoint("http").Property(
EndpointProperty
.TargetPort)}");
AspireWithNode.AppHost (1)
AppHost.cs (1)
40
ctx.EnvironmentVariables["HTTPS_REDIRECT_PORT"] = httpsEndpoint.Property(
EndpointProperty
.Port);
Stress.AppHost (3)
Program.cs (3)
44
.WithEnvironment("HOST", $"{serviceBuilder.GetEndpoint("http").Property(
EndpointProperty
.Host)}")
45
.WithEnvironment("PORT", $"{serviceBuilder.GetEndpoint("http").Property(
EndpointProperty
.Port)}")
46
.WithEnvironment("URL", $"{serviceBuilder.GetEndpoint("http").Property(
EndpointProperty
.Url)}");