dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.82k stars 455 forks source link

[CodeSpaces] The `launchSettings.json` of AppHost doesn't seem to be properly respected #1296

Closed timheuer closed 3 weeks ago

timheuer commented 11 months ago

The launchSettings.json of AppHost doesn't seem to be properly respected - launchSettings.json of AppHost has these two attributes like:

"applicationUrl": "http://localhost:<random_port_number>",
"environmentVariables": {
  "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:<random_port_number>"
}

I initially expected that the applicationUrl attribute will be used to launch the dashboard page, but it uses http://localhost:18888. I'm not sure what these applicationUrl and DOTNET_DASHBOARD_OTLP_ENDPOINT_URL are for.

DamianEdwards commented 11 months ago

This seems to be missing some detail?

justinyoo commented 11 months ago

Hi, @DamianEdwards It's in the context of GitHub Codespaces (and possibly VS Code). When I check it in VS, the URLs defined in launchSettings.json are properly used. However, when it comes to GitHub Codespaces, it uses pre-configured (or hard-coded port numbers like 1888 or 18889.

Wonder whether it's by design or not.

mitchdenny commented 3 weeks ago

Closing this. In terms of the port mappings for the dashboard it seems to be detecting the right URL (I launch with dotnet run -lp http (the proxy doesn't like out SSL cert).

It correctly opens the dashboard at the value specified for applicationUrl. Its possible that this earlier behavior was a bug that we had in .NET Aspire 8.x.

FYI, I've done some experimentation on making the URLs in the dashboard show the proxied URLs:

1178