Aug. 12, 2026

Speed Up Your Workflow: Why Visual Studio Dev Tunnels Beat Traditional Deployment

Welcome back to the podcast! If you have ever found yourself waiting fifteen minutes for a cloud deployment to finish just to test a single line of code change, you know the absolute drag it puts on your productivity. Today, we are expanding on a topic that has completely transformed how our engineering teams handle local testing, debugging, and integrations. Be sure to check out the related podcast episode, Test Microsoft 365 Apps with Visual Studio Dev Tunnels, where we break down these exact workflows in action.

In this comprehensive guide, we will explore why traditional deployment methods are losing ground to modern tunneling solutions, how Visual Studio Dev Tunnels work under the hood, and how you can seamlessly integrate them into your Microsoft 365, Teams, and ASP.NET Core projects.

Local Testing with Visual Studio Dev Tunnels

Why Local Testing Matters

You want your Microsoft 365 Apps to work perfectly before sharing them with users. Local testing gives you the power to catch bugs early and see how your code behaves in a safe environment. When you test locally, you can make changes quickly and see results right away. This process saves you time and helps you avoid mistakes that might appear in production.

Traditional localhost testing has limits. Your local machine cannot accept connections from the internet. This makes it hard to test features that need real-world access, such as webhooks, authentication flows, or integration with Microsoft 365 services. You might find yourself stuck, unable to simulate how your app will behave for actual users.

Dev Tunnels has revolutionized the way we develop and test web applications, especially for mobile developers who often face challenges in setting up local servers for testing. It’s a game-changing feature that enhances collaboration and simplifies the development process.

With the right tools, you can overcome these challenges. You can create a realistic environment for your app, even when working from your own computer.

How Dev Tunnels Enable Local Testing

You can test Microsoft 365 Apps from localhost using visual studio dev tunnels. This tool gives you a secure way to expose your local services to the internet. You do not need to deploy your code to Azure or any other cloud platform just to see how it works with Microsoft 365.

Visual Studio Dev Tunnels enhance traditional localhost testing by enabling you to securely expose your local applications to the internet. This capability allows for inbound connections, which is essential for testing Microsoft 365 Apps in a more realistic environment, overcoming the limitations of being confined to local testing.

Here is how dev tunnels improve the speed and security of your local testing:

  • Dev tunnels enable local services to act as secure cloud endpoints in under 3 minutes.
  • They facilitate secure internet access for local testing of Microsoft 365 Apps.
  • Proper configuration is crucial to avoid exposing the development environment.

You can set up tunnels with just a few clicks or commands. You choose the name and visibility of your tunnel, so you control who can access your app. You can use authentication to keep your work safe. This flexibility means you can collaborate with teammates or invite testers without sharing your entire computer.

Dev tunnels let you test features like OAuth authentication, Teams bots, or SharePoint web parts as if they were running in the cloud. You get real-time feedback and can debug issues on the spot. This process makes your development cycle faster and more reliable.

When you use dev tunnels, you build confidence in your code before you deploy. You know your app works in the real world, not just on your machine.

Visual Studio Dev Tunnels Overview

Key Features

Visual studio dev tunnels give you a powerful way to test and debug Microsoft 365 Apps from your local machine. You can expose your asp.net core services to the internet with just a few steps. This tool helps you create a secure and flexible development environment.

Here are some of the main features you will find useful:

  • You can expose local APIs using remote URLs, making it easy to test and debug your asp.net core projects.
  • Integration with third-party services becomes simple because you have publicly accessible URLs for your local apps.
  • You can set breakpoints on your localhost and watch how your asp.net core code responds when remote URLs are accessed.
  • Named tunnels help you share specific projects or services without confusion.
  • Persistent tunnels let you keep access over time, which is important for ongoing asp.net core projects.
  • You can choose access levels for your tunnels: private, organizational, or public. This makes it easy to control who can see your work.
  • Entra ID authentication restricts access to users with valid credentials, keeping your data safe.
  • The CLI lets you manage and automate tunnel creation and configuration. You can use commands to create, list, and tag tunnels for easier management.

Tip: Persistent and named tunnels help you avoid recreating tunnels every time you restart your asp.net core project. This saves you time and reduces errors.

How Dev Tunnels Work

Dev tunnels create a secure bridge between your local asp.net core server and the internet. You can test Microsoft 365 Apps as if they were running in a live environment.

Secure Public Endpoints

You start by downloading and installing the devtunnel CLI. After logging in with your Entra ID, Microsoft, or GitHub account, you launch your local asp.net core server. Then, you host or create a tunnel using the devtunnel host –p PORT command. If you want a permanent URL, you use the devtunnel create command for a persistent tunnel.

This process gives you a secure, internet-accessible endpoint for your local asp.net core service. You can now test webhooks, authentication flows, and integrations that require public URLs. Entra ID authentication ensures that only approved users can access your tunnels, lowering the risk of accidental data exposure.

Integration with Visual Studio and CLI

Visual studio makes it easy to create and manage dev tunnels. You can set up a tunnel with just a few clicks inside the IDE. The CLI offers even more options, such as fixed-life tunnels and tagging for better organization. You can automate tunnel creation for your asp.net core projects, making your workflow faster and more reliable.

You can also list all your tunnels, view details, and manage access permissions. This flexibility helps you collaborate with your team and keep your development environment secure.

Note: Dev tunnels are designed to securely expose your local asp.net core endpoints to the internet, making testing and debugging safe and efficient.

Host or Create a Tunnel in Visual Studio

Prerequisites and Setup

Before you host or create a tunnel for Microsoft 365 App testing, you need to prepare your environment. Visual studio gives you the tools you need, but you must meet a few requirements first. The following table shows what you need to get started:

Prerequisite Description
Visual Studio 2022 Preview Download version 17.6 or later. Make sure the ASP.NET and web development workload is installed. Sign in to use dev tunnels.
Power Platform Environment You need either Power Automate or Power Apps.

You should check that you have the correct version of visual studio. Open the installer and confirm that the ASP.NET and web development workload is active. Sign in with your Microsoft account to access the dev tunnels tool window. If you plan to connect your asp.net core project to Power Platform, make sure you have access to Power Automate or Power Apps.

Tip: Keeping your tools updated helps you avoid setup issues and ensures you can use the latest features in the dev tunnels tool window.

Creating and Naming a Tunnel

You can create a tunnel directly from the dev tunnels tool window in visual studio. This process lets you expose your asp.net core service to the internet for Microsoft 365 App testing. Follow these steps to create and name your tunnel:

  1. In the debug dropdown, select Dev Tunnels > Create A Tunnel.
  2. The dev tunnels tool window opens a dialog. Choose the account you want to use.
  3. Enter a name for your tunnel. This name helps you identify it in the dev tunnels tool window.
  4. Pick the tunnel type. Select Persistent if you want the same URL every time, or Temporary for a new URL each session.
  5. Choose the authentication type: Private, Organization, or Public.
  6. Click OK to create the tunnel.

When you create a tunnel, you make it easier to connect your asp.net core project to Microsoft 365 services. The dev tunnels tool window keeps your tunnels organized and visible. You can always find your active tunnels and manage them from this window.

Note: Naming your tunnel helps you and your team track which asp.net core service is exposed. Use clear names for each tunnel in the dev tunnels tool window.

Setting Tunnel Visibility

Tunnel visibility controls who can access your dev tunnels. You set this option in the dev tunnels tool window when you create a tunnel. The right visibility level protects your work and supports collaboration.

Here are the main visibility options:

Visibility Option Description
Private Only you can access the tunnel.
Organization Anyone in your organization can access the tunnel. For personal accounts, this is the same as Private.
Public Anyone on the internet can access the tunnel. Use this option with caution.

You can also see these options as:

  • Private: Only you can use the tunnel.
  • Organization: Your team or company can use the tunnel.
  • Public: Anyone can use the tunnel.

The dev tunnels tool window lets you change visibility when you create and manage dev tunnels. Choosing the right visibility helps you monitor traffic and keep your Microsoft 365 App secure. Private tunnels work best for solo development. Organization tunnels help teams test together. Public tunnels allow outside testers but require extra care.

Caution: Public tunnels do not require authentication. Use them only when you need to share your app with users outside your organization and always monitor access in the dev tunnels tool window.

Tunnel visibility affects both security and collaboration. When you set the right level, you make sure only the right people can access your app. This reduces risk and helps your team work together smoothly.

Using the Dev Tunnels CLI

You can manage dev tunnels directly from the command line by using the Dev Tunnels CLI. This tool gives you flexibility and speed, especially when you want to automate your workflow or work outside the visual studio interface. The CLI works well for both quick tests and more advanced setups.

To get started, you need to install the Dev Tunnels CLI. You can do this by running the following command in your terminal:

dotnet tool install -g Microsoft.DevTunnels.Cli

After installation, you must sign in. Use your Microsoft account, Entra ID, or GitHub account. This step connects your CLI session to your visual studio environment and ensures secure access.

devtunnel login

Once you sign in, you can create and manage tunnels. Here is a simple way to create a tunnel for your local project:

devtunnel host -p 5000

This command exposes your local service running on port 5000 to the internet. The CLI will display a public URL that you can use to test your Microsoft 365 App. You can share this URL with your team or use it for integration testing.

If you want a persistent tunnel with a custom name, use:

devtunnel create my-tunnel --persistent
devtunnel host my-tunnel -p 5000

This approach helps you keep the same URL across sessions, which is important for OAuth redirect URIs and consistent testing. You can also set tunnel visibility directly from the CLI. For example, to make your tunnel accessible only to your organization, add the --access organization flag:

devtunnel create my-tunnel --persistent --access organization

Tip: Use clear and descriptive names for your tunnels. This makes it easier to manage multiple projects in visual studio and avoid confusion.

You can list all your active tunnels at any time:

devtunnel list

To stop a tunnel, use:

devtunnel close my-tunnel

The CLI also lets you automate tunnel creation in scripts. This feature is useful when you want to set up dev tunnels as part of your build or deployment process. You can share CLI commands with your team so everyone uses the same configuration, which improves consistency and reduces errors.

Note: The Dev Tunnels CLI works seamlessly with visual studio. You can switch between the CLI and the visual studio interface without losing your tunnel settings.

By mastering the Dev Tunnels CLI, you gain more control over your development environment. You can quickly create, manage, and secure tunnels for any Microsoft 365 App project. This flexibility helps you test and debug your apps efficiently, whether you work alone or as part of a team.

Configure Microsoft 365 Apps for Dev Tunnels

Configure Microsoft 365 Apps for Dev Tunnels

Update App Registration and Redirect URIs

You need to update your app registration and redirect URIs to connect your local asp.net core project to Microsoft 365 services through visual studio. This process helps your app use the secure endpoint provided by dev tunnels. Here is a simple way to set up your app registration:

  1. Open the Microsoft Entra ID – App Registrations portal.
  2. Select "New Registration" and enter your app name.
  3. Choose the supported account types for your app.
  4. Leave the Redirect URI field empty for now.
  5. Click "Register" to create your app.
  6. On the overview page, copy the Application (client) ID and Directory (tenant) ID.
  7. Under "Manage," select "Expose an API."
  8. Click the "Set" link to generate the Application ID URI.
  9. Add a scope named "access_as_user."
  10. Set "Who can consent?" to "Admins and users."
  11. Fill in the admin and user consent prompts.
  12. Make sure the state is set to "Enabled."
  13. Select "Add scope" to finish.

After you create your tunnel in visual studio, you need to update the Redirect URI in your app registration. Use the public URL from your asp.net core tunnel as the Redirect URI. This step lets Microsoft 365 know where to send authentication responses during testing.

Tip: Always save your client ID and tenant ID. You will need them for authentication and OAuth setup.

Connect Teams, SharePoint, and Power Platform Apps

You can use visual studio to connect your asp.net core services to Teams, SharePoint, and Power Platform Apps. Dev tunnels make this process secure and simple. When you use tunnels, you get alerts if you connect to a tunnel endpoint. These alerts help you avoid phishing attacks and accidental sharing of sensitive URLs.

  • Teams bots and message extensions use dev tunnels by default for local development. This setup gives you a secure way to test features before you deploy them.
  • SharePoint web parts and Power Platform connectors also benefit from secure endpoints. You can test webhooks, authentication, and data flows in a real-world scenario.
  • Microsoft 365 identity authentication adds another layer of security. You must sign in with your Microsoft 365 account to create and manage tunnels in visual studio.

Note: Enhanced security awareness helps you and your team stay safe while testing your asp.net core apps.

Handle Authentication and OAuth

You must configure authentication and OAuth to let your Microsoft 365 Apps work with dev tunnels. Here is a step-by-step guide:

  1. Register your app in the Microsoft Entra ID portal.
  2. Set your application URI to match the tunnel endpoint from visual studio.
  3. Create a client secret for token exchange.
  4. Add API permissions for Microsoft Graph access.
  5. Update the Redirect URIs to use your asp.net core tunnel URL.
  6. Set up dev tunnels for hosting your local service.
  7. Clone your project repository and update the configuration files with your client ID, tenant ID, and secret.
  8. Open visual studio and run your asp.net core project.

This setup allows your app to handle sign-in, token exchange, and API calls securely. You can test authentication flows, such as OAuth, in a safe environment before moving to production.

Always double-check your Redirect URIs and permissions. This step prevents common authentication errors and keeps your testing secure.

Security and Best Practices

Tunnel Visibility Options

You control who can access your development environment by setting tunnel visibility. When you create a tunnel, you choose between private, organizational, or public access. Private tunnels allow only you to connect. Organizational tunnels let anyone in your company use the tunnel. Public tunnels open access to anyone with the link. Always pick the lowest visibility needed for your project.

To maximize security during Microsoft 365 App testing, follow these best practices:

  • Set tunnels to private or organizational whenever possible.
  • Implement split tunneling for Office 365 applications. This method improves performance and keeps your data secure.
  • Use Microsoft-provided IP address ranges for split tunneling. Avoid using fully qualified domain names.
  • Disable SSL interception for Office 365 traffic. This step helps you comply with Microsoft’s security recommendations.
  • Confirm your split tunneling policy works by using the Microsoft 365 connectivity test tool.
  • Turn off SSL Break and Inspect for Office 365 domains.

Tip: Review your tunnel visibility settings before sharing any URLs. This habit helps prevent accidental exposure of your development environment.

Secure Access with Entra ID

You can secure your tunnels by requiring authentication with Entra ID. This feature ensures that only approved users can access your local services. When you enable Entra ID authentication, you add a strong layer of protection to your dev tunnels. Only users with valid credentials can connect, which helps keep your data safe.

Entra ID also supports organizational access. You can allow your whole team to test and debug apps without opening your tunnel to the public. This approach balances security and collaboration. Always use Entra ID authentication for sensitive projects or when handling confidential information.

Note: Entra ID authentication works seamlessly with both the Visual Studio interface and the command-line tools.

Monitoring and Managing Tunnels

You need to monitor and manage your tunnels to maintain a secure and efficient workflow. Visual Studio provides built-in features for managing dev tunnels. You can view active tunnels, check their status, and adjust access settings from within the IDE. The command-line interface also lets you create, list, and close tunnels quickly.

Best practices for managing tunnels include:

  • Regularly review your list of active tunnels.
  • Close tunnels when you finish testing to reduce security risks.
  • Use descriptive names for each tunnel to avoid confusion.
  • Choose between temporary or permanent tunnels based on your project needs.
  • Set access controls to match your security requirements.

A table can help you compare tunnel management options:

Management Tool Features
Visual Studio IDE View, create, edit, and close tunnels
Command-Line (CLI) Automate tunnel creation and management

Remember: Good tunnel management keeps your development environment organized and secure.

Common Pitfalls to Avoid

When you use Visual Studio Dev Tunnels for Microsoft 365 App testing, you want to avoid mistakes that can slow you down or put your project at risk. Many developers run into the same issues. If you know what to watch for, you can save time and keep your environment secure.

1. Choosing the Wrong Tunnel Visibility

You might pick a public tunnel for convenience. This choice can expose your app to anyone with the link. Always check your tunnel’s visibility before you start testing. Use private or organization tunnels for most projects. Only use public tunnels when you need outside testers and always monitor access.

Tip: Review your tunnel settings before sharing URLs with your team or testers.

2. Forgetting to Update Redirect URIs

If you change your tunnel URL, you must update the redirect URIs in your app registration. If you skip this step, authentication will fail. Always double-check that your app registration matches your current tunnel endpoint.

3. Ignoring Authentication Settings

You may forget to enable Entra ID authentication for your tunnel. Without this, anyone can access your local service if they have the link. Always require authentication for sensitive projects. This step protects your data and your users.

4. Leaving Tunnels Open After Testing

If you leave tunnels running after you finish, you increase your security risk. Unused tunnels can become targets for unwanted access. Always close tunnels when you no longer need them.

5. Using Generic or Confusing Tunnel Names

If you use unclear names for your tunnels, you and your team may get confused. Use descriptive names that match your project or service. This habit helps you manage multiple tunnels and avoid mistakes.

6. Overlooking Log Monitoring

You might not check your tunnel logs. Logs help you spot unusual activity or unauthorized access. Make it a habit to review logs regularly.

Pitfall How to Avoid It
Public tunnel for private app Set tunnel to private or organization
Outdated redirect URI Update app registration after tunnel changes
No authentication Enable Entra ID authentication
Unclosed tunnels Close tunnels after testing
Vague tunnel names Use clear, descriptive names
Ignoring logs Monitor logs for suspicious activity

Note: You can prevent most issues by following a checklist before and after each testing session.

By staying alert to these common pitfalls, you keep your development process smooth and your Microsoft 365 Apps secure. You build better habits and help your team avoid unnecessary problems.

Troubleshooting and Advanced Tips

Debugging Connection Issues

You may sometimes face connection problems when working with tunnels. Start by checking if your local service is running and listening on the correct port. Use the command line to confirm that your service responds to requests. If you see errors, restart your service and try again.

Next, check your firewall settings. Firewalls can block incoming connections. Allow traffic on the port you use for your tunnel. If you use a VPN, disconnect it and test again. VPNs can change your network settings and cause issues.

If you still have trouble, use the devtunnel list command to see all active tunnels. Make sure you use the correct tunnel URL in your Microsoft 365 App. Sometimes, copying the wrong URL causes connection failures.

Tip: Always test your tunnel URL in a browser before starting testing and debugging. This step helps you catch simple mistakes early.

Handling Authentication Errors

Authentication errors can stop your app from working with Microsoft 365 services. First, check your app registration in the Microsoft Entra ID portal. Make sure your redirect URIs match the tunnel URL exactly. Even a small typo can cause failures.

Review your client ID and secret. These values must match what you set in your app’s configuration. If you change your tunnel or create a new one, update the redirect URIs in your app registration.

If you see an "unauthorized" message, check your tunnel’s visibility and authentication settings. For sensitive projects, always use Entra ID authentication. This step keeps your data safe and prevents unwanted access.

Note: Most authentication errors come from mismatched URLs or missing permissions. Double-check these settings during debugging.

Advanced CLI and Automation

You can use the Dev Tunnels CLI to automate your workflow. Automation saves time and reduces mistakes. For example, you can write a script to create a tunnel, start your local service, and open the test page in your browser.

Here is a sample script for Windows PowerShell:

devtunnel create my-automation-tunnel --persistent --access organization
devtunnel host my-automation-tunnel -p 5000
Start-Process "https://my-automation-tunnel.devtunnels.ms"

You can share scripts like this with your team. Everyone can use the same setup for testing and debugging. This approach helps you work together and avoid configuration errors.

If you want to close all tunnels at once, use:

devtunnel close --all

Automating tunnel management makes your development process smoother and more reliable. Try using scripts for repeated tasks.


You can boost your Microsoft 365 App development by using visual studio dev tunnels. This tool makes testing faster and more secure. Start by setting up your first tunnel and follow best practices for visibility and authentication. Explore advanced features to improve your workflow. Remember to focus on security and teamwork as you continue testing and building better apps.

Visual Studio Dev Tunnels Checklist

Quick checklist to configure, use, and troubleshoot Visual Studio Dev Tunnels.

Conclusion

In summary, leveraging Visual Studio Dev Tunnels instead of traditional cloud deployments allows developers to drastically accelerate feedback loops, minimize cloud infrastructure costs, and debug locally with full fidelity. Whether you are building web hooks, Teams apps, or modern APIs, this built-in feature eliminates friction. For a deeper dive into these concepts and a live walkthrough, make sure to listen to our associated episode, Test Microsoft 365 Apps with Visual Studio Dev Tunnels.