Skip to content

[Devtunnel] Aspire.Hosting.DevTunnels - Add Region option to DevTunnelOptions #14111

@kola-tm

Description

@kola-tm

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

When creating a persistent dev tunnel I have noticed that I am switching between two region uks1 and euw. This means I have 2 dev tunnels created and I believe they are switching based on lowest ping. Running devtunnel clusters --ping returned

Image Image

As you can see the ping from these regions are very close and can swap. This isnt ideal behaviour as I use an existing webhook registered to the devtunnel.

I recently discovered that there is an option to select the service uri when creating a dev tunnel:

devtunnel create "tunnel-id" --service-uri https://uks1.rel.tunnels.api.visualstudio.com

this will always try to create it for uks1.

I have made some changes to the Aspire.Hosting.DevTunnels which allows a user to select what region the dev tunnel will be created in. This ensures the same dev tunnel will be used each time. Also when retrieving an existing dev tunnel the fully qualified tunnel id with region suffix is used.

var options = new DevTunnelOptions
{
    Region = DevTunnelRegion.NorthEurope
};

if omitted the current behaviour remains unchanged

Describe the solution you'd like

Added Region to DevTunnelOptions and use fully qualified tunnel id for dev tunnel changes

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-integrationsIssues pertaining to Aspire Integrations packages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions