Introducing Tunnel Relay
Published Jan 29 2018 12:23 PM 10.3K Views
Microsoft

As you get your hands into developing Messaging Extensions and Bots for Microsoft Teams (read announcement here), you will find yourself wishing for an easy way to have your Bot Framework bot registration point to a static callback URL that routes to code running on your local dev machine.  

 

Well, we have a solution for you and it is called Tunnel Relay. Tunnel Relay allows you to expose local services to the outside work over HTTPS using Azure Service Bus Relay. BotDevelopementTR.png

 

To use it, just download the setup from here and sign-in, copy the incoming requests URL (shown below), and paste into Bot Framework portal's page for your bot’s registration. And that's it, you are good to go!

 

So, copy the URL circled below:MainWindow.png
And paste it into Bot Framework portal, after appending /api/messages (or whatever the relative URL to your controller is):

CallBackURL.jpg

 

 

Tunnel Relay is open-source and is my side-project in Microsoft Teams team (oh btw, we are hiring!). Your code contributions are welcome, and so are bug reports (report here). 

 

Download Tunnel Relay 

 

 

11 Comments
Deleted
Not applicable

Will there be a Mac Version as well?

Microsoft

Tunnel Relay is built on top of Azure Relay which require WCF to run. Since WCF is a Windows only offering Mac and Linux are not supported yet. We are working with Azure Relay team to see potential way of supporting Tunnel Relay on non-Windows OSes.

MVP

I gotta say this is pretty awesome! I second the support for Mac version as well - maybe a CLI-like interface that Ngrok or others have without the UI built on top of .NET Core?

Microsoft

I am currently investigating approaches that will allow port to non-Windows platforms. No timeline yet, but hopefully I will have something for you :).

MVP

Just did a quick digging - there are some samples with the Hybrid Connections built on .NET Core 2.0 acting as a reverse proxy - https://github.com/Azure/azure-relay/tree/fd942a434b0a6ec497de552aa054c53e753fa85c/samples/hybrid-co... - just tried it out and works pretty nice.

Microsoft

Yeah the HTTP support for HybridConnections was recently announced and that overcomes the limitation of Azure Relay which was using WCF behind the scenes. Although this means that I have to rewrite a significant amount of the code to remove the dependency on both WCF and WPF. I am working on some ways to do that, so that existing users can upgrade without any changes to configuration and at the same time make it so, that the newer bits works on all OSes.

I think for Mac a valid option is ngrok at the moment

Great solution Ramjot,

For now I'm still using Ngrok but I'll definitely give it a try.

BTW, more than a CLI interface, Ngrok has a NPM package for node solutions that enables me to configure and launch Ngrok right from my Node app, which is very convenient, because I can configure it dynamically depending on the context, environment...

Regards,

Hi!  I'm hoping to use this at least as a short term workaround as a way to sideload a bot into teams for which we can't have a public url.  Question: is there a way to start TunnelRelay automatically with exported settings?  So that I could deploy it as part of a service, and it would automatically start and be listening/redirecting?

Microsoft

TunnelRelay does not allow importing of settings directly. That being said though the change should be relatively simple and you should be able to do it. I am out of city for some time and thus can't take this right now. I however have replied on the GitHub question https://github.com/OfficeDev/microsoft-teams-tunnelrelay/issues/13 as to how to build it. Should not take too long. If you are not able to pick this up then I can take care of it once I am back.

Thanks!  I'll give it a shot, hopefully starting later today or tomorrow.

Version history
Last update:
‎Jan 26 2021 02:16 PM
Updated by: