543 references to EndpointProperty
Aspire.Hosting (53)
ApplicationModel\EndpointReference.cs (33)
116public ValueTask<string?> GetValueAsync(CancellationToken cancellationToken = default) => Property(EndpointProperty.Url).GetValueAsync(cancellationToken); 125public ValueTask<string?> GetValueAsync(ValueProviderContext context, CancellationToken cancellationToken = default) => Property(EndpointProperty.Url).GetValueAsync(context, cancellationToken); 137internal string GetExpression(EndpointProperty property = EndpointProperty.Url) 141EndpointProperty.Url => Binding("url"), 142EndpointProperty.Host or EndpointProperty.IPV4Host => Binding("host"), 143EndpointProperty.Port => Binding("port"), 144EndpointProperty.Scheme => Binding("scheme"), 145EndpointProperty.TargetPort => Binding("targetPort"), 146EndpointProperty.HostAndPort => $"{Binding("host")}:{Binding("port")}", 147EndpointProperty.TlsEnabled => Binding("tlsEnabled"), 157/// <param name="property">The <see cref="EndpointProperty"/> enum value to use in the reference.</param> 158/// <returns>An <see cref="EndpointReferenceExpression"/> representing the specified <see cref="EndpointProperty"/>.</returns> 160public EndpointReferenceExpression Property(EndpointProperty property) 184Property(EndpointProperty.TlsEnabled), 321public class EndpointReferenceExpression(EndpointReference endpointReference, EndpointProperty property) : IExpressionValue, IManifestExpressionProvider, IValueProvider, IValueWithReferences 329/// Gets the <see cref="EndpointProperty"/> for the property expression. 331public EndpointProperty Property { get; } = property; 343/// <returns>A <see cref="string"/> containing the selected <see cref="EndpointProperty"/> value.</returns> 344/// <exception cref="InvalidOperationException">Throws when the selected <see cref="EndpointProperty"/> enumeration is not known.</exception> 355/// <returns>A <see cref="string"/> containing the selected <see cref="EndpointProperty"/> value.</returns> 356/// <exception cref="InvalidOperationException">Throws when the selected <see cref="EndpointProperty"/> enumeration is not known.</exception> 365EndpointProperty.Scheme => new(Endpoint.Scheme), 366EndpointProperty.TlsEnabled => Endpoint.TlsEnabled ? bool.TrueString : bool.FalseString, 367EndpointProperty.IPV4Host when networkContext == KnownNetworkIdentifiers.LocalhostNetwork => "127.0.0.1", 368EndpointProperty.TargetPort when Endpoint.TargetPort is int port => new(port.ToString(CultureInfo.InvariantCulture)), 378EndpointProperty.Url => new(allocatedEndpoint.UriString), 379EndpointProperty.Host => new(allocatedEndpoint.Address), 380EndpointProperty.IPV4Host => new(allocatedEndpoint.Address), 381EndpointProperty.Port => new(allocatedEndpoint.Port.ToString(CultureInfo.InvariantCulture)), 382EndpointProperty.TargetPort => new(ComputeTargetPort(allocatedEndpoint)), 383EndpointProperty.HostAndPort => new($"{allocatedEndpoint.Address}:{allocatedEndpoint.Port.ToString(CultureInfo.InvariantCulture)}"),
ApplicationModel\HostUrl.cs (1)
84var port = await targetEndpoint.Property(EndpointProperty.Port).GetValueAsync(context, cancellationToken).ConfigureAwait(false);
ApplicationModel\IComputeEnvironmentResource.cs (9)
45var property = endpointReferenceExpression.Property; 53EndpointProperty.Url => IsDefaultPort(scheme, port) 56EndpointProperty.Host or EndpointProperty.IPV4Host => host.Value, 57EndpointProperty.Port => ReferenceExpression.Create($"{port.ToString(CultureInfo.InvariantCulture)}"), 58EndpointProperty.TargetPort => endpoint.TargetPort is int targetPort 61EndpointProperty.Scheme => ReferenceExpression.Create($"{scheme}"), 62EndpointProperty.HostAndPort => ReferenceExpression.Create($"{host.Value}:{port.ToString(CultureInfo.InvariantCulture)}"), 63EndpointProperty.TlsEnabled => ReferenceExpression.Create($"{(endpoint.TlsEnabled ? bool.TrueString : bool.FalseString)}"),
Dashboard\DashboardEventHandlers.cs (4)
662ReferenceExpression.Create($"{e.Property(EndpointProperty.Scheme)}://{e.EndpointAnnotation.TargetHost}:{e.Property(EndpointProperty.TargetPort)}"); 688aspnetCoreUrls.Append($"{e.Property(EndpointProperty.Scheme)}://{e.EndpointAnnotation.TargetHost}:{e.Property(EndpointProperty.TargetPort)}");
ProjectResourceBuilderExtensions.cs (5)
1152context.EnvironmentVariables[KnownAspNetCoreConfigNames.HttpsPort] = e.Property(EndpointProperty.Port); 1157aspnetCoreUrls.Append($"{e.Property(EndpointProperty.Scheme)}://{e.EndpointAnnotation.TargetHost}:{e.Property(EndpointProperty.TargetPort)}"); 1204ports.Append($"{e.Property(EndpointProperty.TargetPort)}"); 1237var url = ReferenceExpression.Create($"{e.EndpointAnnotation.UriScheme}://{host}:{e.Property(EndpointProperty.TargetPort)}");
ResourceBuilderExtensions.cs (1)
1734context.EnvironmentVariables[endpointAnnotation.TargetPortEnvironmentVariable!] = 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 (25)
AzureContainerAppEnvironmentResource.cs (9)
396var property = endpointReferenceExpression.Property; 405EndpointProperty.Url => ReferenceExpression.Create($"{scheme}://{host}"), 406EndpointProperty.Host or EndpointProperty.IPV4Host => host, 407EndpointProperty.Port => ReferenceExpression.Create($"{port.ToString(CultureInfo.InvariantCulture)}"), 408EndpointProperty.TargetPort => endpoint.TargetPort is int targetPort 411EndpointProperty.Scheme => ReferenceExpression.Create($"{scheme}"), 412EndpointProperty.HostAndPort => ReferenceExpression.Create($"{host}:{port.ToString(CultureInfo.InvariantCulture)}"), 413EndpointProperty.TlsEnabled => ReferenceExpression.Create($"{(tlsEnabled ? bool.TrueString : bool.FalseString)}"),
BaseContainerAppContext.cs (15)
187private BicepValue<string> GetEndpointValue(EndpointMapping mapping, EndpointProperty property) 205EndpointProperty.Url => GetHostValue($"{scheme}://", suffix: isHttpIngress ? null : $":{port}"), 206EndpointProperty.Host or EndpointProperty.IPV4Host => GetHostValue(), 207EndpointProperty.Port => port.ToString(CultureInfo.InvariantCulture), 208EndpointProperty.HostAndPort => GetHostValue(suffix: $":{port}"), 209EndpointProperty.TargetPort => targetPort is null ? AllocateContainerPortParameter() : $"{targetPort}", 210EndpointProperty.Scheme => scheme, 211EndpointProperty.TlsEnabled => tlsEnabled ? bool.TrueString : bool.FalseString, 255var url = GetEndpointValue(mapping, EndpointProperty.Url); 309if (epExpr.Property is EndpointProperty.Url or EndpointProperty.Host or EndpointProperty.IPV4Host or EndpointProperty.HostAndPort) 582Port = AsInt(GetEndpointValue(endpointMapping, EndpointProperty.TargetPort)),
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
51endpointReference.Property(EndpointProperty.Url),
Aspire.Hosting.Azure.AppService (21)
AzureAppServiceEnvironmentResource.cs (9)
523var property = endpointReferenceExpression.Property; 532EndpointProperty.Url => ReferenceExpression.Create($"{scheme}://{host}"), 533EndpointProperty.Host or EndpointProperty.IPV4Host => host, 534EndpointProperty.Port => ReferenceExpression.Create($"{port.ToString(CultureInfo.InvariantCulture)}"), 535EndpointProperty.TargetPort => endpoint.TargetPort is int targetPort 538EndpointProperty.Scheme => ReferenceExpression.Create($"{scheme}"), 539EndpointProperty.HostAndPort => host, 540EndpointProperty.TlsEnabled => ReferenceExpression.Create($"{(tlsEnabled ? bool.TrueString : bool.FalseString)}"),
AzureAppServiceWebsiteContext.cs (11)
215(GetEndpointValue(context._slotEndpointMapping[ep.EndpointName], EndpointProperty.Url), secretType) : 216(GetEndpointValue(context._endpointMapping[ep.EndpointName], EndpointProperty.Url), secretType); 510var targetPort = GetEndpointValue(mapping, EndpointProperty.TargetPort); 897private BicepValue<string> GetEndpointValue(EndpointMapping mapping, EndpointProperty property) 901EndpointProperty.Url => BicepFunction.Interpolate($"{mapping.Scheme}://{mapping.Host}.azurewebsites.net"), 902EndpointProperty.Host => BicepFunction.Interpolate($"{mapping.Host}.azurewebsites.net"), 903EndpointProperty.Port => mapping.Port.ToString(CultureInfo.InvariantCulture), 904EndpointProperty.TargetPort => mapping.TargetPort?.ToString(CultureInfo.InvariantCulture) ?? (BicepValue<string>)AllocateParameter(new ContainerPortReference(Resource)), 905EndpointProperty.Scheme => mapping.Scheme, 906EndpointProperty.HostAndPort => BicepFunction.Interpolate($"{mapping.Host}.azurewebsites.net"), 907EndpointProperty.IPV4Host => BicepFunction.Interpolate($"{mapping.Host}.azurewebsites.net"),
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
51endpointReference.Property(EndpointProperty.Url),
Aspire.Hosting.Azure.CosmosDB (4)
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 (1)
107ReferenceExpression.Create($"{EmulatorEndpoint.Property(EndpointProperty.Url)}") :
Aspire.Hosting.Azure.EventHubs (5)
AzureEventHubsResource.cs (5)
66ReferenceExpression.Create($"{EmulatorEndpoint.Property(EndpointProperty.Host)}") : 78ReferenceExpression.Create($"{EmulatorEndpoint.Property(EndpointProperty.Port)}") : 89ReferenceExpression.Create($"sb://{EmulatorEndpoint.Property(EndpointProperty.HostAndPort)}") : 103builder.Append($"Endpoint=sb://{EmulatorEndpoint.Property(EndpointProperty.HostAndPort)};SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true"); 213yield return new("ConnectionString", ReferenceExpression.Create($"Endpoint={EmulatorEndpoint.Property(EndpointProperty.HostAndPort)};SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true"));
Aspire.Hosting.Azure.FrontDoor (1)
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
51endpointReference.Property(EndpointProperty.Url),
Aspire.Hosting.Azure.Functions (6)
AzureFunctionsProjectResourceExtensions.cs (2)
225context.EnvironmentVariables["ASPNETCORE_URLS"] = ReferenceExpression.Create($"http://+:{endpoint.Property(EndpointProperty.TargetPort)}"); 312context.Args.Add(targetEndpoint.Property(EndpointProperty.TargetPort));
DurableTask\DurableTaskSchedulerResource.cs (4)
36return ReferenceExpression.Create($"Endpoint={grpcEndpoint.Property(EndpointProperty.Scheme)}://{grpcEndpoint.Property(EndpointProperty.Host)}:{grpcEndpoint.Property(EndpointProperty.Port)};Authentication=None"); 58return ReferenceExpression.Create($"{dashboardEndpoint.Property(EndpointProperty.Url)}");
Aspire.Hosting.Azure.KeyVault (2)
AzureKeyVaultResource.cs (2)
56ReferenceExpression.Create($"{EmulatorEndpoint.Property(EndpointProperty.Url)}") : 72ReferenceExpression.Create($"{EmulatorEndpoint.Property(EndpointProperty.Url)}") :
Aspire.Hosting.Azure.Kubernetes.Tests (1)
AzureKubernetesFoundryReferenceTests.cs (1)
42.WithEnvironment("AGENT_URL", agent.GetEndpoint("http").Property(EndpointProperty.Url));
Aspire.Hosting.Azure.PostgreSQL (1)
AzurePostgresFlexibleServerResource.cs (1)
90ReferenceExpression.Create($"{InnerResource.PrimaryEndpoint.Property(EndpointProperty.HostAndPort)}") :
Aspire.Hosting.Azure.Redis (2)
AzureManagedRedisResource.cs (1)
98ReferenceExpression.Create($"{InnerResource.PrimaryEndpoint.Property(EndpointProperty.Host)}") :
AzureRedisCacheResource.cs (1)
79ReferenceExpression.Create($"{InnerResource.PrimaryEndpoint.Property(EndpointProperty.HostAndPort)}") :
Aspire.Hosting.Azure.Sandboxes (22)
AzureSandboxContainerDeployment.cs (7)
1199EndpointProperty.Url).ConfigureAwait(false); 1223EndpointProperty property) 1229case EndpointProperty.Url: 1232case EndpointProperty.Host or EndpointProperty.IPV4Host: 1239case EndpointProperty.HostAndPort: 1295return TryResolveEndpointReferenceValue(endpointReference.Property(EndpointProperty.Url), currentComputeEnvironment, out expression);
AzureSandboxEndpointPropertyValueProvider.cs (13)
31if (endpointReferenceExpression.Property == EndpointProperty.TargetPort) 87EndpointProperty.TargetPort => _targetPort.ToString(CultureInfo.InvariantCulture), 88EndpointProperty.Scheme => Uri.UriSchemeHttps, 89EndpointProperty.Port => "443", 90EndpointProperty.TlsEnabled => bool.TrueString, 105EndpointProperty.Url => url, 106EndpointProperty.Host or EndpointProperty.IPV4Host => uri.Host, 107EndpointProperty.Port => uri.Port.ToString(CultureInfo.InvariantCulture), 108EndpointProperty.TargetPort => _targetPort.ToString(CultureInfo.InvariantCulture), 109EndpointProperty.Scheme => uri.Scheme, 110EndpointProperty.HostAndPort => uri.IsDefaultPort ? uri.Host : uri.Authority, 111EndpointProperty.TlsEnabled => string.Equals(uri.Scheme, Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase) ? bool.TrueString : bool.FalseString,
AzureSandboxGroupResource.cs (1)
295return GetEndpointPropertyExpression(endpointReference.Property(EndpointProperty.Host));
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
51endpointReference.Property(EndpointProperty.Url),
Aspire.Hosting.Azure.ServiceBus (5)
AzureServiceBusExtensions.cs (1)
493context.EnvironmentVariables.TryAdd("SQL_SERVER", sqlConnection.Endpoint.Property(EndpointProperty.HostAndPort));
AzureServiceBusResource.cs (4)
56ReferenceExpression.Create($"{EmulatorEndpoint.Property(EndpointProperty.Host)}") : 68ReferenceExpression.Create($"{EmulatorEndpoint.Property(EndpointProperty.Port)}") : 79ReferenceExpression.Create($"sb://{EmulatorEndpoint.Property(EndpointProperty.HostAndPort)}") : 87? ReferenceExpression.Create($"Endpoint=sb://{EmulatorEndpoint.Property(EndpointProperty.HostAndPort)};SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;")
Aspire.Hosting.Azure.SignalR (2)
AzureSignalRResource.cs (2)
52ReferenceExpression.Create($"{EmulatorEndpoint.Property(EndpointProperty.Url)}") : 60ReferenceExpression.Create($"Endpoint={EmulatorEndpoint.Property(EndpointProperty.Url)};AccessKey=ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGH;Version=1.0;"):
Aspire.Hosting.Azure.Sql (1)
AzureSqlServerResource.cs (1)
95ReferenceExpression.Create($"{InnerResource!.PrimaryEndpoint.Property(EndpointProperty.Host)}") :
Aspire.Hosting.Azure.Storage (6)
AzureStorageEmulatorConnectionString.cs (3)
35builder.Append($"{key}={endpoint.Property(EndpointProperty.Scheme)}://{endpoint.Property(EndpointProperty.IPV4Host)}:{endpoint.Property(EndpointProperty.Port)}/devstoreaccount1;");
AzureStorageResource.cs (3)
94? ReferenceExpression.Create($"{EmulatorBlobEndpoint.Property(EndpointProperty.Url)}") 114? ReferenceExpression.Create($"{EmulatorQueueEndpoint.Property(EndpointProperty.Url)}") 124? ReferenceExpression.Create($"{EmulatorTableEndpoint.Property(EndpointProperty.Url)}")
Aspire.Hosting.Azure.Tests (77)
AzureAppServiceTests.cs (10)
416.WithEnvironment("AGENT_URL", agent.GetEndpoint("http").Property(EndpointProperty.Url)); 1177[InlineData(EndpointProperty.Url, "https://project1-website123.azurewebsites.net")] 1178[InlineData(EndpointProperty.Host, "project1-website123.azurewebsites.net")] 1179[InlineData(EndpointProperty.IPV4Host, "project1-website123.azurewebsites.net")] 1180[InlineData(EndpointProperty.Port, "443")] 1181[InlineData(EndpointProperty.TargetPort, "5000")] 1182[InlineData(EndpointProperty.Scheme, "https")] 1183[InlineData(EndpointProperty.HostAndPort, "project1-website123.azurewebsites.net")] 1184[InlineData(EndpointProperty.TlsEnabled, "True")] 1185public async Task GetEndpointPropertyExpression_ReturnsAppServiceEndpointPropertyExpression(EndpointProperty property, string expected)
AzureContainerAppExpressEndpointTests.cs (38)
39foreach (var property in new[] 41EndpointProperty.Url, EndpointProperty.Host, EndpointProperty.IPV4Host, 42EndpointProperty.HostAndPort, EndpointProperty.Port, EndpointProperty.TargetPort, 43EndpointProperty.Scheme, EndpointProperty.TlsEnabled 52context.EnvironmentVariables["SELF_TARGET_PORT"] = web.GetEndpoint("http").Property(EndpointProperty.TargetPort); 98var expectedValues = new Dictionary<EndpointProperty, string> 100[EndpointProperty.Url] = "https://api.salmonisland-e9e6a567.westus3.azurecontainerapps.io", 101[EndpointProperty.Host] = "api.salmonisland-e9e6a567.westus3.azurecontainerapps.io", 102[EndpointProperty.IPV4Host] = "api.salmonisland-e9e6a567.westus3.azurecontainerapps.io", 103[EndpointProperty.HostAndPort] = "api.salmonisland-e9e6a567.westus3.azurecontainerapps.io:443", 104[EndpointProperty.Port] = "443", 105[EndpointProperty.TargetPort] = "8080", 106[EndpointProperty.Scheme] = "https", 107[EndpointProperty.TlsEnabled] = "True" 122[InlineData(EndpointProperty.Port, "443")] 123[InlineData(EndpointProperty.TargetPort, "8080")] 124[InlineData(EndpointProperty.Scheme, "https")] 125[InlineData(EndpointProperty.TlsEnabled, "True")] 126public async Task NonHostPropertiesResolveWithoutMaterializingDeploymentTargets(EndpointProperty property, string expected) 139[InlineData(EndpointProperty.Url)] 140[InlineData(EndpointProperty.Host)] 141[InlineData(EndpointProperty.IPV4Host)] 142[InlineData(EndpointProperty.HostAndPort)] 143[InlineData(EndpointProperty.Port)] 144[InlineData(EndpointProperty.TargetPort)] 145[InlineData(EndpointProperty.Scheme)] 146[InlineData(EndpointProperty.TlsEnabled)] 147public void InternalEndpointReferencesRequireExplicitPublicIngress(EndpointProperty property) 219web.WithEnvironment("HOST", api.GetEndpoint("http").Property(EndpointProperty.Host)); 256.WithEnvironment("API_HOST", endpoint.Property(EndpointProperty.Host)) 257.WithEnvironment("API_AUTHORITY", ReferenceExpression.Create($"api={endpoint.Property(EndpointProperty.HostAndPort)}")); 289.WithEnvironment("API_URL", api.GetEndpoint("http").Property(EndpointProperty.Url)); 315? environment.Resource.GetEndpointPropertyExpression(endpoint.Property(EndpointProperty.Url))
AzureContainerAppsTests.cs (22)
178.WithEnvironment("AGENT_URL", agent.GetEndpoint("http").Property(EndpointProperty.Url)); 397context.EnvironmentVariables["TARGET_PORT"] = httpEp.Property(EndpointProperty.TargetPort); 398context.EnvironmentVariables["PORT"] = httpEp.Property(EndpointProperty.Port); 399context.EnvironmentVariables["HOST"] = httpEp.Property(EndpointProperty.Host); 400context.EnvironmentVariables["HOSTANDPORT"] = httpEp.Property(EndpointProperty.HostAndPort); 401context.EnvironmentVariables["SCHEME"] = httpEp.Property(EndpointProperty.Scheme); 402context.EnvironmentVariables["INTERNAL_HOSTANDPORT"] = internalEp.Property(EndpointProperty.HostAndPort); 501context.EnvironmentVariables["TARGET_PORT"] = httpEp.Property(EndpointProperty.TargetPort); 502context.EnvironmentVariables["PORT"] = httpEp.Property(EndpointProperty.Port); 503context.EnvironmentVariables["HOST"] = httpEp.Property(EndpointProperty.Host); 504context.EnvironmentVariables["HOSTANDPORT"] = httpEp.Property(EndpointProperty.HostAndPort); 505context.EnvironmentVariables["SCHEME"] = httpEp.Property(EndpointProperty.Scheme); 506context.EnvironmentVariables["INTERNAL_HOSTANDPORT"] = internalEp.Property(EndpointProperty.HostAndPort); 2822[InlineData(EndpointProperty.Url, "https://project1.example.azurecontainerapps.io")] 2823[InlineData(EndpointProperty.Host, "project1.example.azurecontainerapps.io")] 2824[InlineData(EndpointProperty.IPV4Host, "project1.example.azurecontainerapps.io")] 2825[InlineData(EndpointProperty.Port, "443")] 2826[InlineData(EndpointProperty.TargetPort, "5000")] 2827[InlineData(EndpointProperty.Scheme, "https")] 2828[InlineData(EndpointProperty.HostAndPort, "project1.example.azurecontainerapps.io:443")] 2829[InlineData(EndpointProperty.TlsEnabled, "True")] 2830public async Task GetEndpointPropertyExpression_ReturnsContainerAppEndpointPropertyExpression(EndpointProperty property, string expected)
AzureProvisioningResourceExtensionsTests.cs (1)
21var referenceExpression = ReferenceExpression.Create($"prefix:{endpointReference.Property(EndpointProperty.HostAndPort)}");
AzureSandboxesTests.cs (2)
2219Assert.True(AzureSandboxContainerDeployment.TryResolveEndpointReferenceValue(api.GetEndpoint("http").Property(EndpointProperty.TargetPort), sandboxGroup.Resource, out var targetPortExpression)); 3214$"https://{api.GetEndpoint("http").Property(EndpointProperty.HostAndPort)}/v1"))
FoundryExtensionsTests.cs (1)
897context.EnvironmentVariables["WEATHER_HOST_AND_PORT"] = weatherAgent.GetEndpoint("http").Property(EndpointProperty.HostAndPort);
src\Aspire.Hosting.Azure.Storage\AzureStorageEmulatorConnectionString.cs (3)
35builder.Append($"{key}={endpoint.Property(EndpointProperty.Scheme)}://{endpoint.Property(EndpointProperty.IPV4Host)}:{endpoint.Property(EndpointProperty.Port)}/devstoreaccount1;");
Aspire.Hosting.DevTunnels (4)
DevTunnelResource.cs (4)
106return await GetResolvedEndpointPortAsync(EndpointProperty.Port, cancellationToken).ConfigureAwait(false) 115return await GetResolvedEndpointPortAsync(EndpointProperty.TargetPort, cancellationToken).ConfigureAwait(false) 119private async ValueTask<int?> GetResolvedEndpointPortAsync(EndpointProperty property, CancellationToken cancellationToken) 126catch (InvalidOperationException) when (property == EndpointProperty.TargetPort && TargetEndpoint.IsAllocated)
Aspire.Hosting.Docker (9)
DockerComposeServiceResourceExtensions.cs (9)
26var url = GetValue(mapping, EndpointProperty.Url); 101private static string GetValue(DockerComposeServiceResource.EndpointMapping mapping, EndpointProperty property) 105EndpointProperty.Url => GetHostValue($"{mapping.Scheme}://", $":{mapping.InternalPort}"), 106EndpointProperty.Host or EndpointProperty.IPV4Host => GetHostValue(), 107EndpointProperty.Port => mapping.InternalPort, 108EndpointProperty.HostAndPort => GetHostValue(suffix: $":{mapping.InternalPort}"), 109EndpointProperty.TargetPort => $"{mapping.InternalPort}", 110EndpointProperty.Scheme => mapping.Scheme,
Aspire.Hosting.Docker.Tests (2)
DockerComposePublisherTests.cs (2)
68context.EnvironmentVariables["TP"] = resource.GetEndpoint("http").Property(EndpointProperty.TargetPort); 69context.EnvironmentVariables["TPH2"] = resource.GetEndpoint("h2").Property(EndpointProperty.TargetPort);
Aspire.Hosting.Foundry (6)
HostedAgent\AzureHostedAgentResource.cs (2)
403return endpointReferenceExpression.Property == EndpointProperty.TargetPort && 420return await ResolvePublishedEndpointAsync(endpointReference.Property(EndpointProperty.Url), context, hostedAgent, resource, environmentVariableName, cancellationToken).ConfigureAwait(false);
Project\ProjectResource.cs (3)
233var property = endpointReferenceExpression.Property; 236EndpointProperty.Url => GetAgentAddressExpression(endpointReferenceExpression.Endpoint), 237EndpointProperty.Scheme => ReferenceExpression.Create($"https"),
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
51endpointReference.Property(EndpointProperty.Url),
Aspire.Hosting.Garnet (3)
GarnetResource.cs (3)
35public EndpointReferenceExpression Host => PrimaryEndpoint.Property(EndpointProperty.Host); 40public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port); 66builder.Append($"{PrimaryEndpoint.Property(EndpointProperty.HostAndPort)}");
Aspire.Hosting.JavaScript (4)
DenoHostingExtensions.cs (2)
440context.EnvironmentVariables["PORT"] = endpointReference.Property(EndpointProperty.TargetPort); 1424: endpoint.Property(EndpointProperty.TargetPort);
JavaScriptHostingExtensions.cs (2)
2042c.Args.Add(targetEndpoint.Property(EndpointProperty.TargetPort)); 2240c.Args.Add(targetEndpoint.Property(EndpointProperty.TargetPort));
Aspire.Hosting.Kafka (10)
KafkaBuilderExtensions.cs (7)
164? ReferenceExpression.Create($"{endpoint.Resource.Name}:{endpoint.Property(EndpointProperty.TargetPort)}") 165: ReferenceExpression.Create($"{endpoint.Property(EndpointProperty.HostAndPort)}"); 247? ReferenceExpression.Create($"PLAINTEXT://localhost:29092,PLAINTEXT_HOST://localhost:{primaryEndpoint.Property(EndpointProperty.Port)},PLAINTEXT_INTERNAL://{resource.Name}:{internalEndpoint.Property(EndpointProperty.TargetPort)}") 248: ReferenceExpression.Create($"PLAINTEXT://{primaryEndpoint.Property(EndpointProperty.Host)}:29092,PLAINTEXT_HOST://{primaryEndpoint.Property(EndpointProperty.HostAndPort)},PLAINTEXT_INTERNAL://{internalEndpoint.Property(EndpointProperty.HostAndPort)}");
KafkaServerResource.cs (3)
32public EndpointReferenceExpression Host => PrimaryEndpoint.Property(EndpointProperty.Host); 37public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port); 49ReferenceExpression.Create($"{PrimaryEndpoint.Property(EndpointProperty.HostAndPort)}");
Aspire.Hosting.Keycloak (1)
KeycloakResourceBuilderExtensions.cs (1)
120context.EnvironmentVariables["KC_HTTPS_PORT"] = keycloak.GetEndpoint(KeycloakResource.PrimaryEndpointName).Property(EndpointProperty.TargetPort);
Aspire.Hosting.Kubernetes (13)
KubernetesResource.cs (12)
344Port = GetEndpointValue(endpointMapping, EndpointProperty.TargetPort), 566var url = GetEndpointValue(mapping, EndpointProperty.Url); 609var val = GetEndpointValue(mapping, epExpr.Property, embedded && epExpr.Property is EndpointProperty.Port or EndpointProperty.TargetPort); 772private static string GetEndpointValue(EndpointMapping mapping, EndpointProperty property, bool embedded = false) 787EndpointProperty.Url => GetHostValue($"{scheme}://", suffix: GetPortSuffix(servicePort)), 788EndpointProperty.Host or EndpointProperty.IPV4Host => GetHostValue(), 789EndpointProperty.Port => GetPort(servicePort), 790EndpointProperty.HostAndPort => GetHostValue(suffix: GetPortSuffix(servicePort)), 791EndpointProperty.TargetPort => GetPort(targetPort), 792EndpointProperty.Scheme => scheme,
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
51endpointReference.Property(EndpointProperty.Url),
Aspire.Hosting.Maui (5)
MauiOtlpExtensions.cs (5)
328var allocatedPort = await TryGetEndpointPortAsync(endpointReference, EndpointProperty.Port, cancellationToken).ConfigureAwait(false); 338var targetPort = await TryGetEndpointPortAsync(endpointReference, EndpointProperty.TargetPort, cancellationToken).ConfigureAwait(false); 365var targetPort = await TryGetEndpointPortAsync(endpointReference, EndpointProperty.TargetPort, cancellationToken).ConfigureAwait(false); 371EndpointProperty property, 379catch (InvalidOperationException) when (property == EndpointProperty.TargetPort && endpointReference.IsAllocated)
Aspire.Hosting.Milvus (3)
MilvusServerResource.cs (3)
42public EndpointReferenceExpression Host => PrimaryEndpoint.Property(EndpointProperty.Host); 47public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port); 70public ReferenceExpression UriExpression => ReferenceExpression.Create($"{PrimaryEndpoint.Property(EndpointProperty.Url)}");
Aspire.Hosting.MongoDB (5)
MongoDBServerResource.cs (3)
44public EndpointReferenceExpression Host => PrimaryEndpoint.Property(EndpointProperty.Host); 49public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port); 144builder.Append($"{PrimaryEndpoint.Property(EndpointProperty.HostAndPort)}");
ReplicaSet\MongoDBReplicaSetBuilderExtensions.cs (1)
160.Property(EndpointProperty.HostAndPort)
ReplicaSet\MongoDBReplicaSetResource.cs (1)
104builder.Append($"{member.PrimaryEndpoint.Property(EndpointProperty.HostAndPort)}");
Aspire.Hosting.MySql (4)
MySqlServerResource.cs (4)
39public EndpointReferenceExpression Host => PrimaryEndpoint.Property(EndpointProperty.Host); 44public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port); 56$"Server={PrimaryEndpoint.Property(EndpointProperty.Host)};Port={PrimaryEndpoint.Property(EndpointProperty.Port)};User ID={DefaultUserName};Password={PasswordParameter}");
Aspire.Hosting.Nats (3)
NatsServerResource.cs (3)
39public EndpointReferenceExpression Host => PrimaryEndpoint.Property(EndpointProperty.Host); 44public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port); 97builder.Append($"{PrimaryEndpoint.Property(EndpointProperty.HostAndPort)}");
Aspire.Hosting.Oracle (3)
OracleDatabaseServerResource.cs (3)
36public EndpointReferenceExpression Host => PrimaryEndpoint.Property(EndpointProperty.Host); 41public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port); 53$"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}"); 109public EndpointReferenceExpression Host => PrimaryEndpoint.Property(EndpointProperty.Host); 114public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port);
Aspire.Hosting.Python (1)
PythonAppResourceBuilderExtensions.cs (1)
300c.Args.Add(endpoint.Property(EndpointProperty.TargetPort));
Aspire.Hosting.Qdrant (8)
QdrantServerResource.cs (8)
42public EndpointReferenceExpression GrpcHost => PrimaryEndpoint.Property(EndpointProperty.Host); 47public EndpointReferenceExpression GrpcPort => PrimaryEndpoint.Property(EndpointProperty.Port); 57public EndpointReferenceExpression HttpHost => HttpEndpoint.Property(EndpointProperty.Host); 62public EndpointReferenceExpression HttpPort => HttpEndpoint.Property(EndpointProperty.Port); 69$"Endpoint={PrimaryEndpoint.Property(EndpointProperty.Url)};Key={ApiKeyParameter}"); 77public ReferenceExpression UriExpression => ReferenceExpression.Create($"{PrimaryEndpoint.Property(EndpointProperty.Url)}"); 84$"Endpoint={HttpEndpoint.Property(EndpointProperty.Url)};Key={ApiKeyParameter}"); 92public ReferenceExpression HttpUriExpression => ReferenceExpression.Create($"{HttpEndpoint.Property(EndpointProperty.Url)}");
Aspire.Hosting.RabbitMQ (3)
RabbitMQServerResource.cs (3)
45public EndpointReferenceExpression Host => PrimaryEndpoint.Property(EndpointProperty.Host); 50public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port); 101builder.Append($"{PrimaryEndpoint.Property(EndpointProperty.HostAndPort)}");
Aspire.Hosting.Radius (28)
Publishing\RadiusInfrastructureBuilder.cs (15)
3336EndpointProperty property, 3376case EndpointProperty.Host or EndpointProperty.IPV4Host: 3379case EndpointProperty.Port or EndpointProperty.TargetPort: 3382case EndpointProperty.HostAndPort: 3387case EndpointProperty.Url: 3393case EndpointProperty.Scheme: 3396case EndpointProperty.TlsEnabled: 3460EndpointProperty property, 3465property is not (EndpointProperty.Scheme or EndpointProperty.TlsEnabled or EndpointProperty.Url)) 4145if (!TryProjectBackingEndpoint(endpointReference, EndpointProperty.Url, parts)) 4869ResolveHostExpression(((IComputeEnvironmentResource)_environment).GetEndpointPropertyExpression(endpointReference.Property(EndpointProperty.Url)));
RadiusEnvironmentResource.cs (13)
175var property = endpointReferenceExpression.Property; 202EndpointProperty.Url => IsDefaultPort(scheme, port.Value) 205EndpointProperty.Host or EndpointProperty.IPV4Host => host.Value, 206EndpointProperty.Port => GuardedAddress(endpointReference, () => ReferenceExpression.Create($"{RadiusServiceDiscovery.ToInvariantString(port.Value)}")), 212EndpointProperty.TargetPort => GuardedAddress(endpointReference, () => resolvedServicePort.Value is int targetPort 215EndpointProperty.Scheme => ReferenceExpression.Create($"{scheme}"), 216EndpointProperty.HostAndPort => ReferenceExpression.Create($"{host.Value}:{RadiusServiceDiscovery.ToInvariantString(port.Value)}"), 217EndpointProperty.TlsEnabled => ReferenceExpression.Create($"{(endpoint.TlsEnabled ? bool.TrueString : bool.FalseString)}"), 238private static void ThrowIfTransportSecurityIsNotRecipeBacked(EndpointReference endpointReference, EndpointProperty property) 241property is not (EndpointProperty.Scheme or EndpointProperty.TlsEnabled or EndpointProperty.Url))
Aspire.Hosting.Radius.Tests (40)
Publishing\BackingResourceContractTests.cs (12)
126[InlineData(EndpointProperty.Host)] 127[InlineData(EndpointProperty.Port)] 128[InlineData(EndpointProperty.Url)] 129[InlineData(EndpointProperty.HostAndPort)] 130[InlineData(EndpointProperty.TargetPort)] 131public void CrossEnvironmentEndpointResolution_FailsWithThePublicException(EndpointProperty property) 158.GetEndpointPropertyExpression(cache.GetEndpoint("tcp").Property(EndpointProperty.Host))); 198/// <see cref="EndpointProperty.Scheme"/> and <see cref="EndpointProperty.TlsEnabled"/> are read 209[InlineData(EndpointProperty.Scheme, "redis")] 210[InlineData(EndpointProperty.TlsEnabled, "False")] 211public void NonAddressEndpointProperties_AreResolvedForBackingResources(EndpointProperty property, string expected)
Publishing\BackingResourceProjectionTests.cs (4)
90.WithEnvironment("CUSTOM_HOST", cache.GetEndpoint("tcp").Property(EndpointProperty.Host)) 91.WithEnvironment("CUSTOM_PORT", cache.GetEndpoint("tcp").Property(EndpointProperty.Port)) 92.WithEnvironment("CUSTOM_URL", cache.GetEndpoint("tcp").Property(EndpointProperty.Url)); 112.WithEnvironment("BACKEND_HOST", backend.GetEndpoint("http").Property(EndpointProperty.Host));
Publishing\BackingResourceValueResolutionTests.cs (10)
125.WithEnvironment("MISSING", backend.GetEndpoint("does-not-exist").Property(EndpointProperty.Host)) 126.WithEnvironment("PRESENT", backend.GetEndpoint("http").Property(EndpointProperty.Host)); 415.WithEnvironment("MGMT_URL", rabbit.GetEndpoint("management").Property(EndpointProperty.Url)); 434.WithEnvironment("AMQP_HOST", rabbit.GetEndpoint("tcp").Property(EndpointProperty.Host)); 967.WithEnvironment("CACHE_URL", cache.GetEndpoint("tcp").Property(EndpointProperty.Url)); 986.WithEnvironment("CACHE_HOST", cache.GetEndpoint("tcp").Property(EndpointProperty.Host)) 987.WithEnvironment("CACHE_PORT", cache.GetEndpoint("tcp").Property(EndpointProperty.Port)); 1190var port = cache.GetEndpoint("tcp").Property(EndpointProperty.Port); 1217ReferenceExpression.Create($"primary-{cache.GetEndpoint("tcp").Property(EndpointProperty.Host)}"), 1476.WithEnvironment("STORE_HOST", store.GetEndpoint("tcp").Property(EndpointProperty.Host));
RadiusEnvironmentResourceTests.cs (14)
74[InlineData(EndpointProperty.Url, "http://api-api.default.svc.cluster.local:8080")] 75[InlineData(EndpointProperty.Host, "api-api.default.svc.cluster.local")] 76[InlineData(EndpointProperty.IPV4Host, "api-api.default.svc.cluster.local")] 77[InlineData(EndpointProperty.HostAndPort, "api-api.default.svc.cluster.local:8080")] 78[InlineData(EndpointProperty.Port, "8080")] 79[InlineData(EndpointProperty.TargetPort, "8080")] 80[InlineData(EndpointProperty.Scheme, "http")] 81public void GetEndpointPropertyExpression_UsesServiceNameAndContainerPort(EndpointProperty property, string expected) 109[InlineData(EndpointProperty.Scheme)] 110[InlineData(EndpointProperty.TlsEnabled)] 111[InlineData(EndpointProperty.Url)] 112public void GetEndpointPropertyExpression_TlsEnabledBackingResource_Throws(EndpointProperty property) 149.GetEndpointPropertyExpression(endpoint.Property(EndpointProperty.Scheme)); 171.GetEndpointPropertyExpression(endpoint.Property(EndpointProperty.Scheme));
Aspire.Hosting.Redis (7)
RedisBuilderExtensions.cs (3)
206argsCtx.Args.Add(redis.GetEndpoint(RedisResource.PrimaryEndpointName).Property(EndpointProperty.TargetPort)); 208argsCtx.Args.Add(redis.GetEndpoint(RedisResource.SecondaryEndpointName).Property(EndpointProperty.TargetPort)); 396context.EnvironmentVariables[$"RI_REDIS_HOST{counter}"] = redisInstance.PrimaryEndpoint.Property(EndpointProperty.Host);
RedisResource.cs (4)
54public EndpointReferenceExpression Host => PrimaryEndpoint.Property(EndpointProperty.Host); 59public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port); 87builder.Append($"{PrimaryEndpoint.Property(EndpointProperty.HostAndPort)}"); 148builder.Append($"{PrimaryEndpoint.Property(EndpointProperty.Scheme)}");
Aspire.Hosting.Seq (4)
SeqResource.cs (4)
25public EndpointReferenceExpression Host => PrimaryEndpoint.Property(EndpointProperty.Host); 30public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port); 36ReferenceExpression.Create($"{PrimaryEndpoint.Property(EndpointProperty.Url)}"); 44public ReferenceExpression UriExpression => ReferenceExpression.Create($"{PrimaryEndpoint.Property(EndpointProperty.Url)}");
Aspire.Hosting.SqlServer (4)
SqlServerServerResource.cs (4)
36public EndpointReferenceExpression Host => PrimaryEndpoint.Property(EndpointProperty.Host); 41public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port); 50$"Server={PrimaryEndpoint.Property(EndpointProperty.IPV4Host)},{PrimaryEndpoint.Property(EndpointProperty.Port)};User ID={DefaultUserName};Password={PasswordParameter};TrustServerCertificate=true");
Aspire.Hosting.Tests (118)
ComputeEnvironmentEndpointResolverTests.cs (6)
24endpoint.Property(EndpointProperty.Url), [currentEnv.Resource], out var expression); 63endpoint.Property(EndpointProperty.Url), [currentEnv.Resource], out var expression); 82endpoint.Property(EndpointProperty.Url), [currentEnv.Resource], out var expression); 99endpoint.Property(EndpointProperty.Url), [currentEnv.Resource], out var expression); 122endpoint.Property(EndpointProperty.Url), [currentEnv.Resource], out var expression); 146endpoint.Property(EndpointProperty.Url), [currentEnv.Resource], out _));
ComputeEnvironmentValidationTests.cs (10)
64[InlineData(EndpointProperty.Url, "http://api.example.com:8080")] 65[InlineData(EndpointProperty.Host, "api.example.com")] 66[InlineData(EndpointProperty.IPV4Host, "api.example.com")] 67[InlineData(EndpointProperty.Port, "8080")] 68[InlineData(EndpointProperty.TargetPort, "5000")] 69[InlineData(EndpointProperty.Scheme, "http")] 70[InlineData(EndpointProperty.HostAndPort, "api.example.com:8080")] 71[InlineData(EndpointProperty.TlsEnabled, "False")] 72public async Task GetEndpointPropertyExpression_ReturnsDefaultEndpointPropertyExpression(EndpointProperty property, string expected) 91var ex = Assert.Throws<InvalidOperationException>(() => environment.GetEndpointPropertyExpression(endpointReference.Property(EndpointProperty.Url)));
ConditionalReferenceExpressionTests.cs (5)
81var condition = endpointRef.Property(EndpointProperty.TlsEnabled); 130var tlsExpr = endpointRef.Property(EndpointProperty.TlsEnabled); 147var tlsExpr = endpointRef.Property(EndpointProperty.TlsEnabled); 161var tlsExpr = endpointRef.Property(EndpointProperty.TlsEnabled); 174var tlsExpr = endpointRef.Property(EndpointProperty.TlsEnabled);
Dcp\DcpExecutorTests.cs (33)
729.WithArgs(c => c.Args.Add(endpoint.Property(EndpointProperty.Port))); 769c.Args.Add(executable.GetEndpoint("http").Property(EndpointProperty.Port)); 4527Assert.Equal(allocatedPort.ToString(CultureInfo.InvariantCulture), await database.GetEndpoint("NoPortTargetPortSet").Property(EndpointProperty.Port).GetValueAsync()); 4543database.WithEnvironment("PUBLIC_PORT", database.GetEndpoint("NoPortTargetPortSet").Property(EndpointProperty.Port)); 4544database.WithEnvironment("PUBLIC_PORT_AGAIN", database.GetEndpoint("NoPortTargetPortSet").Property(EndpointProperty.Port)); 4591database.WithEnvironment("PUBLIC_HOST_AND_PORT", database.GetEndpoint("NoPortTargetPortSet").Property(EndpointProperty.HostAndPort)); 9609.WithEnvironment("EXE_PROXIED_PORT", executable.GetEndpoint("proxied").Property(EndpointProperty.Port)) 9610.WithEnvironment("EXE_NOTPROXIED_PORT", executable.GetEndpoint("notProxied").Property(EndpointProperty.Port)); 9616.WithEnvironment("EXE_PROXIED_PORT", executable.GetEndpoint("proxied").Property(EndpointProperty.Port)) 9617.WithEnvironment("EXE_NOTPROXIED_PORT", executable.GetEndpoint("notProxied").Property(EndpointProperty.Port)); 9795c.EnvironmentVariables["EXEC_PORT"] = executable.GetEndpoint("http").Property(EndpointProperty.Port); 9830c.EnvironmentVariables["EXEC_PORT"] = executable.GetEndpoint("http").Property(EndpointProperty.Port); 9871c.Args.Add(executable.GetEndpoint("http").Property(EndpointProperty.Port)); 10107c.Args.Add(executable.GetEndpoint("http").Property(EndpointProperty.Port)); 10144.WithEnvironment("EXEC_PORT", executable.GetEndpoint("http").Property(EndpointProperty.Port)); 10175.WithEnvironment("EXECUTABLE_PORT", executable.GetEndpoint("http").Property(EndpointProperty.Port)); 10208$"{containerEndpoint.Property(EndpointProperty.Scheme)}://{containerEndpoint.Property(EndpointProperty.Host)}:{containerEndpoint.Property(EndpointProperty.Port)}")) 10209.WithEnvironment("HOST_PORT", executable.GetEndpoint("unused").Property(EndpointProperty.Port)); 10253.WithEnvironment("TARGET_PORT", targetEndpoint.Property(EndpointProperty.Port)); 10297project.GetEndpoint("http", KnownNetworkIdentifiers.DefaultAspireContainerNetwork).Property(EndpointProperty.Port)); 10336target.GetEndpoint("http", KnownNetworkIdentifiers.DefaultAspireContainerNetwork).Property(EndpointProperty.Port)); 10373executable.GetEndpoint("http", KnownNetworkIdentifiers.DefaultAspireContainerNetwork).Property(EndpointProperty.Port)); 10442executable.GetEndpoint("udp", KnownNetworkIdentifiers.DefaultAspireContainerNetwork).Property(EndpointProperty.Port)); 10497target.GetEndpoint("http", KnownNetworkIdentifiers.DefaultAspireContainerNetwork).Property(EndpointProperty.Port)); 10538context.EnvironmentVariables["CONTAINER_PORT"] = containerEndpoint.Property(EndpointProperty.Port); 10587executable.GetEndpoint("http", KnownNetworkIdentifiers.DefaultAspireContainerNetwork).Property(EndpointProperty.Port)); 10627.WithEnvironment("TARGET_PORT", containerEndpoint.Property(EndpointProperty.Port)); 10629.WithEnvironment("TARGET_PORT", target.GetEndpoint("http").Property(EndpointProperty.Port)); 10685.WithEnvironment("EXEC_A_PORT", executableA.GetEndpoint("http").Property(EndpointProperty.Port)); 10691.WithEnvironment("EXEC_B_PORT", executableB.GetEndpoint("http").Property(EndpointProperty.Port)) 10748.WithEnvironment("UPSTREAM_PORT", upstreamExecutable.GetEndpoint("http").Property(EndpointProperty.Port))
EndpointReferenceTests.cs (37)
38var endpointExpr = endpointRef.Property(EndpointProperty.Url); 58var endpointExpr = endpointRef.Property(EndpointProperty.Url); 72var hostExpr = endpointRef.Property(EndpointProperty.Host); 91var portExpr = endpointRef.Property(EndpointProperty.Port); 110var schemeExpr = endpointRef.Property(EndpointProperty.Scheme); 124var ipv4Expr = endpointRef.Property(EndpointProperty.IPV4Host); 138var targetPortExpr = endpointRef.Property(EndpointProperty.TargetPort); 152var targetPortExpr = endpointRef.Property(EndpointProperty.TargetPort); 171var endpointExpr = endpointRef.Property(EndpointProperty.Url); 189var expr1 = endpointRef.Property(EndpointProperty.Url); 190var expr2 = endpointRef.Property(EndpointProperty.Host); 191var expr3 = endpointRef.Property(EndpointProperty.Port); 306[InlineData(EndpointProperty.Url, ResourceKind.Host, ResourceKind.Host, "blah://localhost:1234")] 307[InlineData(EndpointProperty.Url, ResourceKind.Host, ResourceKind.Container, "blah://localhost:1234")] 308[InlineData(EndpointProperty.Url, ResourceKind.Container, ResourceKind.Host, "blah://host.docker.internal:1234")] 309[InlineData(EndpointProperty.Url, ResourceKind.Container, ResourceKind.Container, "blah://destination.dev.internal:4567")] 310[InlineData(EndpointProperty.Host, ResourceKind.Host, ResourceKind.Host, "localhost")] 311[InlineData(EndpointProperty.Host, ResourceKind.Host, ResourceKind.Container, "localhost")] 312[InlineData(EndpointProperty.Host, ResourceKind.Container, ResourceKind.Host, "host.docker.internal")] 313[InlineData(EndpointProperty.Host, ResourceKind.Container, ResourceKind.Container, "destination.dev.internal")] 314[InlineData(EndpointProperty.IPV4Host, ResourceKind.Host, ResourceKind.Host, "127.0.0.1")] 315[InlineData(EndpointProperty.IPV4Host, ResourceKind.Host, ResourceKind.Container, "127.0.0.1")] 316[InlineData(EndpointProperty.IPV4Host, ResourceKind.Container, ResourceKind.Host, "host.docker.internal")] 317[InlineData(EndpointProperty.IPV4Host, ResourceKind.Container, ResourceKind.Container, "destination.dev.internal")] 318[InlineData(EndpointProperty.Port, ResourceKind.Host, ResourceKind.Host, "1234")] 319[InlineData(EndpointProperty.Port, ResourceKind.Host, ResourceKind.Container, "1234")] 320[InlineData(EndpointProperty.Port, ResourceKind.Container, ResourceKind.Host, "1234")] 321[InlineData(EndpointProperty.Port, ResourceKind.Container, ResourceKind.Container, "4567")] 322[InlineData(EndpointProperty.Scheme, ResourceKind.Host, ResourceKind.Host, "blah")] 323[InlineData(EndpointProperty.Scheme, ResourceKind.Host, ResourceKind.Container, "blah")] 324[InlineData(EndpointProperty.Scheme, ResourceKind.Container, ResourceKind.Host, "blah")] 325[InlineData(EndpointProperty.Scheme, ResourceKind.Container, ResourceKind.Container, "blah")] 326[InlineData(EndpointProperty.HostAndPort, ResourceKind.Host, ResourceKind.Host, "localhost:1234")] 327[InlineData(EndpointProperty.HostAndPort, ResourceKind.Host, ResourceKind.Container, "localhost:1234")] 328[InlineData(EndpointProperty.HostAndPort, ResourceKind.Container, ResourceKind.Host, "host.docker.internal:1234")] 329[InlineData(EndpointProperty.HostAndPort, ResourceKind.Container, ResourceKind.Container, "destination.dev.internal:4567")] 330public async Task PropertyResolutionTest(EndpointProperty property, ResourceKind sourceKind, ResourceKind destinationKind, object expectedResult)
ExpressionResolverTests.cs (19)
327ReferenceExpression.Create($"{PrimaryEndpoint.Property(EndpointProperty.Url)}"); 351{ "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)}/;") }, 352{ "Url", ReferenceExpression.Create($"Url={Endpoint1.Property(EndpointProperty.Url)};") }, 354{ "OnlyHost", ReferenceExpression.Create($"Host={Endpoint1.Property(EndpointProperty.Host)};") }, 355{ "OnlyPort", ReferenceExpression.Create($"Port={Endpoint1.Property(EndpointProperty.Port)};") }, 356{ "HostAndPort", ReferenceExpression.Create($"HostPort={Endpoint1.Property(EndpointProperty.HostAndPort)}") }, 357{ "PortBeforeHost", ReferenceExpression.Create($"Port={Endpoint1.Property(EndpointProperty.Port)};Host={Endpoint1.Property(EndpointProperty.Host)};") }, 358{ "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)}/;") }, 363{ "UrlEncodedHost", ReferenceExpression.Create($"Host={Endpoint3.Property(EndpointProperty.Host):uri};") },
ResourceDependencyTests.cs (1)
55.WithEnvironment("API_PORT", api.GetEndpoint("http").Property(EndpointProperty.Port));
src\Shared\ComputeEnvironmentEndpointResolver.cs (1)
51endpointReference.Property(EndpointProperty.Url),
WithEnvironmentTests.cs (6)
240.WithEnvironment("PORT", $"{endpoint.Property(EndpointProperty.Port)}") 241.WithEnvironment("TARGET_PORT", $"{endpoint.Property(EndpointProperty.TargetPort)}") 288.WithEnvironment("URL", $"{endpoint.Property(EndpointProperty.Host)}:{endpoint.Property(EndpointProperty.Port)}"); 321.WithEnvironment("TARGET_PORT", $"{endpoint.Property(EndpointProperty.TargetPort)}"); 452var portProperty = endpoint.Property(EndpointProperty.Port);
Aspire.Hosting.Valkey (3)
ValkeyResource.cs (3)
40public EndpointReferenceExpression Host => PrimaryEndpoint.Property(EndpointProperty.Host); 45public EndpointReferenceExpression Port => PrimaryEndpoint.Property(EndpointProperty.Port); 66builder.Append($"{PrimaryEndpoint.Property(EndpointProperty.HostAndPort)}");
Aspire.Hosting.Yarp (5)
YarpResourceExtensions.cs (5)
73.WithEnvironment("ASPNETCORE_HTTPS_PORT", resource.GetEndpoint("https").Property(EndpointProperty.Port)) 74.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)
44ctx.EnvironmentVariables["HTTPS_REDIRECT_PORT"] = httpsEndpoint.Property(EndpointProperty.Port);
Stress.AppHost (7)
AppHost.cs (7)
24.WithArgs(c => c.Args.Add(manualArgEndpoint.Property(EndpointProperty.Port))); 28.WithArgs(c => c.Args.Add(manualArgEndpoint.Property(EndpointProperty.Port))); 33.WithArgs(c => c.Args.Add(manualArgEndpoint.Property(EndpointProperty.Port))); 37.WithArgs(c => c.Args.Add(manualArgEndpoint.Property(EndpointProperty.Port))) 74.WithEnvironment("HOST", $"{serviceBuilder.GetEndpoint("http").Property(EndpointProperty.Host)}") 75.WithEnvironment("PORT", $"{serviceBuilder.GetEndpoint("http").Property(EndpointProperty.Port)}") 76.WithEnvironment("URL", $"{serviceBuilder.GetEndpoint("http").Property(EndpointProperty.Url)}");