-
Notifications
You must be signed in to change notification settings - Fork 815
Closed
Description
I have a YARP resource and want to use it as an API gateway towards my other resources (source).
var builder = DistributedApplication.CreateBuilder(args);
var identity = builder.AddProject<Projects.Identity>("Identity");
var backend = builder.AddProject<Projects.Backend>("Backend");
var frontend = builder.AddViteApp("Frontend", "../Frontend");
var gateway = builder.AddYarp("Gateway")
.WithHostHttpsPort(8443)
.WithHostPort(8080)
.WithConfiguration(yarp =>
{
yarp.AddRoute("/identity/{**catch-all}", identity);
yarp.AddRoute("/backend/{**catch-all}", backend);
yarp.AddRoute("/frontend/{**catch-all}", frontend);
});
builder.Build().Run();Unfortunately it does not accept my HTTPS port but keeps randomly assigning a port. For HTTP it accepts my port.
The docs say this will only have effect if an HTTPS endpoint is configured on the YARP resource due to TLS termination being enabled. I clearly have an HTTPS endpoint and when I attempt to add one explicitly, I get a Aspire.Hosting.DistributedApplicationException: Endpoint with name 'https' already exists.
What can I do to give my YARP gateway resource a static port?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels