Add Region to DevTunnelOptions to ensure setting region devtunnel is created in#14112
Add Region to DevTunnelOptions to ensure setting region devtunnel is created in#14112kola-tm wants to merge 5 commits intodotnet:mainfrom
Conversation
…he dev tunnel region at creation, and to refer to the correct dev tunnel using the fully qualified tunnel Id. Updated readme for scenario
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14112Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14112" |
|
@dotnet-policy-service agree |
|
@mitchdenny Hi Mitch, not too sure how to request reviewers for this PR. I saw a previous Dev Tunnel PR that was reviewed by yourself so thought to tag you in this PR. |
…ent regions - Remove DI singleton registration of DevTunnelOptions - Restore options parameter to CreateTunnelAsync method - Add ResolvedTunnelId property to DevTunnelResource for region-qualified IDs - Update callers to use ResolvedTunnelId for CLI operations - Keep the Region and RegionCode additions from original PR This preserves the original architecture where options are stored per-resource and passed through method calls, which correctly supports multiple tunnels with different region configurations.
|
@mitchdenny Thank you for looking into that. I forgot there can be many resources of the same type, and as you correctly noticed the singleton option breaks that. Much appreciated! |
|
@afscrome Hi will you be able to assist in applying the correct tags |
|
@aspire/area-integrations |
|
|
||
| var rb = builder.AddResource(tunnelResource) | ||
| .WithArgs("host", tunnelId, "--nologo") | ||
| .WithArgs("host", tunnelResource.ResolvedTunnelId, "--nologo") |
There was a problem hiding this comment.
Just calling out that changing region creates a whole new tunnel as it impacts the ID. If someone first creates a tunnel without a reason, then updates their AppHost to specify a region, the ID of the tunnel changes and as such the previous tunnel is "orphaned" and a new tunnel is created. I don't think this is an issue per se, just calling it out. We might want to add a note to the doc comments on the appropriate methods/properties to clarify that setting/changing a region changes the tunnel ID.
There was a problem hiding this comment.
So if a user omits the region option the dev tunnel CLI will pick a region with the lowest ping. If the user did proceed to add the region option, which happens to be the same region the original dev tunnel was created in, it will successfully connect to it. However if the region is not the same, then as you have stated a new dev tunnel will be created in the target region. The user will always have the option if they want to connect to the original dev tunnel to select the appropriate region.
Co-authored-by: Damian Edwards <damian@damianedwards.com>
Co-authored-by: Damian Edwards <damian@damianedwards.com>
Description
Updated
DevTunnelOptionswith region property. This is used to set the dev tunnel region at creation, and to refer to the correct dev tunnel using the fully qualified tunnel Id. Updated readme for scenario. Please see linked issue for full context.Fixes #14111
Checklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplate