Skip to content

Defer YARP resource endpoint resolution#16834

Merged
danegsta merged 1 commit intomicrosoft:mainfrom
danegsta:fix-yarp-deferred-endpoint-resolution
May 6, 2026
Merged

Defer YARP resource endpoint resolution#16834
danegsta merged 1 commit intomicrosoft:mainfrom
danegsta:fix-yarp-deferred-endpoint-resolution

Conversation

@danegsta
Copy link
Copy Markdown
Member

@danegsta danegsta commented May 6, 2026

Description

Defer YARP cluster target resolution for resource, endpoint, and external service destinations until environment configuration is generated. This ensures resource endpoint scheme changes made late in AppHost startup, such as AddUvicornApp automatically upgrading its primary endpoint to HTTPS when a developer certificate is available, are reflected in YARP's generated reverse proxy destinations.

Resource targets now resolve through endpoint-aware logic consistent with explicit endpoint targets: scheme-named endpoints resolve as scheme://resource, while named endpoints resolve with the DNS-SD named endpoint form such as http://_api.resource.

Added regression coverage for late endpoint scheme updates and named endpoint resource resolution.

Fixes #16831

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
  • Does the change require an update in our Aspire docs?

Resolve YARP cluster targets from resource endpoints when generating environment configuration so late endpoint scheme changes, such as Uvicorn's HTTPS upgrade, are reflected in the reverse proxy destination.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 18:05
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16834

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16834"

@danegsta danegsta merged commit d3e9bc5 into microsoft:main May 6, 2026
844 of 859 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 13.4 milestone May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

YARP Uvicorn service discovery broken

2 participants