2 writes to EndpointName
Aspire.Hosting (2)
ApplicationModel\EndpointReference.cs (2)
268EndpointName = endpoint.Name; 300EndpointName = endpointName;
140 references to EndpointName
Aspire.Hosting (47)
ApplicationModel\EndpointReference.cs (9)
37return $"The endpoint `{EndpointName}` is not defined for the resource `{Resource.Name}`. The resource has no endpoints defined."; 41return $"The endpoint `{EndpointName}` is not defined for the resource `{Resource.Name}`. Available endpoints: {formattedNames}."; 96public bool IsHttpSchemeNamedEndpoint => string.Equals(EndpointName, "http", StringComparisons.EndpointAnnotationUriScheme) || 97string.Equals(EndpointName, "https", StringComparisons.EndpointAnnotationUriScheme); 148_ => throw new InvalidOperationException($"The property '{property}' is not supported for the endpoint '{EndpointName}'.") 151string Binding(string prop) => $"{{{Resource.Name}.bindings.{EndpointName}.{prop}}}"; 222?? throw new InvalidOperationException($"The endpoint `{EndpointName}` is not allocated for the resource `{Resource.Name}`."); 232.SingleOrDefault(a => string.Equals(a.Name, EndpointName, StringComparisons.EndpointAnnotationName)); 384_ => throw new InvalidOperationException($"The property '{Property}' is not supported for the endpoint '{Endpoint.EndpointName}'.")
ApplicationModel\ResourceExtensions.cs (1)
683endpointReference.EndpointName,
Dashboard\DashboardEventHandlers.cs (6)
307if (endpoint.EndpointName is "http" or "https") 311url.DisplayText = $"Dashboard ({endpoint.EndpointName})"; 322url.DisplayText = endpoint.EndpointName; 681foreach (var e in frontendEndpoints.Where(e => e.EndpointName is "http" or "https")) 697var publicEndpoint = frontendEndpoints.FirstOrDefault(e => e.EndpointName is "https") ?? frontendEndpoints.First(e => e.EndpointName is "http");
Dcp\DcpResourceWatcher.cs (1)
957string.Equals(e.EndpointName, endpointName, StringComparisons.EndpointAnnotationName)))
Dcp\ExecutableCreator.cs (2)
150$"Resource '{resource.Name}' references endpoint '{endpointReference.EndpointName}' on executable resource " + 157$"Resource '{resource.Name}' references endpoint '{endpointReference.EndpointName}' on executable resource " +
Dcp\ResourceSnapshotBuilder.cs (3)
311string.Equals(endpointName, u.Endpoint?.EndpointName, StringComparisons.EndpointAnnotationName) 324new(Name: endpointUrl.Endpoint!.EndpointName, 342var endpointName = endpointUrl.Endpoint.EndpointName;
ExternalServiceBuilderExtensions.cs (2)
476return HealthCheckResult.Unhealthy($"The endpoint '{_endpoint.EndpointName}' does not exist on the resource."); 485return HealthCheckResult.Unhealthy($"The endpoint '{_endpoint.EndpointName}' does not have a URL.");
McpServerResourceBuilderExtensions.cs (2)
58endpoint = endpoints.FirstOrDefault(e => string.Equals(e.EndpointName, endpointName, StringComparisons.EndpointAnnotationName)); 70endpoint = endpoints.FirstOrDefault(e => string.Equals(e.EndpointName, scheme, StringComparisons.EndpointAnnotationName));
Orchestrator\ApplicationOrchestrator.cs (5)
223urls = resourceUrls.Select(url => new UrlSnapshot(Name: url.Endpoint?.EndpointName, Url: url.Url, IsInternal: url.DisplayLocation == UrlDisplayLocation.DetailsOnly) 481var primaryUrl = urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, primaryLaunchProfileEndpoint.Name, StringComparisons.EndpointAnnotationName)); 502_logger.LogTrace("Updating URL '{Url}' with path '{Path}' for launch profile endpoint '{EndpointName}' for resource '{ResourceName}'.", url.Url, primaryPath, url.Endpoint.EndpointName, resource.Name); 508_logger.LogTrace("Updated URL to '{Url}' for launch profile endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, url.Endpoint.EndpointName, resource.Name); 544_logger.LogTrace("Converted relative URL to absolute URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, endpoint.EndpointName, resource.Name);
ProjectResourceBuilderExtensions.cs (1)
797var url = context.Urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, endpoint.Name, StringComparisons.EndpointAnnotationName));
ResourceBuilderExtensions.cs (15)
820if (specificEndpointName != null && !string.Equals(endpoint.EndpointName, specificEndpointName, StringComparison.OrdinalIgnoreCase)) 826var endpointName = endpoint.EndpointName; 1448ApplyEndpoints(builder, endpointReference.Resource, endpointReference.EndpointName); 2259var url = context.Urls.FirstOrDefault(u => u.Endpoint?.EndpointName == endpointName); 2349string.Equals(urlEndpoint.EndpointName, endpoint.EndpointName, StringComparisons.EndpointAnnotationName)); 2354context.Logger.LogWarning("Could not execute callback to customize endpoint URL as no URL for endpoint '{EndpointName}' could be found on resource '{ResourceName}'.", endpoint.EndpointName, builder.Resource.Name); 2366context.Logger.LogWarning("Could not execute callback to add an endpoint URL as no endpoint with name '{EndpointName}' could be found on resource '{ResourceName}'.", endpoint.EndpointName, endpoint.Resource.Name); 2934throw new DistributedApplicationException($"Could not create HTTP health check for resource '{builder.Resource.Name}' as the endpoint with name '{endpoint.EndpointName}' and scheme '{endpoint.Scheme}' is not an HTTP endpoint."); 2940var endpointName = endpoint.EndpointName; 3809throw new DistributedApplicationException($"Could not create HTTP command for resource '{builder.Resource.Name}' as the endpoint with name '{endpoint.EndpointName}' and scheme '{endpoint.Scheme}' is not an HTTP endpoint."); 3817commandName ??= $"{endpoint.Resource.Name}-{endpoint.EndpointName}-http-{commandOptions.Method.Method.ToLowerInvariant()}-{path}"; 4498matchingEndpoint = endpoints.FirstOrDefault(e => string.Equals(e.EndpointName, name, StringComparisons.EndpointAnnotationName)); 4503throw new DistributedApplicationException($"Could not create {errorDisplayNoun} for resource '{builder.Resource.Name}' as the endpoint with name '{matchingEndpoint.EndpointName}' and scheme '{matchingEndpoint.Scheme}' is not an HTTP endpoint."); 4524matchingEndpoint = endpoints.FirstOrDefault(e => string.Equals(e.EndpointName, scheme, StringComparisons.EndpointAnnotationUriScheme));
Aspire.Hosting.Azure.AppContainers (4)
AzureContainerAppEnvironmentResource.cs (1)
268$"'{endpointReference.EndpointName}' on resource '{endpointReference.Resource.Name}'. " +
BaseContainerAppContext.cs (3)
253var mapping = context._endpointMapping[ep.EndpointName]; 318var mapping = context._endpointMapping[epExpr.Endpoint.EndpointName]; 566&& _endpointMapping.TryGetValue(endpointProbeAnnotation.EndpointReference.EndpointName, out var endpointMapping))
Aspire.Hosting.Azure.AppService (4)
AzureAppServiceWebsiteContext.cs (4)
215(GetEndpointValue(context._slotEndpointMapping[ep.EndpointName], EndpointProperty.Url), secretType) : 216(GetEndpointValue(context._endpointMapping[ep.EndpointName], EndpointProperty.Url), secretType); 259var mapping = isSlot ? context._slotEndpointMapping[epExpr.Endpoint.EndpointName] : context._endpointMapping[epExpr.Endpoint.EndpointName];
Aspire.Hosting.Azure.Sandboxes (8)
AzureSandboxEndpointPropertyValueProvider.cs (8)
33_targetPort = ResolveEndpointTargetPort(resource, endpointReferenceExpression.Endpoint.EndpointName) ?? 34throw new InvalidOperationException($"Endpoint '{endpointReferenceExpression.Endpoint.EndpointName}' on resource '{resource.TargetResource.Name}' does not have a target port."); 45$"{{{_resource.Name}.endpoints.{_endpointReferenceExpression.Endpoint.EndpointName}.{_endpointReferenceExpression.Property.ToString().ToLowerInvariant()}}}"; 100throw new InvalidOperationException($"Azure sandbox deployment state for resource '{_resource.TargetResource.Name}' endpoint '{_endpointReferenceExpression.Endpoint.EndpointName}' contains invalid URL '{url}'."); 112_ => throw new InvalidOperationException($"The property '{_endpointReferenceExpression.Property}' is not supported for the endpoint '{_endpointReferenceExpression.Endpoint.EndpointName}'.") 117new($"Azure sandbox endpoint '{_endpointReferenceExpression.Endpoint.EndpointName}' on resource '{_resource.TargetResource.Name}' does not have a deployed URL yet. Runtime sandbox URLs cannot be used as first-pass Azure provisioning values; deploy the producing sandbox before resolving this reference."); 123throw new InvalidOperationException($"Endpoint '{_endpointReferenceExpression.Endpoint.EndpointName}' on resource '{_resource.TargetResource.Name}' is not exposed by the Azure sandbox deployment target."); 160var endpointName = endpointReference.EndpointName;
Aspire.Hosting.Azure.Tests (5)
AzureCosmosDBExtensionsTests.cs (2)
1260var healthUrl = Assert.Single(urls, u => u.Endpoint?.EndpointName == "emulatorhealth"); 1285var explorerUrl = Assert.Single(urls, u => u.Endpoint?.EndpointName == "data-explorer");
AzureSandboxesTests.cs (3)
2660project.GetEndpoints().OrderBy(static endpoint => endpoint.EndpointName, StringComparer.Ordinal), 2661endpoint => Assert.Equal("http", endpoint.EndpointName), 2662endpoint => Assert.Equal("https", endpoint.EndpointName));
Aspire.Hosting.Blazor (1)
GatewayOriginReference.cs (1)
14public string ValueExpression => $"{{{endpoint.Resource.Name}.bindings.{endpoint.EndpointName}.url}}";
Aspire.Hosting.DevTunnels (17)
DevTunnelResourceBuilderExtensions.cs (17)
215portLogger.LogInformation("Configured dev tunnel port '{Port}' on tunnel '{Tunnel}' targeting endpoint '{Endpoint}' on resource '{TargetResource}'", tunnelPort, portResource.DevTunnel.TunnelId, portResource.TargetEndpoint.EndpointName, portResource.TargetEndpoint.Resource.Name); 441.FirstOrDefault(p => p.TargetEndpoint.Resource == resource && string.Equals(p.TargetEndpoint.EndpointName, endpointName, StringComparisons.EndpointAnnotationName)); 465&& string.Equals(p.TargetEndpoint.EndpointName, targetEndpointReference.EndpointName, StringComparisons.EndpointAnnotationName)); 469return CreateEndpointReferenceWithError(tunnelBuilder.Resource, targetEndpointReference.Resource, targetEndpointReference.EndpointName); 525var endpointName = port.TargetEndpoint.EndpointName; 574throw new ArgumentException($"Target endpoint '{targetEndpoint.EndpointName}' on resource '{targetEndpoint.Resource.Name}' has already been added to dev tunnel '{tunnel.Name}'.", nameof(targetEndpoint)); 578.SingleOrDefault(a => string.Equals(a.Name, targetEndpoint.EndpointName, StringComparisons.EndpointAnnotationName)) is { } targetEndpointAnnotation) 596_ => throw new ArgumentException($"Cannot tunnel endpoint '{targetEndpoint.EndpointName}' on resource '{targetResource.Name}' because it uses the unsupported scheme '{targetEndpoint.Scheme}'. Only 'http' and 'https' endpoints can be tunneled."), 598portOptions.Description ??= $"{targetResource.Name}/{targetEndpoint.EndpointName}"; 600var portName = $"{tunnel.Name}-{targetResource.Name}-{targetEndpoint.EndpointName}"; 603portOptions.Labels.Add(targetEndpoint.EndpointName); 666if (urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, DevTunnelPortResource.TunnelEndpointName, StringComparisons.EndpointAnnotationName) 674if (urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, DevTunnelPortResource.TunnelEndpointName, StringComparisons.EndpointAnnotationName) 707new(CustomResourceKnownProperties.Source, $"{targetResource.Name}/{targetEndpoint.EndpointName}"), 709new("TargetEndpoint", targetEndpoint.EndpointName), 760NormalizeUrl(portUri), portResource.TargetEndpoint.Url, portResource.TargetEndpoint.Resource.Name, portResource.TargetEndpoint.EndpointName);
Aspire.Hosting.DevTunnels.Tests (7)
DevTunnelMonitorTests.cs (1)
562var otherPort = Assert.Single(test.Tunnel.Ports, p => p.TargetEndpoint.EndpointName == "other");
DevTunnelResourceBuilderExtensionsTests.cs (5)
393Assert.Equal(DevTunnelPortResource.TunnelEndpointName, tunnelEndpoint.EndpointName); 410Assert.Equal(DevTunnelPortResource.TunnelEndpointName, tunnelEndpoint.EndpointName); 428Assert.Equal(DevTunnelPortResource.TunnelEndpointName, tunnelEndpoint.EndpointName); 506Assert.Equal(DevTunnelPortResource.TunnelEndpointName, httpTunnelEndpoint.EndpointName); 507Assert.Equal(DevTunnelPortResource.TunnelEndpointName, httpsTunnelEndpoint.EndpointName);
TestDevTunnelMonitor.cs (1)
36Port = Assert.Single(Tunnel.Ports, p => p.TargetEndpoint.EndpointName == "http");
Aspire.Hosting.Docker (2)
DockerComposeServiceResourceExtensions.cs (2)
24var mapping = referencedResource.EndpointMappings[ep.EndpointName]; 52var mapping = referencedResource.EndpointMappings[epExpr.Endpoint.EndpointName];
Aspire.Hosting.Foundry (3)
HostedAgent\AzureHostedAgentResource.cs (1)
526$"Endpoint '{endpointReference.EndpointName}' on resource '{endpointReference.Resource.Name}' cannot be used. {reason}");
HostedAgent\HostedAgentBuilderExtension.cs (2)
303var http = ctx.Urls.FirstOrDefault(u => u.Endpoint?.EndpointName == "http" || u.Endpoint?.EndpointName == "https");
Aspire.Hosting.Kubernetes (6)
Extensions\EndpointRoutingValidation.cs (1)
51$"Resource '{endpoint.Resource.Name}' endpoint '{endpoint.EndpointName}' is not marked as external " +
KubernetesEnvironmentResource.cs (2)
943var endpointName = endpointRef.EndpointName; 1289var endpointName = endpointRef.EndpointName;
KubernetesResource.cs (3)
337&& EndpointMappings.TryGetValue(endpointProbeAnnotation.EndpointReference.EndpointName, out var endpointMapping)) 564var mapping = referencedResource.EndpointMappings[ep.EndpointName]; 607var mapping = referencedResource.EndpointMappings[epExpr.Endpoint.EndpointName];
Aspire.Hosting.Kubernetes.Tests (3)
KubernetesDeployTests.cs (3)
1883Assert.Equal("http", dashboard.PrimaryEndpoint.EndpointName); 1884Assert.Equal("otlp-grpc", dashboard.OtlpGrpcEndpoint.EndpointName); 1885Assert.Equal("otlp-http", dashboard.OtlpHttpEndpoint.EndpointName);
Aspire.Hosting.Maui (2)
MauiOtlpExtensions.cs (2)
464string.Equals(endpointReference.EndpointName, KnownEndpointNames.OtlpHttpEndpointName, StringComparisons.EndpointAnnotationName) 466: string.Equals(endpointReference.EndpointName, KnownEndpointNames.OtlpGrpcEndpointName, StringComparisons.EndpointAnnotationName)
Aspire.Hosting.Qdrant.Tests (2)
QdrantFunctionalTests.cs (2)
248Assert.Single(urls, u => u.Endpoint?.EndpointName == "grpc" && u.DisplayText == "Qdrant (GRPC)" && u.DisplayLocation == UrlDisplayLocation.DetailsOnly); 249Assert.Single(urls, u => u.Endpoint?.EndpointName == "http" && u.DisplayText == "Qdrant (HTTP)");
Aspire.Hosting.Radius (5)
Publishing\RadiusInfrastructureBuilder.cs (4)
3472$"Endpoint '{endpointReference.EndpointName}' of resource '{resource.Name}' is TLS-enabled, but the Radius " + 3501string.Equals(endpoints[0].Name, endpointReference.EndpointName, StringComparison.OrdinalIgnoreCase)) 3509$"address — that of its '{endpoints[0].Name}' endpoint. The reference to its '{endpointReference.EndpointName}' " + 4336$"the endpoint '{endpointReference.EndpointName}' is not defined on resource " +
RadiusEnvironmentResource.cs (1)
257$"Endpoint '{endpointReference.EndpointName}' of resource '{resource.Name}' is TLS-enabled, but the Radius " +
Aspire.Hosting.Redis.Tests (2)
AddRedisTests.cs (2)
310Assert.Equal("http", managementUrl.Endpoint?.EndpointName); 336Assert.Equal("http", managementUrl.Endpoint?.EndpointName);
Aspire.Hosting.Tests (20)
Dashboard\DashboardResourceTests.cs (2)
858var httpUrl = urls.FirstOrDefault(u => u.Endpoint?.EndpointName == "http"); 859var httpsUrl = urls.FirstOrDefault(u => u.Endpoint?.EndpointName == "https");
DistributedApplicationTests.cs (1)
2358var expectedServiceName = hasMultipleEndpoints ? $"{redis.Name}-{endpoint.EndpointName}" : redis.Name;
ExecutionConfigurationGathererTests.cs (1)
144references.OrderBy(reference => reference.EndpointName));
WithUrlsTests.cs (16)
253Assert.Single(urls, u => u.Url.StartsWith("http://localhost") && u.Endpoint?.EndpointName == "test"); 291Assert.Equal("http", u.Endpoint?.EndpointName); 298Assert.Equal("http", u.Endpoint?.EndpointName); 304Assert.Equal("tcp", u.Endpoint?.EndpointName); 329Assert.Single(urls, u => u.Url.EndsWith("/sub-path") && u.Endpoint?.EndpointName == "http"); 352Assert.Single(urls, u => u.Url == "http://custom.localhost:23456/home" && u.Endpoint?.EndpointName == "http"); 385&& u.Endpoint?.EndpointName == "test" 413Assert.Single(resourceEvent.Snapshot.Urls, s => s.Name == httpEndpoint.EndpointName && s.IsInactive && s.Url == "https://example.com"); 439s => Assert.True(s.Name == httpEndpoint.EndpointName && s.DisplayProperties.DisplayName == ""), // <-- this is the default URL added for the endpoint 440s => Assert.True(s.Name == httpEndpoint.EndpointName && s.Url.EndsWith("/one") && s.DisplayProperties.DisplayName == "Example 1"), 441s => Assert.True(s.Name == httpEndpoint.EndpointName && s.Url.EndsWith("/two") && s.DisplayProperties.DisplayName == "Example 2") 786var endpointUrl = allUrls.FirstOrDefault(u => u.Endpoint?.EndpointName == "test"); 846var endpointUrl = project.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test"); 885var launchProfileUrls = project.Resource.Annotations.OfType<ResourceUrlAnnotation>().Where(u => u.Endpoint?.EndpointName == "http"); 926var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 1044var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path"));
Aspire.Hosting.Yarp (1)
ConfigurationBuilder\YarpCluster.cs (1)
46return $"{endpoint.Scheme}://_{endpoint.EndpointName}.{endpoint.Resource.Name}";
TestShop.AppHost (1)
AppHost.cs (1)
96.WithUrls(c => c.Urls.ForEach(u => u.DisplayText = $"Online store ({u.Endpoint?.EndpointName})"))