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

When using Aspire locally always use the same port, without proxying #287

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion aspire-orchestrator/Aspire.AppHost/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ private static IDistributedApplicationBuilder AddSemanticWorkbench(this IDistrib
// When running locally
if (!builder.ExecutionContext.IsPublishMode)
{
workbenchApp.WithHttpsEndpoint(env: "PORT");
if (!int.TryParse(builder.Configuration["Workbench:AppPort"], out var appPort)) { appPort = 4000; }
workbenchApp.WithHttpsEndpoint(port: appPort, env: "PORT", isProxied: false);
}

return builder;
Expand Down
10 changes: 8 additions & 2 deletions aspire-orchestrator/Aspire.AppHost/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
"Aspire.Hosting.Dcp": "Warning"
}
},
"Workbench": {
// Used only when running Aspire locally, ie not in the cloud
// Port 4000 is the default port used also when not using Aspire.
// Using the same port allows to keep cookies and other local settings.
"AppPort": 4000
},
"EntraID": {
"ClientId": "22cb77c3-ca98-4a26-b4db-ac4dcecba690",
"Authority": "https://login.microsoftonline.com/common"
"Authority": "https://login.microsoftonline.com/common",
"ClientId": "22cb77c3-ca98-4a26-b4db-ac4dcecba690"
}
}