⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

Copy link

Copilot AI commented Jan 29, 2026

The template generated projects with service discovery (Eureka/Consul) but lacked context on how port registration works, particularly for local development.

Changes

  • Added inline comments explaining service discovery client registration in Program.cs
  • Documented automatic port detection for Steeltoe v4 (DynamicPortAssignmentHostedService reads from IServerAddressesFeature)
  • Clarified cloud hosting setup for Steeltoe v3

Example Output

Steeltoe v4 with Eureka:

// Registers this application with Eureka for service discovery.
// Port registration is automatically detected from the server's listening addresses.
builder.Services.AddEurekaDiscoveryClient();

Steeltoe v3 with cloud hosting:

// Configures the application to listen on the port(s) provided by the cloud platform.
builder.UseCloudHosting();
// Registers this application with a service discovery provider (e.g., Eureka, Consul).
builder.Services.AddDiscoveryClient(builder.Configuration);

Technical Notes

No changes to appsettings.Development.json needed - Steeltoe v4's DynamicPortAssignmentHostedService automatically detects ports after server startup. Steeltoe v3 correctly uses ports from launchSettings.json.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 8yfvsblobprodwus2171.blob.core.windows.net
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/NetCoreToolTemplates/.codeql-scratch/dbs/csharp/working/6976045FF0075E801429782E65F3A860/missingpackages_workingdir --packages /home/REDACTED/work/NetCoreToolTemplates/.codeql-scratch/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /home/REDACTED/work/NetCoreToolTemplates/.codeql-scratch/dbs/csharp/working/nugetconfig/nuget.config --force conf�� onfig/nuget.config credential.username rgo/bin/bash (dns block)
  • docs.steeltoe.io
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
  • xumvsblobprodwus213.blob.core.windows.net
    • Triggering command: /usr/share/dotnet/dotnet dotnet new steeltoe-webapi --discovery-eureka --steeltoe 4.*-main-* --framework net8.0 --language C# (dns block)
    • Triggering command: /usr/share/dotnet/dotnet dotnet build /p:TreatWarningsAsErrors=True /p:EnforceCodeStyleInBuild=True /p:GenerateDocumentationFile=True (dns block)
    • Triggering command: /usr/share/dotnet/dotnet dotnet new steeltoe-webapi --discovery-eureka --steeltoe 4.*-main-* --framework net10.0 --language C# (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Initializer with .NET 6 and Eureka has some unexpected behaviour when run locally - also some suggestions</issue_title>
<issue_description>Please be sure to check the existing issues (both open and closed!).

Issue description

The way the sample app is created now is somewhat confusing.
launchsettings.json only has http://localhost:5000 - I would expect it to also contain https://localhost:5001
Program is using .UseCloudHosting(<PORTNUMBER>), I would at least expect this to have .UseCloudHosting(<PORTNUMBER>, <SECUREPORTNUMBER>)
When running locally, without "Urls":"https://localhost:5001" in the appsettings.json the app will not register localhost - suggestion - add this by default to the appsettings.Development.json file.

I would also suggest adding code comments to draw the user's attention to the various moving parts to greater assist with their learning and comprehension.

I would also consider using the minimal hosting pattern for .NET 6 as this is more in line with current MS dotnet new templates.

@ccheetham and I discussed the above on a call
</issue_description>

<agent_instructions>I think the majority of this has been addressed, but please double-check and add anything we've missed</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix unexpected behavior of initializer with .NET 6 and Eureka Add clarifying comments for service discovery port registration Jan 29, 2026
Copilot AI requested a review from TimHess January 29, 2026 17:56
@TimHess TimHess requested a review from bart-vmware January 30, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Initializer with .NET 6 and Eureka has some unexpected behaviour when run locally - also some suggestions

2 participants