Repository navigation
Add the ability to get a host address ReferenceExpression from an EndpointReference - #11931
Merged
David Fowler (davidfowl) merged 10 commits intoOct 21, 2025
Merged
Conversation
Eric Erhardt (eerhardt)
requested review from
David Fowler (davidfowl) and
Mitch Denny (mitchdenny)
October 9, 2025 20:45
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 11931Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 11931" |
…pointReference When you have an EndpointReference, it is useful to decompose this EndpointReference into a ReferenceExpression that can be used as a parameter to other resources. Implement a method on each IComputeEnvironmentResource that turns an EndpointReference for a compute target in that environment into a ReferenceExpression.
…he WebSite's suffix so it can produce the correct endpoint expression.
It isn't possible to tell if the ComputeResource targets this compute environment. So remove the checking. The ReferenceExpression returned will be in terms of the compute environment if the resource is deployed to that environment.
Eric Erhardt (eerhardt)
force-pushed
the
EndpointEnhancements
branch
from
October 17, 2025 23:35
f2e7f2f to
45775d4
Compare
Eric Erhardt (eerhardt)
marked this pull request as ready for review
October 17, 2025 23:35
Eric Erhardt (eerhardt)
requested review from
Safia Abdalla (captainsafia) and
Copilot
October 17, 2025 23:35
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds support for computing a host address ReferenceExpression from an EndpointReference for each compute environment.
- Introduces GetHostAddressExpression on IComputeEnvironmentResource.
- Implements environment-specific host computation logic (Kubernetes, Docker Compose, Azure Container Apps, Azure App Service) and updates Azure outputs (webSiteSuffix).
- Adds tests validating the host address expressions and updates Bicep snapshots to include new outputs.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Aspire.Hosting/ApplicationModel/IComputeEnvironmentResource.cs | Adds new API method for resolving host address expressions. |
| src/Aspire.Hosting.Kubernetes/KubernetesEnvironmentResource.cs | Implements host expression using service naming convention. |
| src/Aspire.Hosting.Docker/DockerComposeEnvironmentResource.cs | Implements host expression using lowercase service name. |
| src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentResource.cs | Implements host expression and exposes website suffix output. |
| src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentExtensions.cs | Emits provisioning output for website suffix. |
| src/Aspire.Hosting.Azure.AppService/AzureAppServiceWebsiteContext.cs | Switches to shared website suffix logic. |
| src/Aspire.Hosting.Azure.AppContainers/AzureContainerAppEnvironmentResource.cs | Implements internal/external domain host logic. |
| tests/Aspire.Hosting.Kubernetes.Tests/KubernetesEnvironmentResourceTests.cs | Adds test for Kubernetes host expression. |
| tests/Aspire.Hosting.Docker.Tests/DockerComposeTests.cs | Adds test for Docker Compose host expression. |
| tests/Aspire.Hosting.Azure.Tests/AzureContainerAppsTests.cs | Adds test for Azure Container Apps host expression. |
| tests/Aspire.Hosting.Azure.Tests/AzureAppServiceTests.cs | Adds test validating App Service host expression and output name. |
| tests/Aspire.Hosting.Azure.Tests/Snapshots/*.bicep | Adds webSiteSuffix output to App Service environment snapshots. |
Comment on lines
+55
to
+56
| internal static BicepValue<string> GetWebSiteSuffixBicep() => | ||
| BicepFunction.GetUniqueString(BicepFunction.GetResourceGroup().Id); |
There was a problem hiding this comment.
Inconsistent casing of 'WebSite' vs 'website' in property/output naming. Prefer 'WebsiteSuffix' (single word) and align the Bicep output name (e.g., websiteSuffix) for consistency with naming guidelines.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
David Fowler (davidfowl)
approved these changes
Oct 21, 2025
6 of 16 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
When you have an EndpointReference, it is useful to decompose this EndpointReference into a ReferenceExpression that can be used as a parameter to other resources.
Implement a method on each IComputeEnvironmentResource that turns an EndpointReference for a compute target in that environment into a ReferenceExpression.
Checklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplate