8-Week Microsoft Teams AppDev Accelerator Program
Limited seats available! - Start date: Wednesday, April 16, 2025
Join Today & Save $1,000
articles

Node, TypeScript, AzureAD & O365 API Apps on Raspberry Pi

At Microsoft Build and Ignite, a Node.js web app demo integrated TypeScript, AzureAD, ADAL, & Office 365 APIs to run on any platform.

Node, TypeScript, AzureAD & O365 API Apps on Raspberry Pi
by Andrew Connell

Last updated May 5, 2015
3 minutes read

Share this

Focus Mode

  • Set up Raspberry Pi & Install Node.js
  • Add Node.js Project to the Raspberry Pi
  • Update Configuration File with Raspberry Pi’s IP
  • Feedback & questions

Last week at the Microsoft Build conference & this week at Microsoft’s Ignite conference, I presented short express talks / theater sessions on using Node.js to run a web application that integrates TypeScript, AzureAD, ADAL & Office 365 APIs in a neat little demo. If you missed it, you can grab the code from this project in github as well as watch this video of the running demo.

What I find so cool about this approach to building web application is that they can run on any platform with no code changes. I developed the web application using Visual Studio Code on my MacBook Pro where I also tested it, but I also ran it with zero code changes on Windows 8.1, deployed it to an Azure web app & to the Raspberry Pi. The only thing I had to do was tweak the IP of the device in a configuration file & update the reply URL in the AzureAD application to redirect back to the correct host.

When I show this little demo I usually get a bunch of questions. One is what you need to do this. For my demo you only need to buy three things: the Raspberry Pi 2 for about $40, a Wifi USB adapter for about $10 & a 32GB microSD card for about $15… all told, about $65.

The other question I get is how do you do this once you get the hardware. There are a few different things you need to do.

Set up Raspberry Pi & Install Node.js

First step, you need to get an OS on the microSD card & then install Node.js on it. I’ve written about that in a previous blog post here: Set up Node.js on Raspberry Pi 2 B.

Add Node.js Project to the Raspberry Pi

Once that’s done, you need to get the code for the Node.js project on to the microSD card. There are a few different ways you can do this:

  • Connect to the Raspberry Pi via SSH and use git to clone your project to the device… make sure you run npm install to get all the packages the app needs
  • Connect to the Raspberry Pi over SMB file share from your laptop & XCOPY the project & package dependencies over to the device’s microSD card
  • Copy the project & package dependencies to the microSD card by connecting the card to your laptop

Personally the first option is the easiest, but it can take some time to download everything. The last option is pretty easy, just gets to be a pain to move the card between the laptop & Raspberry Pi and then boot the Pi.

Update Configuration File with Raspberry Pi’s IP

Last but not least, if you are building an app like what I’ve done in my sample that uses AzureAD for authentication, you will need to get the IP of the device and set it in a configuration file as well as update the application in AzureAD so once the user logs in, they are redirected to the website running on the device.

Andrew Connell, Microsoft MVP, Full-Stack Developer & Chief Course Artisan - Voitanos LLC.
author
Andrew Connell

Microsoft MVP, Full-Stack Developer & Chief Course Artisan - Voitanos LLC.

Andrew Connell is a full stack developer who focuses on Microsoft Azure & Microsoft 365. He’s a 20+ year recipient of Microsoft’s MVP award and has helped thousands of developers through the various courses he’s authored & taught. Whether it’s an introduction to the entire ecosystem, or a deep dive into a specific software, his resources, tools, and support help web developers become experts in the Microsoft 365 ecosystem, so they can become irreplaceable in their organization.

Feedback & Questions

newsletter

Join 10,000+ developers for news & insights

No clickbait · 100% free · Unsubscribe anytime.

Subscribe to Andrew's newsletter for insights & stay on top of the latest news in the Microsoft 365 Space!
blurry dot in brand primary color
found this article helpful?

You'll love these!

Running Node.js on a Raspberry Pi 2 Model B: A Guide

Running Node.js on a Raspberry Pi 2 Model B: A Guide

February 28, 2015

Read now

Understanding Microsoft Entra ID, OAuth2 & OpenID Connect

Understanding Microsoft Entra ID, OAuth2 & OpenID Connect

March 4, 2015

Read now

Understanding Microsoft Entra ID OAuth2 authentication flows

Understanding Microsoft Entra ID OAuth2 authentication flows

March 4, 2015

Read now

bi-weekly newsletter

Join 10,000+ Microsoft 365 full-stack web developers for news, insights & resources. 100% free.

Subscribe to Andrew's newsletter for insights & stay on top of the latest news in the Microsoft 365 ecosystem!

No clickbait · 100% free · Unsubscribe anytime.

Subscribe to Andrew's newsletter for insights & stay on top of the latest news in the Microsoft 365 Space!