95 writes to Url
Aspire.Hosting (16)
ApplicationModel\ResourceUrlAnnotation.cs (1)
46Url = Url,
ApplicationModel\ResourceUrlsEditor.cs (1)
88Url = url,
Dashboard\DashboardEventHandlers.cs (1)
317url.Url = $"{url.Url}/login?t={browserToken}";
Orchestrator\ApplicationOrchestrator.cs (7)
351var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = endpointReference }; 364Url = $"{allocatedEndpoint.UriScheme}://{endpoint.TargetHost}:{allocatedEndpoint.Port}", 373Url = $"{allocatedEndpoint.UriScheme}://{Environment.MachineName}:{allocatedEndpoint.Port}", 406Url = $"{allocatedEndpoint.UriScheme}://{resource.Name.ToLowerInvariant()}-{subdomainSuffix}.dev.localhost:{allocatedEndpoint.Port}", 524url.Url = uriBuilder.Uri.ToString(); 560url.Url = allocatedEndpoint.UriString.TrimEnd('/') + url.Url; 578url.Url = rewrittenUrl;
ProjectResourceBuilderExtensions.cs (2)
851url.Url = launchProfile.LaunchUrl; 857url.Url = (new Uri(baseUri, launchUri)).ToString();
ResourceBuilderExtensions.cs (4)
2382u.Url = uri.ToString(); 2390return builder.WithAnnotation(new ResourceUrlAnnotation { Url = url, DisplayText = displayText }); 2463c.Urls.Add(new() { Endpoint = endpoint, Url = urlValue, DisplayText = displayText }); 2628url = new ResourceUrlAnnotation { Url = "/", Endpoint = endpoint };
Aspire.Hosting.Azure.EntraId.Tests (7)
EntraIdProvisioningTests.cs (7)
1167web.WithUrlForEndpoint("https", url => url.Url = "https://web.dev.localhost:7081/swagger?x=1#top"); 1277web.WithUrlForEndpoint("https", url => url.Url = "https://web-hashr.dev.localhost:7081"); 1302web.WithUrlForEndpoint("https", url => url.Url = "https://web.dev.localhost:7081/swagger") 1305Url = "https://public.example:9443/home", 1331context.Urls[0].Url = "https://web.example/home"; 1450web.WithUrlForEndpoint("https", url => url.Url = "/swagger"); 1483Url = "https://other.dev.localhost:7082",
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 (3)
DevTunnelResourceBuilderExtensions.cs (3)
669tunnelUrl.Url = new UriBuilder(tunnelUrl.Url).Uri.ToString().TrimEnd('/'); 692Url = inspectUrlString, 742url.Url = UpdatePortUrl(url.Url, url.Endpoint?.EndpointName, url.DisplayText, previousAddress, portUri);
Aspire.Hosting.DevTunnels.Tests (4)
DevTunnelMonitorTests.cs (3)
264tunnelUrl.Url += "/swagger?x=1#operations"; 268Url = "https://original-3000.usw2.devtunnels.ms/health" 273Url = "https://custom.example/app"
DevTunnelResourceBuilderExtensionsTests.cs (1)
781context.Urls.Add(new() { Url = "https://example.com/diagnostics", DisplayText = "Custom diagnostics" });
Aspire.Hosting.Foundry (1)
HostedAgent\HostedAgentBuilderExtension.cs (1)
309http.Url = new UriBuilder(http.Url)
Aspire.Hosting.Foundry.Tests (1)
HostedAgentExtensionTests.cs (1)
146Url = "http://localhost:1234",
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
102.WithUrlForEndpoint(QdrantServerResource.HttpEndpointName, e => new ResourceUrlAnnotation() { Url = "/dashboard", DisplayText = "Manage", DisplayOrder = 1 });
Aspire.Hosting.Tests (56)
Dashboard\DashboardResourceTests.cs (2)
854new() { Url = "http://localhost:5003", Endpoint = ((IResourceWithEndpoints)dashboard).GetEndpoint("http") }, 855new() { Url = "https://localhost:5005", Endpoint = ((IResourceWithEndpoints)dashboard).GetEndpoint("https") }
Dcp\DcpExecutorTests.cs (2)
5201url.Url = "https://frontend.example/app"; 5208url.Url = "https://backend.example/app";
EndpointReferenceTests.cs (16)
527new() { Url = "https://localhost:8443/original" }, 528new() { Url = "https://public.example/path" }, 529new() { Url = "https://alias.example/home" }, 530new() { Url = "https://public.example/duplicate" } 559endpoint.EndpointAnnotation.BrowserUrlsSnapshot.SetValue([new() { Url = "https://frontend.example/path" }]); 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" }]); 608new() { Url = "http://preferred.example:8080/app" }, 609new() { Url = "https://frontend.example/app" }, 610new() { Url = "https://frontend.example:443/swagger" }, 611new() { Url = "https://127.0.0.1:8443/" }, 612new() { Url = "https://frontend.example:9443/" } 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" }]);
Orchestrator\ApplicationOrchestratorTests.cs (16)
67.WithUrlForEndpoint("http", url => url.Url = "https://first.example/app"); 170.WithUrlForEndpoint("http", url => url.Url = "/path?x=1#fragment") 171.WithUrlForEndpoint("http", _ => new() { Url = "http://localhost:8080/secondary", DisplayLocation = UrlDisplayLocation.DetailsOnly }); 206.WithUrlForEndpoint("http", url => url.Url = "https://custom.example/path?x=1#fragment") 207.WithUrlForEndpoint("http", _ => new() { Url = "http://localhost:8080/secondary", DisplayLocation = UrlDisplayLocation.DetailsOnly }); 237context.Urls[0].Url = "https://frontend.example/app"; 295frontend.WithUrlForEndpoint("http", url => url.Url = customUrl); 346.WithUrlForEndpoint("http", url => url.Url = "https://frontend.example/app") 347.WithUrlForEndpoint("http", _ => new() { Url = "https://frontend.example/swagger" }) 348.WithUrlForEndpoint("http", _ => new() { Url = "https://admin.example", DisplayOrder = 1000 }) 351.WithUrlForEndpoint(frontend.GetEndpoint("http"), url => url.Url = "https://manager.example/admin"); 377context.Urls[0].Url = "https://frontend.example/app"; 413Url = "https://frontend.example/app", 459.WithUrlForEndpoint("http", url => url.Url = invalidUrl) 461.WithUrlForEndpoint("https", url => url.Url = "https://frontend.example/home"); 510context.Urls[0].Url = "https://frontend.example/app";
WithUrlsTests.cs (20)
49Url = "https://example.com", 189Url = "http://localhost:8080" 217Url = "http://localhost:8080" 371.WithUrls(c => c.Urls.Add(new() { Url = "https://example.com", DisplayText = "Example" })) 575u.Url = "https://example.com"; 605.WithUrlForEndpoint("http", u => u.Url = "https://example.com"); 772c.Urls.Add(new() { Url = "http://example.com/", DisplayLocation = UrlDisplayLocation.SummaryAndDetails }); 773c.Urls.Add(new() { Url = "http://example.com/internal", DisplayLocation = UrlDisplayLocation.DetailsOnly }); 774c.Urls.Add(new() { Url = "http://example.com/out-of-range", DisplayLocation = (UrlDisplayLocation)100 }); 837return new() { Url = "https://example.com" }; 863.WithUrls(c => c.Urls.Add(new() { Url = "https://callback-before.com/sub-path", DisplayText = "Example" })) 866.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 925url.Url = "/test-sub-path"; 958url.Url = "/test-sub-path"; 964Url = "/test-another-sub-path", 1006return new() { Url = "/sub-path" }; 1036url.Url = "/admin"; 1068c.Urls.Add(new() { Endpoint = c.GetEndpoint("test"), Url = "/sub-path" }); 1105Url = "/", 1157Url = "/",
Stress.AppHost (1)
AppHost.cs (1)
87.WithUrls(c => c.Urls.Add(new() { Url = "https://someplace.com", DisplayText = "Some place" }))
TestShop.AppHost (3)
AppHost.cs (3)
148u.Url = "/"; 154Url = "/swagger", 191.WithUrlForEndpoint("https", ep => new() { Url = "/health", DisplayText = "Health", DisplayLocation = UrlDisplayLocation.DetailsOnly })
86 references to Url
Aspire.Hosting (29)
ApplicationModel\EndpointReference.cs (1)
420var origins = urls.Select(url => new Uri(url.Url, UriKind.Absolute))
ApplicationModel\ResourceUrlAnnotation.cs (1)
46Url = Url,
Dashboard\DashboardEventHandlers.cs (1)
317url.Url = $"{url.Url}/login?t={browserToken}";
Dcp\ResourceSnapshotBuilder.cs (3)
592Url: endpointUrl.Url, 620new(Name: endpointName, Url: endpointUrl.Url, IsInternal: endpointUrl.IsInternal) 631new(Name: null, Url: url.Url, IsInternal: url.IsInternal)
Orchestrator\ApplicationOrchestrator.cs (21)
238urls = resourceUrls.Select(url => new UrlSnapshot(Name: url.Endpoint?.EndpointName, Url: url.Url, IsInternal: url.DisplayLocation == UrlDisplayLocation.DetailsOnly) 432_logger.LogTrace("Added URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, endpoint.Name, resource.Name); 439_logger.LogTrace("Added additional URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", additionalUrl.Url, endpoint.Name, resource.Name); 453_logger.LogTrace("Added static URL '{Url}' for resource '{ResourceName}'.", staticUrl.Url, resource.Name); 503Uri.TryCreate(primaryUrl.Url, UriKind.RelativeOrAbsolute, out var primaryUri); 504var primaryPath = primaryUri?.IsAbsoluteUri == true ? primaryUri.AbsolutePath : primaryUrl.Url; 511_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); 516&& !string.Equals(url.Url, primaryUrl.Url, StringComparisons.Url) 517&& Uri.IsWellFormedUriString(url.Url, UriKind.Absolute)) 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); 523var uriBuilder = new UriBuilder(url.Url) { Path = primaryPath }; 527_logger.LogTrace("Updated URL to '{Url}' for launch profile endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, url.Endpoint.EndpointName, resource.Name); 536_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); 558if (url.Url.StartsWith('/') && endpoint.AllocatedEndpoint is { } allocatedEndpoint) 560url.Url = allocatedEndpoint.UriString.TrimEnd('/') + url.Url; 563_logger.LogTrace("Converted relative URL to absolute URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, endpoint.EndpointName, resource.Name); 576codespacesRewriter.TryRewriteResourceUrl(url.Url, out var rewrittenUrl)) 608_logger.LogTrace("Added URL annotation '{Url}' to resource '{ResourceName}'.", url.Url, resource.Name); 629if (!Uri.TryCreate(url.Url, UriKind.Absolute, out var uri)) 632"URL '{Url}' for resource '{ResourceName}' is not absolute and cannot provide a browser origin.", url.Url, resource.Name);
ProjectResourceBuilderExtensions.cs (1)
856var baseUri = new Uri(url.Url);
ResourceBuilderExtensions.cs (1)
2379if (Uri.TryCreate(u.Url, UriKind.Absolute, out var absoluteUri)
Aspire.Hosting.DevTunnels (4)
DevTunnelResourceBuilderExtensions.cs (4)
667&& !string.Equals(new UriBuilder(u.Url).Host, "localhost")) is { } tunnelUrl) 669tunnelUrl.Url = new UriBuilder(tunnelUrl.Url).Uri.ToString().TrimEnd('/'); 675&& string.Equals(new UriBuilder(u.Url).Host, "localhost", StringComparison.OrdinalIgnoreCase)) is { } localhostTunnelUrl) 742url.Url = UpdatePortUrl(url.Url, url.Endpoint?.EndpointName, url.DisplayText, previousAddress, portUri);
Aspire.Hosting.Foundry (1)
HostedAgent\HostedAgentBuilderExtension.cs (1)
309http.Url = new UriBuilder(http.Url)
Aspire.Hosting.Foundry.Tests (1)
HostedAgentExtensionTests.cs (1)
158Assert.Equal("http://localhost:1234/invocations", url.Url);
Aspire.Hosting.Qdrant.Tests (1)
QdrantFunctionalTests.cs (1)
250Assert.Single(urls, u => u.DisplayText == "Manage" && u.Url.EndsWith("/dashboard"));
Aspire.Hosting.Redis.Tests (2)
AddRedisTests.cs (2)
313Assert.Equal("/", managementUrl.Url); 339Assert.Equal("/", managementUrl.Url);
Aspire.Hosting.Tests (48)
Dashboard\DashboardResourceTests.cs (2)
870Assert.Equal(expectedHttpUrl, httpUrl.Url); 874Assert.Equal(expectedHttpsUrl, httpsUrl.Url);
Orchestrator\ApplicationOrchestratorTests.cs (6)
193frontend.Resource.Annotations.OfType<ResourceUrlAnnotation>().Select(url => url.Url)); 217frontend.Resource.Annotations.OfType<ResourceUrlAnnotation>().Select(url => url.Url)); 332Assert.Equal(customUrl.StartsWith('/') ? $"http://localhost:8080{customUrl}" : customUrl, primaryUrl.Url); 336Assert.Equal(expectedOrigin, new Uri(primaryUrl.Url).GetLeftPart(UriPartial.Authority)); 363Assert.Equal("https://manager.example/admin", Assert.Single(manager.Resource.Annotations.OfType<ResourceUrlAnnotation>()).Url); 476frontend.Resource.Annotations.OfType<ResourceUrlAnnotation>().Select(url => url.Url));
WithEndpointTests.cs (4)
1071url => Assert.StartsWith("https://example.localhost:", url.Url), 1072url => Assert.StartsWith("https://localhost:", url.Url)); 1105url => Assert.StartsWith("https://localhost:", url.Url), 1106url => Assert.StartsWith($"https://{Environment.MachineName}:", url.Url));
WithUrlsTests.cs (36)
383Assert.Single(urls, u => u.Url == "https://example.com" && u.DisplayText == "Example"); 407Assert.Single(urls, u => u.Url == "https://example.com" && u.DisplayText == "Example"); 435u => Assert.True(u.Url == endpointUrl.Url && u.DisplayText is null), 436u => Assert.True(u.Url.EndsWith("/test") && u.DisplayText == "Example") 461Assert.Single(urls, u => u.Url.StartsWith("http://localhost") && u.Endpoint?.EndpointName == "test"); 497Assert.StartsWith($"http://{projectB.Resource.Name.ToLowerInvariant()}{expectedHostSuffix}", u.Url); 498Assert.EndsWith("/sub-path", u.Url); 505Assert.StartsWith("http://localhost", u.Url); 511Assert.StartsWith("tcp://localhost", u.Url); 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"); 591u.Url == "https://example.com" 879var staticBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://static-before.com")); 880var callbackBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://callback-before.com")); 881var staticAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://static-after.com")); 882var callbackAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://callback-after.com")); 886Assert.True(endpointUrl.Url.StartsWith("http://localhost") && endpointUrl.Url.EndsWith("/test")); 889Assert.Equal("https://static-before.com/test", staticBeforeUrl.Url); 892Assert.Equal("https://callback-before.com/test", callbackBeforeUrl.Url); 895Assert.Equal("https://static-after.com/test", staticAfter.Url); 898Assert.Equal("https://callback-after.com/sub-path", callbackAfter.Url); 941Assert.StartsWith(useHttps ? "https://localhost" : "http://localhost", endpointUrl.Url); 942Assert.EndsWith("/test-sub-path", endpointUrl.Url); 981Assert.StartsWith("http://localhost", url.Url); 982Assert.EndsWith("/test-sub-path", url.Url); 987Assert.StartsWith("http://localhost", url.Url); 988Assert.EndsWith("/test-another-sub-path", url.Url); 1018var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 1021Assert.True(endpointUrl.Url.StartsWith("http://localhost") && endpointUrl.Url.EndsWith("/sub-path")); 1053Assert.Equal($"{manager.GetEndpoint("http").Url.TrimEnd('/')}/admin", url.Url); 1080var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 1083Assert.True(endpointUrl.Url.StartsWith("http://localhost") && endpointUrl.Url.EndsWith("/sub-path"));