Fix DevTunnel endpoint URL publication

Merged
KA
2mo ago
+155-2

Description

After upgrading to Aspire 13.5, DevTunnel port resources could reach Running and Healthy while the Dashboard and MCP resource snapshots still reported no URLs.

The proxyless endpoint allocator introduced in #17924 assigned a temporary localhost port to every unported proxyless endpoint, including DevTunnelPortResource. Because DevTunnels used an existing allocation as the signal that ResourceEndpointsAllocatedEvent had already run, it replaced the temporary endpoint with the public tunnel endpoint without publishing the URL update.

This change limits automatic proxyless port allocation to IComputeResource instances and containers. Executable, container, and project resources retain the allocation behavior from #17924, while integration-owned endpoints such as DevTunnel ports remain unallocated until their integration publishes the real endpoint. Regression coverage also explicitly guards DotnetProjectResource as a compute resource.

User-facing usage

Existing DevTunnel AppHosts now publish their public URLs again without code changes.

C#

builder.AddDevTunnel("public-tunnel")
    .WithReference(gateway)
    .WithAnonymousAccess();

TypeScript

const tunnel = await builder.addDevTunnel("public-tunnel")
  .withReference(gateway);

Validation

  • Targeted proxyless allocation coverage for executable, container, project, and DevTunnel port resources.
  • DotnetProjectResource compute-resource classification coverage.
  • DCP-backed DevTunnel reproduction using an isolated fake CLI, resulting in a healthy resource snapshot with active public tunnel and inspect URLs.

Fixes #19496

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No