[release/13.2] Allow filtering endpoints from the default reference set#15586
Open
danegsta wants to merge 3 commits intorelease/13.2from
Open
[release/13.2] Allow filtering endpoints from the default reference set#15586danegsta wants to merge 3 commits intorelease/13.2from
danegsta wants to merge 3 commits intorelease/13.2from
Conversation
* Allow filtering endpoints from the default reference set * Update snapshots for codegen * Update the property to ExcludeReferenceEndpoint and make it false by default * Update test snapshot with outdated containerApps API version
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15586Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15586" |
Contributor
There was a problem hiding this comment.
Pull request overview
Backport to release/13.2 enabling resource authors to exclude specific endpoints (e.g., management/health) from the default endpoint set surfaced by WithReference(resource), while still allowing explicit endpoint references.
Changes:
- Added
EndpointAnnotation.ExcludeReferenceEndpointand propagated it throughEndpointReferenceand default reference environment-variable injection logic. - Updated built-in resources/emulators (Keycloak, CosmosDB preview emulator, EventHubs emulator, ServiceBus emulator) to exclude non-API endpoints from the default reference set.
- Added/updated tests and refreshed polyglot codegen snapshots to include the new
excludeReferenceEndpointcapability/property.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Aspire.Hosting/ResourceBuilderExtensions.cs | Filters default endpoint injection to skip endpoints marked ExcludeReferenceEndpoint, while keeping explicitly named endpoints included. |
| src/Aspire.Hosting/ApplicationModel/EndpointAnnotation.cs | Introduces ExcludeReferenceEndpoint API with XML docs and default behavior (false). |
| src/Aspire.Hosting/ApplicationModel/EndpointReference.cs | Exposes ExcludeReferenceEndpoint on endpoint references for consumers/codegen. |
| src/Aspire.Hosting.Keycloak/KeycloakResourceBuilderExtensions.cs | Excludes Keycloak management endpoint from default reference set. |
| src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs | Excludes Cosmos DB preview emulator health endpoint from default reference set. |
| src/Aspire.Hosting.Azure.EventHubs/AzureEventHubsExtensions.cs | Excludes EventHubs emulator health endpoint from default reference set. |
| src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusExtensions.cs | Excludes ServiceBus emulator health endpoint from default reference set. |
| tests/Aspire.Hosting.Tests/WithReferenceTests.cs | Adds coverage for default exclusion, explicit referencing of excluded endpoints, and default property value behavior. |
| tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.ts | Updates TS snapshot for new excludeReferenceEndpoint getter. |
| tests/Aspire.Hosting.CodeGeneration.Rust.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.rs | Updates Rust snapshot for new exclude_reference_endpoint accessor. |
| tests/Aspire.Hosting.CodeGeneration.Python.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.py | Updates Python snapshot for new exclude_reference_endpoint accessor. |
| tests/Aspire.Hosting.CodeGeneration.Java.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.java | Updates Java snapshot for new excludeReferenceEndpoint accessor. |
| tests/Aspire.Hosting.CodeGeneration.Go.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.go | Updates Go snapshot for new ExcludeReferenceEndpoint accessor. |
joperezr
approved these changes
Mar 25, 2026
JamesNK
approved these changes
Mar 26, 2026
davidfowl
approved these changes
Mar 26, 2026
Contributor
|
🎬 CLI E2E Test Recordings — 51 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #23570542526 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #15558 for release/13.2
Fixes an issue where unrelated endpoints (such as the Keycloak management dashboard) can be reported in the default service discovery endpoint set for a resource. This can lead to references failing due to non-API endpoints being surfaced via service discovery.
This change allows individual endpoints to be excluded from the default set for a resource. They can still be referenced via a specific endpoint if needed.