Skip to content

Cannot access the "public" URL of a resource when using the dev.localhost applicationUrls #18819

Description

@ctolkien

We have a scenario where we have a frontend browser based application which calls a Backend API. The backend API needs to be configured with CORS rules for which frontend clients are able to call this API, which is driven from environment variables. So we need to know what the public URLs are that requests will be coming in from.

When using the dev.localhost "vanity" hostname system in Aspire, the actual hostname you will be accessing the frontend via is resourceName-appname.dev.localhost:XXXX, however it does not appear that we have a way to get this endpoint from a resource to pass this through.

resource.GetEndpoint("https", KnownNetworkIdentifiers.LocalhostNetwork); <- this will return localhost:XXXX. There doesn't seem to be a means of getting the *.dev.localhost:XXXX hostname that is presented in the Aspire dashboard.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions