Dev tunnels

            




Dev tunnels allow you to securely expose local web services to the internet, creating a public URL that tunnels traffic directly to your development machine. This is useful for testing, collaboration, and integration with external services

Uses of dev tunnel in daily development

  • Debugging and testing on different devices
Dev tunnels eliminate the need for complex network configurations when you need to test your application on a separate device. You can access your local server from a mobile phone, tablet, or another computer by simply navigating to the tunnel's public URL. 

  • Integrating with external services and webhook
 Many third-party services, like payment gateways, social media APIs, and communication platforms (e.g., Twilio), rely on webhooks to send real-time notifications to your application. 

  • Since webhooks cannot send requests to localhost, you need a public URL to receive them.

 A dev tunnel provides a secure, public endpoint that forwards these webhook calls to your local server, allowing you to test and debug the integration without deploying your code. 

  • Sharing work in progress

 Dev tunnels make it easy to demonstrate your application to teammates or clients without the hassle  of deployment. Instead of setting up a temporary hosting environment, you can simply share the tunnel URL, giving them a live preview of your work. 

  • Streamlining remote development

 For distributed teams, dev tunnels simplify the process of collaborating on projects and debugging issues. It allows remote team members to access and debug an application running on a colleague's machine as if it were running locally. 

  • Simplifying microservice development

 When building microservice-based applications, different services may need to communicate with each other. If you have a local service that needs to interact with another service running remotely (e.g., in a cloud environment), a dev tunnel provides the public endpoint needed for that connection. 

Types

    You can create both temporary and persistent dev tunnels. 

  • Temporary tunnels are ideal for short-term tasks like a quick test. They are created on-demand, get a new URL each time they are hosted, and are deleted when the process ends.
  • Persistent tunnels are useful when you need a stable URL for ongoing testing and integration. They retain the same URL across multiple sessions and are configured for a longer lifespan. 

Access Control

      For security, dev tunnels offer different levels of access control to prevent unauthorized access to your local environment. 

  • Private: The tunnel is only accessible to the account that created it.
  • Organizational: Access is limited to accounts within the same organization (e.g., Microsoft Entra ID).
  • Public: The tunnel is accessible to anyone with the URL, and no authentication is required. 

How to create devt tunnel and use

  • Open Visual Studio 
  • Open Dev Tunnel Window : Two ways to open dev tunnel window
           1. View Menu >>  Other Window >> Dev Tunnel

                                                      

            2. Dropdown beside run button >> Dev Tunnels >> Show Dev Tunnels Window
   


  • Dev Tunnel window popup will open

  • Click on "+" icon to create new Dev Tunnel
  • Select Account from which you want to create tunnel
  • Enter tunnel name and select Tunnel Type
  • Select Access which was very on the basis of your account type (If you are using organization account than it will show organization option)
  • After filling info click on ok button 

  • Dev Tunnel is create now you can run the project and check.

  • Click on Continue.
  • Just copy and give the URL and you can check its working with your development code.

Comments

Popular posts from this blog

Creating an executable installer (.exe) in Visual Studio

Create installable exe file from windows form application in visual studio