181 references to EndpointAnnotation
Aspire.Hosting (27)
ApplicationModel\EndpointHostHelpers.cs (1)
144var targetHost = endpoint.EndpointAnnotation.TargetHost;
ApplicationModel\EndpointReference.cs (8)
121public bool TlsEnabled => Exists && EndpointAnnotation.TlsEnabled; 139public bool ExcludeReferenceEndpoint => Exists && EndpointAnnotation.ExcludeReferenceEndpoint; 233public int? TargetPort => EndpointAnnotation.TargetPort; 243public string Scheme => EndpointAnnotation.UriScheme; 252EndpointAnnotation.AllocatedEndpointSnapshot; 411var snapshot = Endpoint.EndpointAnnotation.BrowserUrlsSnapshot; 426if (Endpoint.EndpointAnnotation.AllocatedEndpoint is { UriScheme: "http" or "https" } allocatedEndpoint) 439var allocatedEndpoint = await Endpoint.EndpointAnnotation.AllAllocatedEndpoints.GetAllocatedEndpointAsync(networkContext, cancellationToken).ConfigureAwait(false);
ApplicationModel\IComputeEnvironmentResource.cs (1)
47var endpoint = endpointReference.EndpointAnnotation;
ApplicationModel\ProjectLaunchDefaultsAnnotation.cs (1)
80var endpoint = e.EndpointAnnotation;
Dashboard\DashboardEventHandlers.cs (2)
688ReferenceExpression.Create($"{e.Property(EndpointProperty.Scheme)}://{e.EndpointAnnotation.TargetHost}:{e.Property(EndpointProperty.TargetPort)}"); 714aspnetCoreUrls.Append($"{e.Property(EndpointProperty.Scheme)}://{e.EndpointAnnotation.TargetHost}:{e.Property(EndpointProperty.TargetPort)}");
Dcp\ExecutableCreator.cs (2)
154if (!_containerNetworkEndpointProvisioner.CanProvisionEndpoint(endpointReference.EndpointAnnotation)) 167endpoints.Add(endpointReference.EndpointAnnotation);
Orchestrator\ApplicationOrchestrator.cs (2)
378if (additionalUrl is not null && EndpointHostHelpers.IsLocalhostTld(additionalUrl.Endpoint?.EndpointAnnotation.TargetHost)) 515if (url.Endpoint?.EndpointAnnotation == primaryLaunchProfileEndpoint
ProjectResourceBuilderExtensions.cs (9)
1207if (!processedHttpsPort && e.EndpointAnnotation.UriScheme == "https") 1216aspnetCoreUrls.Append($"{e.Property(EndpointProperty.Scheme)}://{e.EndpointAnnotation.TargetHost}:{e.Property(EndpointProperty.TargetPort)}"); 1254if (e.EndpointAnnotation.UriScheme == scheme && e.EndpointAnnotation != launchDefaults.DefaultHttpsEndpoint) 1256Debug.Assert(!e.EndpointAnnotation.FromLaunchProfile, "Endpoints from launch profile should never make it here"); 1286if (e.EndpointAnnotation == launchDefaults.DefaultHttpsEndpoint) 1294launchDefaults.KestrelEndpointAnnotationHosts.TryGetValue(e.EndpointAnnotation, out var kestrelHost) ? kestrelHost : "*"; 1296var url = ReferenceExpression.Create($"{e.EndpointAnnotation.UriScheme}://{host}:{e.Property(EndpointProperty.TargetPort)}"); 1299context.EnvironmentVariables[$"Kestrel__Endpoints__{e.EndpointAnnotation.Name}__Url"] = url;
Publishing\ManifestPublishingContext.cs (1)
1295endpoint.Endpoint.Resource.Name, endpoint.Endpoint.EndpointAnnotation.Name, endpoint.Property.ToString(),
Aspire.Hosting.Azure.ApiManagement (7)
AzureApiManagementExtensions.cs (7)
2338.Where(e => e.EndpointAnnotation.UriScheme is "http" or "https") 2340var endpoint = httpEndpoints.FirstOrDefault(e => e.EndpointAnnotation.IsExternal) 2345if (!endpoint.EndpointAnnotation.IsExternal && apiResource.Parent.VirtualNetworkConfiguration is null) 2421candidate.EndpointAnnotation.IsExternal && 2422candidate.EndpointAnnotation.UriScheme is "http" or "https"); 2425!endpoint.EndpointAnnotation.IsExternal || 2426endpoint.EndpointAnnotation.UriScheme is not ("http" or "https"))
Aspire.Hosting.Azure.AppContainers (3)
AzureContainerAppEnvironmentResource.cs (3)
287if (!endpointReference.EndpointAnnotation.IsExternal) 415if (!endpointReference.EndpointAnnotation.IsExternal) 432var endpoint = endpointReference.EndpointAnnotation;
Aspire.Hosting.Azure.AppService (1)
AzureAppServiceEnvironmentResource.cs (1)
564var endpoint = endpointReference.EndpointAnnotation;
Aspire.Hosting.Azure.FrontDoor (2)
AzureFrontDoorExtensions.cs (2)
235.Where(e => e.EndpointAnnotation.UriScheme is "http" or "https") 236.FirstOrDefault(e => e.EndpointAnnotation.IsExternal);
Aspire.Hosting.Azure.Sandboxes (1)
AzureSandboxEndpointPropertyValueProvider.cs (1)
162var resolvedTargetPort = ResolveEndpointTargetPort(resource, endpointName) ?? endpointReference.EndpointAnnotation.TargetPort;
Aspire.Hosting.Azure.Tests (4)
AzureContainerAppExpressEndpointTests.cs (2)
166Assert.False(api.GetEndpoint("http").EndpointAnnotation.IsExternal); 199Assert.False(api.GetEndpoint("http").EndpointAnnotation.IsExternal);
AzureWebPubSubEmulatorTests.cs (2)
58var endpoint = api.GetEndpoint("http").EndpointAnnotation; 151var endpoint = webPubSub.GetEndpoint("emulator").EndpointAnnotation;
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
930var isAllocated = endpoint.EndpointAnnotation.AllAllocatedEndpoints.Any(
Aspire.Hosting.DevTunnels.Tests (32)
DevTunnelResourceBuilderExtensionsTests.cs (28)
134tunnelPort.TargetEndpoint.EndpointAnnotation.AllocatedEndpoint = new( 135tunnelPort.TargetEndpoint.EndpointAnnotation, 155tunnelPort.TargetEndpoint.EndpointAnnotation.AllocatedEndpoint = new( 156tunnelPort.TargetEndpoint.EndpointAnnotation, 177tunnelPort.TargetEndpoint.EndpointAnnotation.AllocatedEndpoint = new( 178tunnelPort.TargetEndpoint.EndpointAnnotation, 230tunnelPort.TargetEndpoint.EndpointAnnotation.AllocatedEndpoint = new( 231tunnelPort.TargetEndpoint.EndpointAnnotation, 272tunnelPort.TargetEndpoint.EndpointAnnotation.AllocatedEndpoint = new( 273tunnelPort.TargetEndpoint.EndpointAnnotation, 315port.TargetEndpoint.EndpointAnnotation.AllocatedEndpoint = new(port.TargetEndpoint.EndpointAnnotation, "localhost", 5000); 379port.TargetEndpoint.EndpointAnnotation.AllocatedEndpoint = new(port.TargetEndpoint.EndpointAnnotation, "localhost", 5000); 473var ex = Assert.Throws<InvalidOperationException>(() => _ = endpointRef.EndpointAnnotation); 499var ex = Assert.Throws<InvalidOperationException>(() => _ = endpointRef.EndpointAnnotation); 519var ex = Assert.Throws<InvalidOperationException>(() => _ = endpointRef.EndpointAnnotation); 545Assert.NotSame(httpTunnelEndpoint.EndpointAnnotation, httpsTunnelEndpoint.EndpointAnnotation); 563targetEndpoint.EndpointAnnotation.AllocatedEndpoint = new(targetEndpoint.EndpointAnnotation, "localhost", 3000); 695targetEndpoint.EndpointAnnotation.AllocatedEndpoint = new(targetEndpoint.EndpointAnnotation, "localhost", 3000); 697targetEndpoint.EndpointAnnotation.AllAllocatedEndpoints.AddOrUpdateAllocatedEndpoint( 699new(targetEndpoint.EndpointAnnotation, "target", 8080, EndpointBindingMode.SingleAddress, networkId: containerNetwork)); 700var contextualTargetEndpoint = new EndpointReference(target.Resource, targetEndpoint.EndpointAnnotation, containerNetwork); 883targetEndpoint.EndpointAnnotation.AllocatedEndpoint = new(targetEndpoint.EndpointAnnotation, "localhost", 3000);
TestDevTunnelMonitor.cs (4)
29targetEndpoint.EndpointAnnotation.AllocatedEndpoint = new(targetEndpoint.EndpointAnnotation, "localhost", 3000); 34otherEndpoint.EndpointAnnotation.AllocatedEndpoint = new(otherEndpoint.EndpointAnnotation, "localhost", 3001);
Aspire.Hosting.Docker (1)
src\Shared\EndpointPropertyInputCache.cs (1)
34reference.Endpoint.Resource.Name, reference.Endpoint.EndpointAnnotation.Name, reference.Property.ToString(), 64);
Aspire.Hosting.Foundry (1)
HostedAgent\AzureHostedAgentResource.cs (1)
495var endpoint = endpointReference.EndpointAnnotation;
Aspire.Hosting.JavaScript (2)
DenoHostingExtensions.cs (2)
1421var host = isPublishMode ? "0.0.0.0" : endpoint.EndpointAnnotation.TargetHost; 1423? (endpoint.EndpointAnnotation.TargetPort ?? DenoServeDefaultPort).ToString(CultureInfo.InvariantCulture)
Aspire.Hosting.JavaScript.Tests (4)
AddDenoAppTests.cs (4)
1089Assert.Equal(8000, httpEndpoint.EndpointAnnotation.TargetPort); 1112Assert.Null(denoApp.Resource.GetEndpoint("http").EndpointAnnotation.TargetPort); 1204var callerEndpoint = denoApp.Resource.GetEndpoint("http").EndpointAnnotation; 1239Assert.Equal(8000, httpEndpoint.EndpointAnnotation.TargetPort);
Aspire.Hosting.Kubernetes (4)
Extensions\EndpointRoutingValidation.cs (1)
45if (endpoint.EndpointAnnotation.IsExternal)
KubernetesEnvironmentContext.cs (2)
20if (!reference.Endpoint.EndpointAnnotation.IsExternal || 21reference.Endpoint.EndpointAnnotation.UriScheme is not ("http" or "https"))
src\Shared\EndpointPropertyInputCache.cs (1)
34reference.Endpoint.Resource.Name, reference.Endpoint.EndpointAnnotation.Name, reference.Property.ToString(), 64);
Aspire.Hosting.Maui (8)
MauiOtlpExtensions.cs (8)
320if (!endpointReference.Exists || endpointReference.EndpointAnnotation.AllocatedEndpoint is not { } allocatedEndpoint) 339if (IsLocalTunnelTargetHost(endpointReference.EndpointAnnotation.TargetHost) && 344else if (IsLocalTunnelTargetHost(endpointReference.EndpointAnnotation.TargetHost) && 359endpointReference.EndpointAnnotation.AllocatedEndpoint is null || 449endpointReference.EndpointAnnotation.AllocatedEndpoint is null) 456var allocatedEndpoint = endpointReference.EndpointAnnotation.AllocatedEndpoint; 460GetOtlpProtocol(endpointReference.EndpointAnnotation)); 480? new OtlpEndpointTarget(uri.Scheme, uri.Port, GetOtlpProtocol(endpointReference.EndpointAnnotation))
Aspire.Hosting.Maui.Tests (11)
MauiPlatformExtensionsTests.cs (11)
784tunnelEndpoint.EndpointAnnotation.AllocatedEndpoint = new AllocatedEndpoint(tunnelEndpoint.EndpointAnnotation, "mobile-otlp.devtunnels.ms", 443); 849tunnelEndpoint.EndpointAnnotation.AllocatedEndpoint = 850new AllocatedEndpoint(tunnelEndpoint.EndpointAnnotation, "mobile-otlp.devtunnels.ms", 443); 1007tunnelEndpoint.EndpointAnnotation.AllocatedEndpoint = new AllocatedEndpoint(tunnelEndpoint.EndpointAnnotation, "mobile-otlp.devtunnels.ms", 443); 1042tunnelEndpoint.EndpointAnnotation.AllocatedEndpoint = 1043new AllocatedEndpoint(tunnelEndpoint.EndpointAnnotation, "mobile-otlp.devtunnels.ms", 443); 1236Assert.Null(tunnelConfig.TunnelEndpoint.EndpointAnnotation.AllocatedEndpoint); 1253tunnelConfig.TunnelEndpoint.EndpointAnnotation.AllocatedEndpoint = 1254new AllocatedEndpoint(tunnelConfig.TunnelEndpoint.EndpointAnnotation, "mobile-otlp.devtunnels.ms", 443);
Aspire.Hosting.Python (1)
PythonAppResourceBuilderExtensions.cs (1)
295c.Args.Add(endpoint.EndpointAnnotation.TargetHost);
Aspire.Hosting.Radius (9)
Publishing\RadiusInfrastructureBuilder.cs (6)
3374var scheme = endpointReference.EndpointAnnotation.UriScheme; 3401parts.Add(EnvPart.FromLiteral(endpointReference.EndpointAnnotation.TlsEnabled ? bool.TrueString : bool.FalseString)); 3468if (!endpointReference.EndpointAnnotation.TlsEnabled || 4159!browserEndpoint.EndpointAnnotation.IsExternal || 4160browserEndpoint.EndpointAnnotation.UriScheme is not ("http" or "https")) 4345/// touches <see cref="EndpointReference.EndpointAnnotation"/> (which raises a bare
RadiusEnvironmentResource.cs (2)
175var endpoint = endpointReference.EndpointAnnotation; 243if (!endpointReference.EndpointAnnotation.TlsEnabled ||
src\Shared\EndpointPropertyInputCache.cs (1)
34reference.Endpoint.Resource.Name, reference.Endpoint.EndpointAnnotation.Name, reference.Property.ToString(), 64);
Aspire.Hosting.Tests (62)
ApplicationModel\EndpointHostHelpersTests.cs (1)
255container.GetEndpoint("primary").EndpointAnnotation,
Dashboard\DashboardEventHandlersTests.cs (4)
279httpEndpoint.EndpointAnnotation.AllocatedEndpoint = new(httpEndpoint.EndpointAnnotation, "localhost", 8080); 281otlpGrpcEndpoint.EndpointAnnotation.AllocatedEndpoint = new(otlpGrpcEndpoint.EndpointAnnotation, "localhost", 4317);
Dcp\DcpExecutorTests.cs (4)
1524var computeEndpoint = compute.GetEndpoint("tcp").EndpointAnnotation; 1566var endpoint = emulator.GetEndpoint("http").EndpointAnnotation; 10376var endpoint = resource.GetEndpoint(name).EndpointAnnotation; 10951replacement.Annotations.Add(targetEndpoint.EndpointAnnotation);
DistributedApplicationTests.cs (1)
1786var allocatedEndpointSnapshot = Assert.Single(endpoint.EndpointAnnotation.AllAllocatedEndpoints);
EndpointReferenceTests.cs (24)
26Assert.Same(web.Resource.Annotations.OfType<EndpointAnnotation>().Single(), endpoint.EndpointAnnotation); 45Assert.Same(web.Resource.Annotations.OfType<EndpointAnnotation>().Single(), endpoint.EndpointAnnotation); 456var ex = Assert.Throws<InvalidOperationException>(() => endpointRef.EndpointAnnotation); 472var ex = Assert.Throws<InvalidOperationException>(() => endpointRef.EndpointAnnotation); 485var ex = Assert.Throws<InvalidOperationException>(() => endpointRef.EndpointAnnotation); 499var ex = Assert.Throws<InvalidOperationException>(() => endpointRef.EndpointAnnotation); 524endpoint.EndpointAnnotation.AllocatedEndpoint = new(endpoint.EndpointAnnotation, "localhost", 8443); 525endpoint.EndpointAnnotation.BrowserUrlsSnapshot.SetValue( 545endpoint.EndpointAnnotation.AllocatedEndpoint = new(endpoint.EndpointAnnotation, "localhost", 8443); 546endpoint.EndpointAnnotation.BrowserUrlsSnapshot.SetValue([]); 558endpoint.EndpointAnnotation.AllocatedEndpoint = new(endpoint.EndpointAnnotation, "frontend.example", 443); 559endpoint.EndpointAnnotation.BrowserUrlsSnapshot.SetValue([new() { Url = "https://frontend.example/path" }]); 563endpoint.EndpointAnnotation.AllocatedEndpoint = new(endpoint.EndpointAnnotation, "replacement.example", 443); 575resource.GetEndpoint("http").EndpointAnnotation.BrowserUrlsSnapshot.SetValue([new() { Url = "http://frontend.example" }]); 576resource.GetEndpoint("https").EndpointAnnotation.BrowserUrlsSnapshot.SetValue([new() { Url = "https://separate.example" }]); 589host.EndpointAnnotation.BrowserUrlsSnapshot.SetValue([new() { Url = "https://public.example/app" }]); 606endpoint.EndpointAnnotation.BrowserUrlsSnapshot.SetValue( 628endpoint.EndpointAnnotation.BrowserUrlsSnapshot.SetValue([new() { Url = url }]); 663endpoint.EndpointAnnotation.BrowserUrlsSnapshot.SetValue([new() { Url = "https://frontend.example/app" }]); 677endpoint.EndpointAnnotation.BrowserUrlsSnapshot.SetValue([new() { Url = "https://local.example" }]);
HealthCheckTests.cs (1)
90var endpoint = resource.GetEndpoint("http").EndpointAnnotation;
ManifestExpressionTests.cs (3)
165endpoint.EndpointAnnotation.TlsEnabled = tlsEnabled; 425Assert.False(endpoint.EndpointAnnotation.BrowserUrlsSnapshot.IsValueSet); 486Assert.False(frontend.GetEndpoint("http").EndpointAnnotation.BrowserUrlsSnapshot.IsValueSet);
Orchestrator\ApplicationOrchestratorTests.cs (21)
41var endpoint = resource.GetEndpoint("http").EndpointAnnotation; 76var endpoint = resource.GetEndpoint("http").EndpointAnnotation; 112var endpoint = resource.GetEndpoint("http").EndpointAnnotation; 142var endpoint = item.GetEndpoint("http").EndpointAnnotation; 173endpoint.EndpointAnnotation.AllocatedEndpoint = new(endpoint.EndpointAnnotation, "localhost", 8080); 174var containerAllocation = new AllocatedEndpoint(endpoint.EndpointAnnotation, "frontend.internal", 8080, 176endpoint.EndpointAnnotation.AllAllocatedEndpoints.AddOrUpdateAllocatedEndpoint(KnownNetworkIdentifiers.DefaultAspireContainerNetwork, containerAllocation); 191Assert.Same(containerAllocation, await endpoint.EndpointAnnotation.AllAllocatedEndpoints.GetAllocatedEndpointAsync(KnownNetworkIdentifiers.DefaultAspireContainerNetwork)); 209endpoint.EndpointAnnotation.AllocatedEndpoint = new(endpoint.EndpointAnnotation, "localhost", 8080); 247var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 297var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 352var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 379var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 417var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 437var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 462var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 464var httpsEndpoint = frontend.GetEndpoint("https").EndpointAnnotation; 485var endpoint = frontend.GetEndpoint("http").EndpointAnnotation; 512var endpoint = frontend.GetEndpoint("http").EndpointAnnotation;
WithEndpointTests.cs (3)
261Assert.False(ep0.EndpointAnnotation.IsExternal); 262Assert.True(ep1.EndpointAnnotation.IsExternal); 263Assert.True(ep2.EndpointAnnotation.IsExternal);