44 writes to Url
Aspire.Hosting (14)
ApplicationModel\ResourceUrlAnnotation.cs (1)
51Url = Url,
ApplicationModel\ResourceUrlsEditor.cs (1)
88Url = url,
Dashboard\DashboardEventHandlers.cs (1)
472url.Url = $"{url.Url}/login?t={browserToken}";
Orchestrator\ApplicationOrchestrator.cs (6)
337var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = endpointReference }; 350Url = $"{allocatedEndpoint.UriScheme}://{endpoint.TargetHost}:{allocatedEndpoint.Port}", 359Url = $"{allocatedEndpoint.UriScheme}://{Environment.MachineName}:{allocatedEndpoint.Port}", 392Url = $"{allocatedEndpoint.UriScheme}://{resource.Name.ToLowerInvariant()}-{subdomainSuffix}.dev.localhost:{allocatedEndpoint.Port}", 507url.Url = uriBuilder.Uri.ToString(); 543url.Url = allocatedEndpoint.UriString.TrimEnd('/') + url.Url;
ProjectResourceBuilderExtensions.cs (2)
777url.Url = launchProfile.LaunchUrl; 783url.Url = (new Uri(baseUri, launchUri)).ToString();
ResourceBuilderExtensions.cs (3)
2056u.Url = uri.ToString(); 2064return builder.WithAnnotation(new ResourceUrlAnnotation { Url = url, DisplayText = displayText }); 2137c.Urls.Add(new() { Endpoint = endpoint, Url = urlValue, DisplayText = displayText });
Aspire.Hosting.Azure.Tests (2)
AzureCosmosDBExtensionsTests.cs (2)
1248new() { Url = "http://localhost:8080", Endpoint = cosmos.GetEndpoint("emulatorhealth") } 1273new() { Url = "http://localhost:1234", Endpoint = cosmos.GetEndpoint("data-explorer") }
Aspire.Hosting.DevTunnels (2)
DevTunnelResourceBuilderExtensions.cs (2)
675tunnelUrl.Url = new UriBuilder(tunnelUrl.Url).Uri.ToString().TrimEnd('/'); 698Url = inspectUrlString,
Aspire.Hosting.Foundry (1)
HostedAgent\HostedAgentBuilderExtension.cs (1)
307http.Url = new UriBuilder(http.Url)
Aspire.Hosting.Foundry.Tests (1)
HostedAgentExtensionTests.cs (1)
142Url = "http://localhost:1234",
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
100.WithUrlForEndpoint(QdrantServerResource.HttpEndpointName, e => new ResourceUrlAnnotation() { Url = "/dashboard", DisplayText = "Qdrant Dashboard" });
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
421Url = "/",
Aspire.Hosting.Tests (18)
Dashboard\DashboardResourceTests.cs (2)
834new() { Url = "http://localhost:5003", Endpoint = ((IResourceWithEndpoints)dashboard).GetEndpoint("http") }, 835new() { Url = "https://localhost:5005", Endpoint = ((IResourceWithEndpoints)dashboard).GetEndpoint("https") }
WithUrlsTests.cs (16)
142.WithUrls(c => c.Urls.Add(new() { Url = "https://example.com", DisplayText = "Example" })) 347u.Url = "https://example.com"; 378.WithUrlForEndpoint("http", u => u.Url = "https://example.com"); 661c.Urls.Add(new() { Url = "http://example.com/", DisplayLocation = UrlDisplayLocation.SummaryAndDetails }); 662c.Urls.Add(new() { Url = "http://example.com/internal", DisplayLocation = UrlDisplayLocation.DetailsOnly }); 663c.Urls.Add(new() { Url = "http://example.com/out-of-range", DisplayLocation = (UrlDisplayLocation)100 }); 726return new() { Url = "https://example.com" }; 752.WithUrls(c => c.Urls.Add(new() { Url = "https://callback-before.com/sub-path", DisplayText = "Example" })) 755.WithUrls(c => c.Urls.Add(new() { Url = "https://callback-after.com/sub-path" })) // This won't get updated because it's added after the relative URL 814url.Url = "/test-sub-path"; 847url.Url = "/test-sub-path"; 853Url = "/test-another-sub-path", 895return new() { Url = "/sub-path" }; 925c.Urls.Add(new() { Endpoint = c.GetEndpoint("test"), Url = "/sub-path" }); 962Url = "/", 1014Url = "/",
Stress.AppHost (1)
AppHost.cs (1)
86.WithUrls(c => c.Urls.Add(new() { Url = "https://someplace.com", DisplayText = "Some place" }))
TestShop.AppHost (3)
AppHost.cs (3)
63u.Url = "/"; 69Url = "/swagger", 100.WithUrlForEndpoint("https", ep => new() { Url = "/health", DisplayText = "Health", DisplayLocation = UrlDisplayLocation.DetailsOnly })
74 references to Url
Aspire.Hosting (25)
ApplicationModel\ResourceUrlAnnotation.cs (1)
51Url = Url,
Dashboard\DashboardEventHandlers.cs (1)
472url.Url = $"{url.Url}/login?t={browserToken}";
Dcp\ResourceSnapshotBuilder.cs (3)
325Url: endpointUrl.Url, 355new(Name: endpointName, Url: endpointUrl.Url, IsInternal: endpointUrl.IsInternal) 368new(Name: null, Url: url.Url, IsInternal: url.IsInternal)
Orchestrator\ApplicationOrchestrator.cs (18)
223urls = resourceUrls.Select(url => new UrlSnapshot(Name: url.Endpoint?.EndpointName, Url: url.Url, IsInternal: url.DisplayLocation == UrlDisplayLocation.DetailsOnly) 418_logger.LogTrace("Added URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, endpoint.Name, resource.Name); 425_logger.LogTrace("Added additional URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", additionalUrl.Url, endpoint.Name, resource.Name); 439_logger.LogTrace("Added static URL '{Url}' for resource '{ResourceName}'.", staticUrl.Url, resource.Name); 486Uri.TryCreate(primaryUrl.Url, UriKind.RelativeOrAbsolute, out var primaryUri); 487var primaryPath = primaryUri?.IsAbsoluteUri == true ? primaryUri.AbsolutePath : primaryUrl.Url; 494_logger.LogTrace("Applying path '{Path}' from URL '{Url}' for primary launch profile endpoint '{EndpointName}' to other launch profile endpoints for resource '{ResourceName}'.", primaryPath, primaryUrl.Url, primaryLaunchProfileEndpoint.Name, resource.Name); 499&& !string.Equals(url.Url, primaryUrl.Url, StringComparisons.Url) 500&& Uri.IsWellFormedUriString(url.Url, UriKind.Absolute)) 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); 506var uriBuilder = new UriBuilder(url.Url) { Path = primaryPath }; 510_logger.LogTrace("Updated URL to '{Url}' for launch profile endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, url.Endpoint.EndpointName, resource.Name); 519_logger.LogTrace("URL '{Url}' for primary launch profile endpoint '{EndpointName}' for resource '{ResourceName}' does not have a path to apply to other launch profile endpoints.", primaryUrl.Url, primaryLaunchProfileEndpoint.Name, resource.Name); 541if (url.Url.StartsWith('/') && endpoint.AllocatedEndpoint is { } allocatedEndpoint) 543url.Url = allocatedEndpoint.UriString.TrimEnd('/') + url.Url; 546_logger.LogTrace("Converted relative URL to absolute URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, endpoint.EndpointName, resource.Name); 560_logger.LogTrace("Added URL annotation '{Url}' to resource '{ResourceName}'.", url.Url, resource.Name);
ProjectResourceBuilderExtensions.cs (1)
782var baseUri = new Uri(url.Url);
ResourceBuilderExtensions.cs (1)
2053if (Uri.TryCreate(u.Url, UriKind.Absolute, out var absoluteUri)
Aspire.Hosting.DevTunnels (3)
DevTunnelResourceBuilderExtensions.cs (3)
673&& !string.Equals(new UriBuilder(u.Url).Host, "localhost")) is { } tunnelUrl) 675tunnelUrl.Url = new UriBuilder(tunnelUrl.Url).Uri.ToString().TrimEnd('/'); 681&& string.Equals(new UriBuilder(u.Url).Host, "localhost", StringComparison.OrdinalIgnoreCase)) is { } localhostTunnelUrl)
Aspire.Hosting.Foundry (1)
HostedAgent\HostedAgentBuilderExtension.cs (1)
307http.Url = new UriBuilder(http.Url)
Aspire.Hosting.Foundry.Tests (1)
HostedAgentExtensionTests.cs (1)
154Assert.Equal("http://localhost:1234/invocations", url.Url);
Aspire.Hosting.Qdrant.Tests (1)
QdrantFunctionalTests.cs (1)
250Assert.Single(urls, u => u.DisplayText == "Qdrant Dashboard" && u.Url.EndsWith("/dashboard"));
Aspire.Hosting.Redis.Tests (2)
AddRedisTests.cs (2)
311Assert.Equal("/", managementUrl.Url); 336Assert.Equal("/", managementUrl.Url);
Aspire.Hosting.Tests (41)
Dashboard\DashboardResourceTests.cs (2)
850Assert.Equal(expectedHttpUrl, httpUrl.Url); 854Assert.Equal(expectedHttpsUrl, httpsUrl.Url);
WithEndpointTests.cs (4)
815url => Assert.StartsWith("https://example.localhost:", url.Url), 816url => Assert.StartsWith("https://localhost:", url.Url)); 849url => Assert.StartsWith("https://localhost:", url.Url), 850url => Assert.StartsWith($"https://{Environment.MachineName}:", url.Url));
WithUrlsTests.cs (35)
154Assert.Single(urls, u => u.Url == "https://example.com" && u.DisplayText == "Example"); 178Assert.Single(urls, u => u.Url == "https://example.com" && u.DisplayText == "Example"); 206u => Assert.True(u.Url == endpointUrl.Url && u.DisplayText is null), 207u => Assert.True(u.Url.EndsWith("/test") && u.DisplayText == "Example") 232Assert.Single(urls, u => u.Url.StartsWith("http://localhost") && u.Endpoint?.EndpointName == "test"); 268Assert.StartsWith($"http://{projectB.Resource.Name.ToLowerInvariant()}{expectedHostSuffix}", u.Url); 269Assert.EndsWith("/sub-path", u.Url); 276Assert.StartsWith("http://localhost", u.Url); 282Assert.StartsWith("tcp://localhost", u.Url); 308Assert.Single(urls, u => u.Url.EndsWith("/sub-path") && u.Endpoint?.EndpointName == "http"); 331Assert.Single(urls, u => u.Url == "http://custom.localhost:23456/home" && u.Endpoint?.EndpointName == "http"); 363u.Url == "https://example.com" 768var staticBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://static-before.com")); 769var callbackBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://callback-before.com")); 770var staticAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://static-after.com")); 771var callbackAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://callback-after.com")); 775Assert.True(endpointUrl.Url.StartsWith("http://localhost") && endpointUrl.Url.EndsWith("/test")); 778Assert.Equal("https://static-before.com/test", staticBeforeUrl.Url); 781Assert.Equal("https://callback-before.com/test", callbackBeforeUrl.Url); 784Assert.Equal("https://static-after.com/test", staticAfter.Url); 787Assert.Equal("https://callback-after.com/sub-path", callbackAfter.Url); 830Assert.StartsWith(useHttps ? "https://localhost" : "http://localhost", endpointUrl.Url); 831Assert.EndsWith("/test-sub-path", endpointUrl.Url); 870Assert.StartsWith("http://localhost", url.Url); 871Assert.EndsWith("/test-sub-path", url.Url); 876Assert.StartsWith("http://localhost", url.Url); 877Assert.EndsWith("/test-another-sub-path", url.Url); 907var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 910Assert.True(endpointUrl.Url.StartsWith("http://localhost") && endpointUrl.Url.EndsWith("/sub-path")); 937var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 940Assert.True(endpointUrl.Url.StartsWith("http://localhost") && endpointUrl.Url.EndsWith("/sub-path"));