Closed DamianEdwards closed 6 months ago
We found the same issue, and it seems to be related to this part in ResourceBuilderExtensions.cs
/ CreateEndpointReferenceEnvironmentPopulationCallback
method:
We only had 1 service referenced by "WithReference(...)
", and the referenced service's only port was duplicated perfectly, with a naming convention exactly as of the example listed before.
@ReubenBond is this fixed now?
Yes, I believe it is, since the endpoint is always a part of the config path now
I noticed this a while back but forgot to log it and now just noticed it again when explicitly trying to use named endpoints.
When referencing one project resource from another for the purposes of service discovery in an Aspire AppHost project,
Aspire.Hosting
injects configuration values (via environment variables) into the referencing project so that service discovery can be configured. The key names are being set correctly, but the values aren't correctly encoding the endpoint name into the URI host name.In the following example, this project resource is referencing another project resource named "apiservice" which has two endpoints: "http" and "internalhealthchecks". That should result in three config values being set, 2 for the endpoint named "http" (1 using the compact form and 1 using the expanded form), and 1 for the endpoint named "internalhealthchecks" (1 using the expanded form). Instead, we're only getting 1 entry for the "http" endpoint (it's missing the expanded form entry), and 1 for the "internalhealthchecks" endpoint that's using the compact form which is just wrong.
What I see
What it should be