2 writes to EndpointName
Aspire.Hosting (2)
ApplicationModel\EndpointReference.cs (2)
303EndpointName = endpoint.Name; 335EndpointName = endpointName;
154 references to EndpointName
Aspire.Hosting (49)
ApplicationModel\EndpointReference.cs (10)
38return $"The endpoint `{EndpointName}` is not defined for the resource `{Resource.Name}`. The resource has no endpoints defined."; 42return $"The endpoint `{EndpointName}` is not defined for the resource `{Resource.Name}`. Available endpoints: {formattedNames}."; 129public bool IsHttpSchemeNamedEndpoint => string.Equals(EndpointName, "http", StringComparisons.EndpointAnnotationUriScheme) || 130string.Equals(EndpointName, "https", StringComparisons.EndpointAnnotationUriScheme); 183_ => throw new InvalidOperationException($"The property '{property}' is not supported for the endpoint '{EndpointName}'.") 186string Binding(string prop) => $"{{{Resource.Name}.bindings.{EndpointName}.{prop}}}"; 257?? throw new InvalidOperationException($"The endpoint `{EndpointName}` is not allocated for the resource `{Resource.Name}`."); 267.SingleOrDefault(a => string.Equals(a.Name, EndpointName, StringComparisons.EndpointAnnotationName)); 415$"The URL callback for resource '{callbackResource.Name}' cannot resolve browser origins for endpoint '{Endpoint.EndpointName}' " + 449_ => 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; 707foreach (var e in frontendEndpoints.Where(e => e.EndpointName is "http" or "https")) 723var 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)
570string.Equals(endpointName, u.Endpoint?.EndpointName, StringComparisons.EndpointAnnotationName) 583new(Name: endpointUrl.Endpoint!.EndpointName, 601var 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 (6)
238urls = resourceUrls.Select(url => new UrlSnapshot(Name: url.Endpoint?.EndpointName, Url: url.Url, IsInternal: url.DisplayLocation == UrlDisplayLocation.DetailsOnly) 500var primaryUrl = urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, primaryLaunchProfileEndpoint.Name, StringComparisons.EndpointAnnotationName)); 521_logger.LogTrace("Updating URL '{Url}' with path '{Path}' for launch profile endpoint '{EndpointName}' for resource '{ResourceName}'.", url.Url, primaryPath, url.Endpoint.EndpointName, resource.Name); 527_logger.LogTrace("Updated URL to '{Url}' for launch profile endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, url.Endpoint.EndpointName, resource.Name); 563_logger.LogTrace("Converted relative URL to absolute URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, endpoint.EndpointName, resource.Name); 595.Where(url => string.Equals(url.Annotation.Endpoint!.EndpointName, endpoint.Name, StringComparisons.EndpointAnnotationName))
ProjectResourceBuilderExtensions.cs (1)
845var url = context.Urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, endpoint.Name, StringComparisons.EndpointAnnotationName));
ResourceBuilderExtensions.cs (15)
1070if (specificEndpointName != null && !string.Equals(endpoint.EndpointName, specificEndpointName, StringComparison.OrdinalIgnoreCase)) 1076var endpointName = endpoint.EndpointName; 1698ApplyEndpoints(builder, endpointReference.Resource, endpointReference.EndpointName); 2529var url = context.Urls.FirstOrDefault(u => u.Endpoint?.EndpointName == endpointName); 2619string.Equals(urlEndpoint.EndpointName, endpoint.EndpointName, StringComparisons.EndpointAnnotationName)); 2624context.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); 2636context.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); 3204throw 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."); 3210var endpointName = endpoint.EndpointName; 4079throw 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."); 4087commandName ??= $"{endpoint.Resource.Name}-{endpoint.EndpointName}-http-{commandOptions.Method.Method.ToLowerInvariant()}-{path}"; 4805matchingEndpoint = endpoints.FirstOrDefault(e => string.Equals(e.EndpointName, name, StringComparisons.EndpointAnnotationName)); 4810throw 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."); 4831matchingEndpoint = endpoints.FirstOrDefault(e => string.Equals(e.EndpointName, scheme, StringComparisons.EndpointAnnotationUriScheme));
Aspire.Hosting.Azure.AppContainers (5)
AzureContainerAppEnvironmentResource.cs (1)
291$"'{endpointReference.EndpointName}' on resource '{endpointReference.Resource.Name}'. " +
BaseContainerAppContext.cs (4)
209$"Azure Container Apps cannot provide browser origins for endpoint '{reference.Endpoint.EndpointName}' on resource '{reference.Endpoint.Resource.Name}' because it is not an external HTTP(S) endpoint. " + 259var mapping = context._endpointMapping[ep.EndpointName]; 332var mapping = context._endpointMapping[epExpr.Endpoint.EndpointName]; 579&& _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); 266var mapping = isSlot ? context._slotEndpointMapping[epExpr.Endpoint.EndpointName] : context._endpointMapping[epExpr.Endpoint.EndpointName];
Aspire.Hosting.Azure.EntraId (2)
EntraIdResourceExtensions.cs (1)
1560$"Endpoint '{endpoint.EndpointName}' on resource '{endpoint.Resource.Name}' cannot be used for an Entra redirect URI because TLS is disabled in compute environment '{computeEnvironment.Name}'. " +
EntraIdRunModeBrowserOrigin.cs (1)
48endpoint.EndpointName, endpoint.Resource.Name, origin);
Aspire.Hosting.Azure.Sandboxes (8)
AzureSandboxEndpointPropertyValueProvider.cs (8)
32_targetPort = ResolveEndpointTargetPort(resource, endpointReferenceExpression.Endpoint.EndpointName) ?? 33throw new InvalidOperationException($"Endpoint '{endpointReferenceExpression.Endpoint.EndpointName}' on resource '{resource.TargetResource.Name}' does not have a target port."); 44$"{{{_resource.Name}.endpoints.{_endpointReferenceExpression.Endpoint.EndpointName}.{_endpointReferenceExpression.Property.ToString().ToLowerInvariant()}}}"; 99throw new InvalidOperationException($"Azure sandbox deployment state for resource '{_resource.TargetResource.Name}' endpoint '{_endpointReferenceExpression.Endpoint.EndpointName}' contains invalid URL '{url}'."); 113_ => throw new InvalidOperationException($"The property '{_endpointReferenceExpression.Property}' is not supported for the endpoint '{_endpointReferenceExpression.Endpoint.EndpointName}'.") 118new($"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."); 124throw new InvalidOperationException($"Endpoint '{_endpointReferenceExpression.Endpoint.EndpointName}' on resource '{_resource.TargetResource.Name}' is not exposed by the Azure sandbox deployment target."); 161var 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)
2706project.GetEndpoints().OrderBy(static endpoint => endpoint.EndpointName, StringComparer.Ordinal), 2707endpoint => Assert.Equal("http", endpoint.EndpointName), 2708endpoint => Assert.Equal("https", endpoint.EndpointName));
Aspire.Hosting.Blazor (1)
GatewayOriginReference.cs (1)
19public string ValueExpression => $"{{{endpoint.Resource.Name}.bindings.{endpoint.EndpointName}.url}}";
Aspire.Hosting.DevTunnels (18)
DevTunnelResourceBuilderExtensions.cs (18)
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), 742url.Url = UpdatePortUrl(url.Url, url.Endpoint?.EndpointName, url.DisplayText, previousAddress, portUri); 767NormalizeUrl(portUri), portResource.TargetEndpoint.Url, portResource.TargetEndpoint.Resource.Name, portResource.TargetEndpoint.EndpointName);
Aspire.Hosting.DevTunnels.Tests (8)
DevTunnelMonitorTests.cs (2)
263var tunnelUrl = Assert.Single(context.Urls, url => url.Endpoint?.EndpointName == DevTunnelPortResource.TunnelEndpointName); 622var otherPort = Assert.Single(test.Tunnel.Ports, p => p.TargetEndpoint.EndpointName == "other");
DevTunnelResourceBuilderExtensionsTests.cs (5)
414Assert.Equal(DevTunnelPortResource.TunnelEndpointName, tunnelEndpoint.EndpointName); 433Assert.Equal(DevTunnelPortResource.TunnelEndpointName, tunnelEndpoint.EndpointName); 453Assert.Equal(DevTunnelPortResource.TunnelEndpointName, tunnelEndpoint.EndpointName); 541Assert.Equal(DevTunnelPortResource.TunnelEndpointName, httpTunnelEndpoint.EndpointName); 542Assert.Equal(DevTunnelPortResource.TunnelEndpointName, httpsTunnelEndpoint.EndpointName);
TestDevTunnelMonitor.cs (1)
37Port = Assert.Single(Tunnel.Ports, p => p.TargetEndpoint.EndpointName == "http");
Aspire.Hosting.Docker (3)
DockerComposeServiceResourceExtensions.cs (3)
26var mapping = referencedResource.EndpointMappings[ep.EndpointName]; 60var mapping = referencedResource.EndpointMappings[epExpr.Endpoint.EndpointName]; 116$"Docker Compose cannot provide browser origins for endpoint '{reference.Endpoint.EndpointName}' on resource '{reference.Endpoint.Resource.Name}' because it is not an external HTTP(S) endpoint. " +
Aspire.Hosting.Foundry (3)
HostedAgent\AzureHostedAgentResource.cs (1)
530$"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 (9)
Extensions\EndpointRoutingValidation.cs (1)
51$"Resource '{endpoint.Resource.Name}' endpoint '{endpoint.EndpointName}' is not marked as external " +
KubernetesEnvironmentContext.cs (3)
24$"Kubernetes cannot provide browser origins for endpoint '{reference.Endpoint.EndpointName}' on resource '{reference.Endpoint.Resource.Name}' because it is not an external HTTP(S) endpoint. " + 66string.Equals(endpoint.EndpointName, reference.Endpoint.EndpointName, StringComparison.OrdinalIgnoreCase);
KubernetesEnvironmentResource.cs (2)
954var endpointName = endpointRef.EndpointName; 1300var endpointName = endpointRef.EndpointName;
KubernetesResource.cs (3)
333&& EndpointMappings.TryGetValue(endpointProbeAnnotation.EndpointReference.EndpointName, out var endpointMapping)) 559var mapping = referencedResource.EndpointMappings[ep.EndpointName]; 608var mapping = referencedResource.EndpointMappings[epExpr.Endpoint.EndpointName];
Aspire.Hosting.Kubernetes.Tests (3)
KubernetesDeployTests.cs (3)
1919Assert.Equal("http", dashboard.PrimaryEndpoint.EndpointName); 1920Assert.Equal("otlp-grpc", dashboard.OtlpGrpcEndpoint.EndpointName); 1921Assert.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 (6)
Publishing\RadiusInfrastructureBuilder.cs (5)
3476$"Endpoint '{endpointReference.EndpointName}' of resource '{resource.Name}' is TLS-enabled, but the Radius " + 3505string.Equals(endpoints[0].Name, endpointReference.EndpointName, StringComparison.OrdinalIgnoreCase)) 3513$"address — that of its '{endpoints[0].Name}' endpoint. The reference to its '{endpointReference.EndpointName}' " + 4163$"Radius cannot provide browser origins for endpoint '{browserEndpoint.EndpointName}' on resource '{browserEndpoint.Resource.Name}' because it is not an external HTTP(S) workload endpoint. " + 4357$"the endpoint '{endpointReference.EndpointName}' is not defined on resource " +
RadiusEnvironmentResource.cs (1)
260$"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 (22)
ComputeEnvironmentValidationTests.cs (1)
29$"Compute environment 'env' cannot provide browser origins for endpoint '{endpoint.EndpointName}' on resource '{endpoint.Resource.Name}' because it does not implement deployed browser-origin resolution. " +
Dashboard\DashboardResourceTests.cs (2)
866var httpUrl = urls.FirstOrDefault(u => u.Endpoint?.EndpointName == "http"); 867var httpsUrl = urls.FirstOrDefault(u => u.Endpoint?.EndpointName == "https");
DistributedApplicationTests.cs (1)
2436var expectedServiceName = hasMultipleEndpoints ? $"{redis.Name}-{endpoint.EndpointName}" : redis.Name;
EndpointReferenceTests.cs (1)
25Assert.Equal("http", endpoint.EndpointName);
ExecutionConfigurationGathererTests.cs (1)
144references.OrderBy(reference => reference.EndpointName));
WithUrlsTests.cs (16)
461Assert.Single(urls, u => u.Url.StartsWith("http://localhost") && u.Endpoint?.EndpointName == "test"); 499Assert.Equal("http", u.Endpoint?.EndpointName); 506Assert.Equal("http", u.Endpoint?.EndpointName); 512Assert.Equal("tcp", u.Endpoint?.EndpointName); 537Assert.Single(urls, u => u.Url.EndsWith("/sub-path") && u.Endpoint?.EndpointName == "http"); 560Assert.Single(urls, u => u.Url == "http://custom.localhost:23456/home" && u.Endpoint?.EndpointName == "http"); 593&& u.Endpoint?.EndpointName == "test" 621Assert.Single(resourceEvent.Snapshot.Urls, s => s.Name == httpEndpoint.EndpointName && s.IsInactive && s.Url == "https://example.com"); 647s => Assert.True(s.Name == httpEndpoint.EndpointName && s.DisplayProperties.DisplayName == ""), // <-- this is the default URL added for the endpoint 648s => Assert.True(s.Name == httpEndpoint.EndpointName && s.Url.EndsWith("/one") && s.DisplayProperties.DisplayName == "Example 1"), 649s => Assert.True(s.Name == httpEndpoint.EndpointName && s.Url.EndsWith("/two") && s.DisplayProperties.DisplayName == "Example 2") 878var endpointUrl = allUrls.FirstOrDefault(u => u.Endpoint?.EndpointName == "test"); 938var endpointUrl = project.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test"); 977var launchProfileUrls = project.Resource.Annotations.OfType<ResourceUrlAnnotation>().Where(u => u.Endpoint?.EndpointName == "http"); 1018var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 1080var 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)
187.WithUrls(c => c.Urls.ForEach(u => u.DisplayText = $"Online store ({u.Endpoint?.EndpointName})"))