Building Securely, Developing Swiftly: Dev Tunnels Updates
Published Dec 05 2023 06:00 AM 1,790 Views
Microsoft

Dev Tunnels is a tunneling service that can enhance your productivity when testing and debugging web apps, webhooks, APIs, and more. You can also simply use Dev Tunnels to share your work with colleagues, demo at conferences, or test your app on other devices. It takes seconds to get started, regardless of if you use Dev Tunnels through Visual Studio, VS Code, or the devtunnel CLI.

 

Today, we have some exciting updates to share with you! Even if you’re new to Dev Tunnels, stick around to discover the latest. If you want to know about the benefits of Dev Tunnels and how to get started though, check out this blog post.

 

Port forwarding in Visual Studio Code

Previously, Dev Tunnels was only available through Visual Studio and the devtunnel CLI. We’re thrilled to share Dev Tunnels is now seamlessly integrated into Visual Studio Code – no extensions required! To get started, you will need to have a service to forward. Then, navigate to the Ports view in the Panel region (Ports: Focus on Ports View) and select Forward a port. Check out their documentation for more detailed instructions.

carolinauribe_6-1701720851149.png

 

Visual Studio Code Dev Containers + Remote-Tunnels

You can now use the Visual Studio Code together! This is helpful if you’d like to leverage the reproducibility of Dev Containers while developing in a remote environment. More information on how to get started can be found here.

 

Custom tunnel expiration

The default expiration is after 30 days of no activity. You can now set a custom expiration by using the --expiration flag in the create, host, or update command. Minimum that you can set is 1 hour (1h) and the maximum you can set is 30 days (30d). The custom expiration you set is after a period of inactivity, just like the default expiration. This means it isn't a fixed expiration time, but instead a sliding window that is automatically pushed out by any new activity. This is particularly helpful for developers creating anonymous tunnels that only need to be publicly accessible for a short period of time. See examples here.

carolinauribe_7-1701720907323.png

 

Time-limited anonymous access

You can now set time-limited anonymous access to your tunnel. This is helpful if you want to share a tunnel only for a limited amount of time, but you want to keep the tunnel after as a private tunnel. To give it a try, you will need to create a tunnel by running devtunnel create. After this, you’ll see the tunnel ID in the output, which you’ll use to set time-limited anonymous access on that tunnel by running the following command:

 

devtunnel access create TUNNELID -a --expiration 2h

 

This command is creating an anonymous access control entry (indicated by the -a) for 2 hours (indicated by --expiration or -e). The minimum is 1 hour (1h) and the maximum is 30 days (30d), like custom tunnel expiration. Once the access control expires, it is removed from the tunnel. If an access control is set to expire after the tunnel expires, the tunnel expiration takes precedence. Note, once you set the expiration for an access control you cannot modify it, unless you entirely reset your access controls on the tunnel. Additionally, this expiration is on a fixed window, so it checks the access control expiration against the time it was created. See examples here.

carolinauribe_8-1701721107353.png

 

Install and update the devtunnel CLI with winget and homebrew

 

Winget

You can now use winget, Microsoft’s package manager for Windows, to install and update the devtunnel CLI on Windows.

 

winget install Microsoft.devtunnnel

 

This command installs the latest version by default and removes the older version in the same location, which is %LOCALAPPDATA%\Microsoft\WinGet\Packages. To specify a version, add  --version <version_number> with your desired version to the command.

 

winget upgrade Microsoft.devtunnel

 

Homebrew

You can also now use homebrew, to install and update the devtunnel CLI on MacOS.

 

brew install --cask devtunnel
brew uninstall --cask devtunnel
brew upgrade --cask devtunnel

 

 

Windows Group Policy for Dev Tunnels in Visual Studio

Administrators can now disable Dev Tunnels in Visual Studio using Windows Group Policy. More information on how to enable this policy can be found here. If your organization requires specific policies or additional enterprise management capabilities, please let us know by opening or up-voting existing issues, such as this one to control authentication methods on our GitHub repo.

carolinauribe_9-1701721247440.png

 

Tunnel ID changes

You can now specify a tunnel ID when creating a tunnel. For example, devtunnel create mytunnelid is now a valid command. If you do not specify an ID, then one will be automatically generated for you. Please note, this ID is solely for tunnel identification and won’t appear in the tunnel URL. You will need to provide the ID for all operations that refer to a tunnel.

 

carolinauribe_10-1701721264957.png

 

Wrapping up

We appreciate the time you’ve spent reporting issues/suggestions and hope you continue to give us feedback when using dev tunnels on what you like and what we can improve. Your feedback is critical to help us make dev tunnels the best tool it can be! You can share feedback with us on our GitHub repo here.

 

Happy tunneling!

Co-Authors
Version history
Last update:
‎Dec 04 2023 12:38 PM
Updated by: