Debug Microsoft Teams apps without ngrok | Tips & Tricks

Microsoft 365 Developer · Intermediate ·📰 AI News & Updates ·5y ago

Key Takeaways

The video demonstrates how to debug Microsoft Teams apps without using ngrok, by setting up a local hostname and enabling HTTPS with a trusted certificate. It covers the process of configuring Azure Active Directory single sign-on locally without an internet tunnel.

Full Transcript

hi i'm bob german cloud advocate at microsoft and i'm here to share tips and tricks on developing applications for microsoft teams today i'm going to show you how to set up for local debugging without the use of an internet tunnel of your team's tabs task modules or configuration pages this video is a companion to another one what is ngrok and do i need it to build teams applications and i'll have a link to that at the end of this video if you're watching this one will assume that you're building a tab a task module or a configuration page for microsoft teams and that you've chosen to work locally without the use of ngrok now you may have noticed that ngrok is listed as a prerequisite in a lot of teams development documentation and tutorials indeed it is the darling of teams developers but it's not strictly a prerequisite it provides a tunnel so that requests from the internet can get into your local computer to do things like deliver messages from bots it also provides https support with a trusted certificate and this is required by teams and a dns name and it makes mobile device testing easier because your app is literally live on the internet when you're using ngrok which is also a little scary to some it departments which is why you might not really be able to use it in the case of tabs well the connections to your local web server come from the local teams client or browser so even if you use ngrok you're actually just looping back outside to the internet and right back into your local computer so the tunnel isn't really necessary now adding azure active directory single sign-on doesn't really change that it means that your local web server needs to also host a web service but it's called from the local teams client so you really don't need any incoming connection for tabs task modules or configuration pages what you need is the https support and a dns like name because azure ad single sign-on won't work with just plain localhost it also won't work with azurewebsites.net you need some other dns name that you can register into azure ad and those are the things that you really need so let me show you how to set up azure ads single sign-on locally with no internet tunnel my example uses a react application that was generated by the teams toolkit so your exact tools and process may vary a little bit from this depending on the tools you're using what operating system etc so the first step is to set up a local host name for your application since this uses azure active directory single sign-on azure won't allow you to use localhost for that particular case and also you can't use azurewebsites.net incidentally so you need some kind of a custom name so i'm just going into my etc hosts file and adding this entry to 127.0.0.1 which is the loopback network address so it's just going to loop back it's not going to go out over the internet you could get fancier with this and and put this into your router's dns maybe open your local firewall maybe use your actual local ip address to set up for mobile device testing and other cross-device scenarios but for now i'm just going to make 127.0.0.1 i'm going to give it this name dev apps for teams so now i have two web servers running and that's because i'm using the teams toolkit generator which actually generates two applications in the case of sso it generates one web server on port 3000 for the tab web page and another one on port 5000 for the token exchange web service so this makes life a little bit more complicated because we actually have to terminate both of these ssl connections and we're going to have to have a cross-origin call so let's take a look at that to start i'm just going to go to my local address or my new local name dev apps for teams dot local column 3000 and verify that i have a trusted ssl connection and you can see here that indeed this is secure and this is step two is to enable https with a trusted certificate see it says it's valid issued by a trusted authority now there's an accompanying article that will lead you through this set up step by step it's different for each operating system but you can generate your own certificate and then tell your system to trust it and that's the approach here and you can see that that is set up and working here okay so that's step two let's just take a look at how that gets used by our web server our local web server um the react one that's the main web page it's pretty simple i've taken the certificate and the key that were generated again the article has the step by step and i've added them to my project along with some environment variables to tell create react app where the files are and it takes care of all the details as it turns out the other server a little api server is not quite as smart it's just using plain old express so i can point to the certificate but i'm also going to have to modify the code a little bit and you can see here that i'm adding a course policy so that the cross origin call from a web page hosted on port 3000 can access the service on port 5000 and then i'm also going to have to turn on https using this code that reads the certificates and then uses them to create the web server it's not a huge deal you can steal my code right off the screen but those are the setup steps to get that trusted https connection so the remaining steps are the same as they would be for any azure ad sso project so you can follow whatever tutorial you want you're just going to use the local address instead of the ngrok address so this is the next step then is to use the local hostname and port in your app registration so here is the app registration you'll see here is dev apps for teams dot local column 3000 doesn't have any trouble with the colon 3000 here it is in the exposed api and you can also see it in the redirect url the final step is to set up the team's app manifest again we're just going to use the local hostname and port instead of an ngrok hostname so you can see it here you can also see it if we go into the tab itself the url of our personal tab you'll see that it's also using dev apps for teams colon dot local column 3000 and then in the domains and permissions section if we go over there you'll see that yep it's actually those same local host names that are that are set up there so let's test it out i'll go ahead and install this for myself and if you see the picture that means that it's authenticated with azure id sso and pulled my picture from the microsoft graph and it worked ta-da for more on this topic please check out the video what is ngrok and do i really need it for teams development that's at aka dot ms slash ngrok dash video and there are also a couple of articles aka dot ms slash ngrok article has the general ngrok article that matches the other video and then for the step by step that shows how to set up this article including generating those trusted https certificates you can go to aka dot ms slash tabs dash without dash ngrock-article thanks for watching don't forget to like this video and subscribe to this channel for more microsoft 365 developer video

Original Description

If you're building a Teams tab, task module, or configuration page, you don't really need a tunneling tool. This video explains how to set yourself up for local debugging of a Teams app without any Internet tunnels. Learn more: https://aka.ms/tabs-without-ngrok-article
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Microsoft 365 Developer · Microsoft 365 Developer · 0 of 60

← Previous Next →
1 Adaptive Cards community call-February 2019
Adaptive Cards community call-February 2019
Microsoft 365 Developer
2 PowerApps community call-February 2019
PowerApps community call-February 2019
Microsoft 365 Developer
3 Microsoft Graph community call-March 2019
Microsoft Graph community call-March 2019
Microsoft 365 Developer
4 Office Add ins community call-March 2019
Office Add ins community call-March 2019
Microsoft 365 Developer
5 PowerApps community call-March 2019
PowerApps community call-March 2019
Microsoft 365 Developer
6 Microsoft Teams community call-March 2019
Microsoft Teams community call-March 2019
Microsoft 365 Developer
7 Using React and Office UI Fabric React Components
Using React and Office UI Fabric React Components
Microsoft 365 Developer
8 Build Microsoft Teams customization using SharePoint Framework
Build Microsoft Teams customization using SharePoint Framework
Microsoft 365 Developer
9 Microsoft Graph community call-April 2019
Microsoft Graph community call-April 2019
Microsoft 365 Developer
10 Using Change Notifications and Track Changes with Microsoft Graph
Using Change Notifications and Track Changes with Microsoft Graph
Microsoft 365 Developer
11 Office Add Ins community call-April 2019
Office Add Ins community call-April 2019
Microsoft 365 Developer
12 Adaptive Cards community call-April 2019
Adaptive Cards community call-April 2019
Microsoft 365 Developer
13 Microsoft Teams community call-April 2019
Microsoft Teams community call-April 2019
Microsoft 365 Developer
14 Getting Started with Microsoft Graph and Application Registration
Getting Started with Microsoft Graph and Application Registration
Microsoft 365 Developer
15 Getting Started with Microsoft Graph and the Directory API
Getting Started with Microsoft Graph and the Directory API
Microsoft 365 Developer
16 Getting Started with Microsoft Graph and Microsoft Teams
Getting Started with Microsoft Graph and Microsoft Teams
Microsoft 365 Developer
17 Getting Started with Microsoft Graph Explorer
Getting Started with Microsoft Graph Explorer
Microsoft 365 Developer
18 Getting Started with Microsoft Graph
Getting Started with Microsoft Graph
Microsoft 365 Developer
19 Getting Started with Microsoft Graph and Mail API
Getting Started with Microsoft Graph and Mail API
Microsoft 365 Developer
20 Getting Started with Microsoft Graph and Office 365 Groups
Getting Started with Microsoft Graph and Office 365 Groups
Microsoft 365 Developer
21 Getting Started with Microsoft Graph and the Calendar API
Getting Started with Microsoft Graph and the Calendar API
Microsoft 365 Developer
22 Getting Started with the Microsoft Graph Toolkit
Getting Started with the Microsoft Graph Toolkit
Microsoft 365 Developer
23 Getting Started with Microsoft Graph and JavaScript SDKs
Getting Started with Microsoft Graph and JavaScript SDKs
Microsoft 365 Developer
24 Getting Started with Microsoft Graph and .NET SDKs
Getting Started with Microsoft Graph and .NET SDKs
Microsoft 365 Developer
25 Discover how businesses can be more productive with Microsoft 365 integrations
Discover how businesses can be more productive with Microsoft 365 integrations
Microsoft 365 Developer
26 Adaptive Cards community call-May 2019
Adaptive Cards community call-May 2019
Microsoft 365 Developer
27 Office Add-ins community call-May 2019
Office Add-ins community call-May 2019
Microsoft 365 Developer
28 Why We Built on Microsoft Teams
Why We Built on Microsoft Teams
Microsoft 365 Developer
29 Microsoft Teams community call-May 2019
Microsoft Teams community call-May 2019
Microsoft 365 Developer
30 Microsoft Graph community call-June 2019
Microsoft Graph community call-June 2019
Microsoft 365 Developer
31 Build Angular SPA's with Microsoft Graph - June 2019
Build Angular SPA's with Microsoft Graph - June 2019
Microsoft 365 Developer
32 Office Add -ins community call-June 2019
Office Add -ins community call-June 2019
Microsoft 365 Developer
33 Build Android native apps with the Microsoft Graph Android SDK - June 2019
Build Android native apps with the Microsoft Graph Android SDK - June 2019
Microsoft 365 Developer
34 Build MVC apps with Microsoft Graph - June 2019
Build MVC apps with Microsoft Graph - June 2019
Microsoft 365 Developer
35 Authenticate and connect with Microsoft Graph - June 2019
Authenticate and connect with Microsoft Graph - June 2019
Microsoft 365 Developer
36 Microsoft Graph data connect - June 2019
Microsoft Graph data connect - June 2019
Microsoft 365 Developer
37 Change notifications with Microsoft Graph - June 2019
Change notifications with Microsoft Graph - June 2019
Microsoft 365 Developer
38 Build iOS native apps with the Microsoft Graph REST API - June 2019
Build iOS native apps with the Microsoft Graph REST API - June 2019
Microsoft 365 Developer
39 Build Node.js Express apps with Microsoft Graph - June 2019
Build Node.js Express apps with Microsoft Graph - June 2019
Microsoft 365 Developer
40 Smart UI with Microsoft Graph - June 2019
Smart UI with Microsoft Graph - June 2019
Microsoft 365 Developer
41 Leveraging the Microsoft Graph API from the SharePoint Framework - June 2019
Leveraging the Microsoft Graph API from the SharePoint Framework - June 2019
Microsoft 365 Developer
42 Build UWP apps with Microsoft Graph - June 2019
Build UWP apps with Microsoft Graph - June 2019
Microsoft 365 Developer
43 Build React SPA's with Microsoft Graph - June 2019
Build React SPA's with Microsoft Graph - June 2019
Microsoft 365 Developer
44 Getting Started with Microsoft Graph and Batching
Getting Started with Microsoft Graph and Batching
Microsoft 365 Developer
45 Getting Started with Microsoft Graph and Change Notifications
Getting Started with Microsoft Graph and Change Notifications
Microsoft 365 Developer
46 Getting Started with Microsoft Graph and Consent Permissions
Getting Started with Microsoft Graph and Consent Permissions
Microsoft 365 Developer
47 Getting Started with Microsoft Graph and Education
Getting Started with Microsoft Graph and Education
Microsoft 365 Developer
48 Getting Started with Microsoft Graph and Financials
Getting Started with Microsoft Graph and Financials
Microsoft 365 Developer
49 Getting Started with Microsoft Graph and Excel
Getting Started with Microsoft Graph and Excel
Microsoft 365 Developer
50 Getting Started with Microsoft Graph and Data Connect
Getting Started with Microsoft Graph and Data Connect
Microsoft 365 Developer
51 Getting Started with Microsoft Graph and Intune
Getting Started with Microsoft Graph and Intune
Microsoft 365 Developer
52 Getting Started with Microsoft Graph and Notifications
Getting Started with Microsoft Graph and Notifications
Microsoft 365 Developer
53 Getting Started with Microsoft Graph and OneNote
Getting Started with Microsoft Graph and OneNote
Microsoft 365 Developer
54 Getting Started with Microsoft Graph and OneDrive
Getting Started with Microsoft Graph and OneDrive
Microsoft 365 Developer
55 Getting Started with Microsoft Graph and Open Extensions
Getting Started with Microsoft Graph and Open Extensions
Microsoft 365 Developer
56 Getting Started with Microsoft Graph and Paging
Getting Started with Microsoft Graph and Paging
Microsoft 365 Developer
57 Getting Started with Microsoft Graph and Schema Extensions
Getting Started with Microsoft Graph and Schema Extensions
Microsoft 365 Developer
58 Getting Started with Microsoft Graph and Security API
Getting Started with Microsoft Graph and Security API
Microsoft 365 Developer
59 Getting Started with Microsoft Graph and Query Parameters
Getting Started with Microsoft Graph and Query Parameters
Microsoft 365 Developer
60 Getting Started with Microsoft Graph and Reporting API
Getting Started with Microsoft Graph and Reporting API
Microsoft 365 Developer

This video shows how to debug Microsoft Teams apps locally without ngrok, by setting up a local hostname and enabling HTTPS with a trusted certificate. It covers Azure Active Directory single sign-on configuration and React application development.

Key Takeaways
  1. Set up a local hostname for the application
  2. Enable HTTPS with a trusted certificate
  3. Configure Azure AD SSO locally
  4. Use the local hostname and port in app registration
  5. Set up the Teams app manifest with local hostname and port
💡 You don't need ngrok for local debugging of Microsoft Teams apps, and can use a local hostname and HTTPS with a trusted certificate instead.

Related Reads

📰
Everyone’s Using AI. Almost Nobody’s Actually Using It.
Understand the current state of AI adoption and its impact on jobs and investment in 2026
Medium · AI
📰
Everyone’s Using AI. Almost Nobody’s Actually Using It.
Understand the current state of AI adoption in 2026 and its impact on jobs and investments
Medium · Startup
📰
Claude Sonnet 5 Benchmarks: The $2 Model That Caught the $5 Flagship
Learn how Claude Sonnet 5, a $2 model, outperformed a $5 flagship model in benchmarks, and what this means for AI development
Medium · Data Science
📰
Midjourney wants Hollywood studios to reveal the details of their AI usage
Midjourney demands Hollywood studios disclose their AI usage in ongoing legal dispute, highlighting the need for transparency in AI adoption
TechCrunch AI
Up next
Tackling Malaria in Africa with Technology at the Huawei ICT Competition
Huawei
Watch →