2 writes to EndpointName
Aspire.Hosting (2)
ApplicationModel\EndpointReference.cs (2)
268EndpointName = endpoint.Name; 300EndpointName = endpointName;
114 references to EndpointName
Aspire.Hosting (40)
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)
682endpointReference.EndpointName,
Dashboard\DashboardEventHandlers.cs (6)
460if (endpoint.EndpointName is "http" or "https") 464url.DisplayText = $"Dashboard ({endpoint.EndpointName})"; 477url.DisplayText = endpoint.EndpointName; 836foreach (var e in frontendEndpoints.Where(e => e.EndpointName is "http" or "https")) 852var publicEndpoint = frontendEndpoints.FirstOrDefault(e => e.EndpointName is "https") ?? frontendEndpoints.First(e => e.EndpointName is "http");
Dcp\ResourceSnapshotBuilder.cs (3)
311string.Equals(endpointName, u.Endpoint?.EndpointName, StringComparisons.EndpointAnnotationName) 324new(Name: endpointUrl.Endpoint!.EndpointName, 344var 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) 483var primaryUrl = urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, primaryLaunchProfileEndpoint.Name, StringComparisons.EndpointAnnotationName)); 504_logger.LogTrace("Updating URL '{Url}' with path '{Path}' for launch profile endpoint '{EndpointName}' for resource '{ResourceName}'.", url.Url, primaryPath, url.Endpoint.EndpointName, resource.Name); 510_logger.LogTrace("Updated URL to '{Url}' for launch profile endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, url.Endpoint.EndpointName, resource.Name); 546_logger.LogTrace("Converted relative URL to absolute URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, endpoint.EndpointName, resource.Name);
ProjectResourceBuilderExtensions.cs (1)
764var url = context.Urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, endpoint.Name, StringComparisons.EndpointAnnotationName));
ResourceBuilderExtensions.cs (11)
819if (specificEndpointName != null && !string.Equals(endpoint.EndpointName, specificEndpointName, StringComparison.OrdinalIgnoreCase)) 825var endpointName = endpoint.EndpointName; 1386ApplyEndpoints(builder, endpointReference.Resource, endpointReference.EndpointName); 2188var urlForEndpoint = context.Urls.FirstOrDefault(u => u.Endpoint?.EndpointName == endpointName); 2813throw 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."); 2819var endpointName = endpoint.EndpointName; 3688throw 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."); 3696commandName ??= $"{endpoint.Resource.Name}-{endpoint.EndpointName}-http-{commandOptions.Method.Method.ToLowerInvariant()}-{path}"; 4377matchingEndpoint = endpoints.FirstOrDefault(e => string.Equals(e.EndpointName, name, StringComparisons.EndpointAnnotationName)); 4382throw 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."); 4403matchingEndpoint = endpoints.FirstOrDefault(e => string.Equals(e.EndpointName, scheme, StringComparisons.EndpointAnnotationUriScheme));
Aspire.Hosting.Azure.AppContainers (3)
BaseContainerAppContext.cs (3)
238var mapping = context._endpointMapping[ep.EndpointName]; 296var mapping = context._endpointMapping[epExpr.Endpoint.EndpointName]; 544&& _endpointMapping.TryGetValue(endpointProbeAnnotation.EndpointReference.EndpointName, out var endpointMapping))
Aspire.Hosting.Azure.AppService (4)
AzureAppServiceWebsiteContext.cs (4)
181(GetEndpointValue(context._slotEndpointMapping[ep.EndpointName], EndpointProperty.Url), secretType) : 182(GetEndpointValue(context._endpointMapping[ep.EndpointName], EndpointProperty.Url), secretType); 225var mapping = isSlot ? context._slotEndpointMapping[epExpr.Endpoint.EndpointName] : context._endpointMapping[epExpr.Endpoint.EndpointName];
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
500var url = context.Urls.FirstOrDefault(u => u.Endpoint?.EndpointName == KnownUrls.DataExplorer.EndpointName);
Aspire.Hosting.Azure.Sandboxes (5)
AzureSandboxEndpointPropertyValueProvider.cs (5)
41$"{{{_resource.Name}.endpoints.{_endpointReferenceExpression.Endpoint.EndpointName}.{_endpointReferenceExpression.Property.ToString().ToLowerInvariant()}}}"; 96throw new InvalidOperationException($"Azure sandbox deployment state for resource '{_resource.TargetResource.Name}' endpoint '{_endpointReferenceExpression.Endpoint.EndpointName}' contains invalid URL '{url}'."); 108_ => throw new InvalidOperationException($"The property '{_endpointReferenceExpression.Property}' is not supported for the endpoint '{_endpointReferenceExpression.Endpoint.EndpointName}'.") 113new($"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."); 154var endpointName = endpointReference.EndpointName;
Aspire.Hosting.Azure.Tests (2)
AzureCosmosDBExtensionsTests.cs (2)
1241var healthUrl = Assert.Single(urls, u => u.Endpoint?.EndpointName == "emulatorhealth"); 1266var explorerUrl = Assert.Single(urls, u => u.Endpoint?.EndpointName == "data-explorer");
Aspire.Hosting.Blazor (1)
GatewayOriginReference.cs (1)
14public string ValueExpression => $"{{{endpoint.Resource.Name}.bindings.{endpoint.EndpointName}.url}}";
Aspire.Hosting.DevTunnels (17)
DevTunnelResourceBuilderExtensions.cs (17)
210portLogger.LogInformation("Created dev tunnel port '{Port}' on tunnel '{Tunnel}' targeting endpoint '{Endpoint}' on resource '{TargetResource}'", tunnelPort, portResource.DevTunnel.TunnelId, portResource.TargetEndpoint.EndpointName, portResource.TargetEndpoint.Resource.Name); 410.FirstOrDefault(p => p.TargetEndpoint.Resource == resource && string.Equals(p.TargetEndpoint.EndpointName, endpointName, StringComparisons.EndpointAnnotationName)); 434&& string.Equals(p.TargetEndpoint.EndpointName, targetEndpointReference.EndpointName, StringComparisons.EndpointAnnotationName)); 438return CreateEndpointReferenceWithError(tunnelBuilder.Resource, targetEndpointReference.Resource, targetEndpointReference.EndpointName); 494var endpointName = port.TargetEndpoint.EndpointName; 543throw new ArgumentException($"Target endpoint '{targetEndpoint.EndpointName}' on resource '{targetEndpoint.Resource.Name}' has already been added to dev tunnel '{tunnel.Name}'.", nameof(targetEndpoint)); 547.SingleOrDefault(a => string.Equals(a.Name, targetEndpoint.EndpointName, StringComparisons.EndpointAnnotationName)) is { } targetEndpointAnnotation) 565_ => 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."), 567portOptions.Description ??= $"{targetResource.Name}/{targetEndpoint.EndpointName}"; 569var portName = $"{tunnel.Name}-{targetResource.Name}-{targetEndpoint.EndpointName}"; 572portOptions.Labels.Add(targetEndpoint.EndpointName); 637if (urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, DevTunnelPortResource.TunnelEndpointName, StringComparisons.EndpointAnnotationName) 645if (urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, DevTunnelPortResource.TunnelEndpointName, StringComparisons.EndpointAnnotationName) 678new(CustomResourceKnownProperties.Source, $"{targetResource.Name}/{targetEndpoint.EndpointName}"), 680new("TargetEndpoint", targetEndpoint.EndpointName), 749portLogger.LogInformation("Forwarding from {PortUrl} to {TargetUrl} ({TargetResourceName}/{TargetEndpointName})", tunnelPortStatus.PortUri.ToString().TrimEnd('/'), portResource.TargetEndpoint.Url, portResource.TargetEndpoint.Resource.Name, portResource.TargetEndpoint.EndpointName);
Aspire.Hosting.DevTunnels.Tests (5)
DevTunnelResourceBuilderExtensionsTests.cs (5)
289Assert.Equal(DevTunnelPortResource.TunnelEndpointName, tunnelEndpoint.EndpointName); 306Assert.Equal(DevTunnelPortResource.TunnelEndpointName, tunnelEndpoint.EndpointName); 324Assert.Equal(DevTunnelPortResource.TunnelEndpointName, tunnelEndpoint.EndpointName); 402Assert.Equal(DevTunnelPortResource.TunnelEndpointName, httpTunnelEndpoint.EndpointName); 403Assert.Equal(DevTunnelPortResource.TunnelEndpointName, httpsTunnelEndpoint.EndpointName);
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)
504$"Endpoint '{endpointReference.EndpointName}' on resource '{endpointReference.Resource.Name}' cannot be used. {reason}");
HostedAgent\HostedAgentBuilderExtension.cs (2)
301var 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)
909var endpointName = endpointRef.EndpointName; 1218var endpointName = endpointRef.EndpointName;
KubernetesResource.cs (3)
336&& EndpointMappings.TryGetValue(endpointProbeAnnotation.EndpointReference.EndpointName, out var endpointMapping)) 539var mapping = referencedResource.EndpointMappings[ep.EndpointName]; 582var mapping = referencedResource.EndpointMappings[epExpr.Endpoint.EndpointName];
Aspire.Hosting.Kubernetes.Tests (2)
KubernetesDeployTests.cs (2)
1834Assert.Equal("http", dashboard.PrimaryEndpoint.EndpointName); 1835Assert.Equal("otlp-grpc", dashboard.OtlpGrpcEndpoint.EndpointName);
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.Tests (19)
Dashboard\DashboardResourceTests.cs (2)
846var httpUrl = urls.FirstOrDefault(u => u.Endpoint?.EndpointName == "http"); 847var httpsUrl = urls.FirstOrDefault(u => u.Endpoint?.EndpointName == "https");
DistributedApplicationTests.cs (1)
2347var expectedServiceName = hasMultipleEndpoints ? $"{redis.Name}-{endpoint.EndpointName}" : redis.Name;
WithUrlsTests.cs (16)
231Assert.Single(urls, u => u.Url.StartsWith("http://localhost") && u.Endpoint?.EndpointName == "test"); 269Assert.Equal("http", u.Endpoint?.EndpointName); 276Assert.Equal("http", u.Endpoint?.EndpointName); 282Assert.Equal("tcp", u.Endpoint?.EndpointName); 307Assert.Single(urls, u => u.Url.EndsWith("/sub-path") && u.Endpoint?.EndpointName == "http"); 330Assert.Single(urls, u => u.Url == "http://custom.localhost:23456/home" && u.Endpoint?.EndpointName == "http"); 364&& u.Endpoint?.EndpointName == "test" 393Assert.Single(resourceEvent.Snapshot.Urls, s => s.Name == httpEndpoint.EndpointName && s.IsInactive && s.Url == "https://example.com"); 419s => Assert.True(s.Name == httpEndpoint.EndpointName && s.DisplayProperties.DisplayName == ""), // <-- this is the default URL added for the endpoint 420s => Assert.True(s.Name == httpEndpoint.EndpointName && s.Url.EndsWith("/one") && s.DisplayProperties.DisplayName == "Example 1"), 421s => Assert.True(s.Name == httpEndpoint.EndpointName && s.Url.EndsWith("/two") && s.DisplayProperties.DisplayName == "Example 2") 766var endpointUrl = allUrls.FirstOrDefault(u => u.Endpoint?.EndpointName == "test"); 826var endpointUrl = project.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test"); 865var launchProfileUrls = project.Resource.Annotations.OfType<ResourceUrlAnnotation>().Where(u => u.Endpoint?.EndpointName == "http"); 906var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 936var 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})"))