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
- Integrating with external services and webhook
- 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
- 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
- After filling info click on ok button
Comments
Post a Comment