Skip to content

GetEnvironmentVariableValuesAsync doesn't properly resolve HostUrl #11401

@afscrome

Description

@afscrome

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

resource.GetEnvironmentVariableValuesAsync() doesn't pass through AppHost:ContainerHost down into ProcessEnvironmentVariableValuesAsync, and so always resolves host references as host.docker.internal

Expected Behavior

I'd expect it to honour AppHost:ContainerHost, but with this extension method on IResource, it doesn't have any reference to the Configuration. This seems very similar to #9787 , which makes me wonder if the API itself is the problem - needing to be on a supporting service rather than an extension method on IResource. So whilst it's a good approximation, there are a number of edge cases where it will resolve values differently.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

CommunityToolkit/Aspire#853 (comment)
CommunityToolkit/Aspire#853 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions