I have created a simple test project with aspire following a few tutorials and the docs online. and im trying to enable service discovery to get rid of any endpoint addresses in code or config .. i was following the microsoft doc here Doc Link for the "Implicit discovery by reference" . ive set it up as described and for some reason all thats being passed into my http client is "https+http://api" instead of the environment variable thats supposed to be there. obv then causes the service to 404.
heres some snippets of the code
AppHost.Program.cs
var builder = DistributedApplication.CreateBuilder(args);
var api = builder.AddProject<Projects.wfd_AlgoliaDemo_api>("api");
var web = builder.AddProject<Projects.wfd_AlgoliaDemo>("wfd-algoliademo")
.WithReference(api)
.WithExternalHttpEndpoints();
builder.Build().Run();
And the setup in my frontend app program.cs
builder.Services.AddSingleton<AlgoliaService>();
builder.Services.AddHttpClient<AlgoliaService>(options =>
{
var url = "https+http://api";
options.BaseAddress = new(url);
});
i have double checked in my Service defaults project and the Service discovery is definately enables so im stuck as all the docs and tutorials obv just go "Huzzah it works like magic" ...
any help is appreciated
Just to post an answer and close the question the issue was related to an error in build that was not handled correctly causing the service to never create its endpoint, for some reason aspire still thought this was running fine and didnt notify me of any errors.