Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Aspire projects to use multiple ports configured in ASPNETCORE_URLS or applicationUrl #4727

Open
vfportero opened this issue Jun 29, 2024 · 0 comments
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Comments

@vfportero
Copy link

For our multitenant environment, we have configured multiple HTTPS ports for the API project on localhost as follows:

{
  "$schema": "https://json.schemastore.org/launchsettings.json",
  "profiles": {
    "Lucera.Api.SignUp": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "ASPNETCORE_URLS": "https://localhost:40501;https://localhost:40502;https://localhost:40503;https://localhost:40504;https://localhost:40507;https://localhost:40508"
      },
      "applicationUrl": "https://localhost:40501"
    }
  }
}

When we run this launch profile directly, all the specified ports are mapped and work perfectly. However, when this profile is added to the AppHost Aspire project, only the first port works:

builder.AddProject<Projects.Lucera_Api_SignUp>("lucera-api-signup");

image

In another ticket, I noticed that it is possible to map different ports using the applicationUrl property when the protocols (http & https) are different. However, when using the same protocol with multiple ports, only the last one works.

Is there a way to achieve this with Aspire?

Thank you!

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Jun 29, 2024
@vfportero vfportero changed the title Enable Aspire Projects to utilize multiple ports configured in ASPNETCORE_URLS or applicationUrl Enable Aspire Projects to use multiple ports configured in ASPNETCORE_URLS or applicationUrl Jun 29, 2024
@vfportero vfportero changed the title Enable Aspire Projects to use multiple ports configured in ASPNETCORE_URLS or applicationUrl Enable Aspire projects to use multiple ports configured in ASPNETCORE_URLS or applicationUrl Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Projects
None yet
Development

No branches or pull requests

1 participant