Real-Time Intelligence in Microsoft Fabric is a transformative capability that empowers organizations to process and respond to data as it flows in. This enables faster, more informed decision-making. By combining streaming data ingestion, event processing, and analytics in a unified platform, Microsoft Fabric allows businesses to monitor operations, detect anomalies, and trigger actions in real time. This was powerful in a previous life as I worked for a manufacturer, but applies to other industries such as retail, finance, and healthcare. At its core, Real-Time Intelligence is about turning raw, fast-moving data into actionable insights without delay.
Despite its potential, I have found that many current demonstrations of Real-Time Intelligence fall short of showcasing its full capabilities. They often rely on abstract or overly simplified scenarios that do not reflect the complexity of real-world use cases. As a trainer, I totally understand the need to provide a successful solution to guide attendees in a workshop to success. As a result, they tend to overlook the integration of artificial intelligence which helps extract value from real-time data to make decisions. Without demonstrating how machine learning models can be embedded into these pipelines to make predictions or automate decisions, these demos miss a critical opportunity to show the true impact of what Real Time Intelligence can do.
This multi-part series aims to bridge that gap by offering a hands-on, in-depth exploration of how to integrate real-time data with machine learning in Microsoft Fabric. We will walk through the end-to-end process starting with setting up streaming data sources to training and deploying predictive models. When finished, we will operationalize those models in real-time workflows. Along the way, we address common challenges such as data latency, model accuracy, and some of the areas where need to stitch elements of the solution together. Whether you are a data engineer, data scientist, or solution architect, this series will equip you with the tools and insights needed to build intelligent, responsive systems that deliver real value.
The Use Case for Real Time Intelligence
If you work from home like me, sometimes you end up trapped at your desk all day. This solution is designed to predict whether or not you should go outside to enjoy some fresh air. Based upon the temperature, humidity, and barometric pressure, you can predict whether or not it is a nice time to get outside.
To make this work, we will use a Raspberry Pi to serve as our Weather Station to collect data. That device will be connected to an Azure IoT hub which will collect data from our device and make it available inside of Real Time Intelligence with Microsoft Fabric. The way the code is written, you can use just about any hardware you have laying around, but you might need to make some adjustments to get it to work with your hardware. I have remarked out details, so you can adjust as you need to suit your needs.
Hardware Requirements
To join in, you will need the following items. I am putting links to Amazon, but you are welcome to purchase these items from whatever retailer works best for you. To join in, you will need the following items:
- A Raspberry Pi
- I am using a Pi Zero, but any Raspberry Pi will do
- If you are new at this, I suggest getting a Can-a-Kit that includes everything you might need
- T-Cobbler and Breadboard
- Makes life easier for you
- Not required, but you might need to buy some additional cables to connect sensors
- Sensors
You may find your sensors in a kit that contains these three items. There are also variants of sensors such as the DHT-22 or BMP180 sensors are already in your possession. You can make some adjustments to the sample code and integrate them into the solution if you want to save some additional costs.
Also, if you are more of a fan of Arduinos, this same process will work for you. I just do not have any code available at the time being. However, I encourage you to try writing it out if you are a fan of Arduino devices.
Deploy an Azure IoT Hub
To create an Azure IoT Hub using the Free Tier, begin by signing into the Azure Portal. Once logged in, click on “Create a resource” from the left-hand menu, then search and select “IoT Hub”. Click “Create” to begin the setup process. Under the “Basics” tab, choose your subscription and either select an existing resource group or create a new one. Choose a region close to your location, and enter a globally unique name for your IoT Hub, such as YourName_WeatherStation. Proceed to the “Networking” tab and leave the default settings for public access. In the “Management” tab, select the F1: Free Tier, which allows up to 8,000 messages per day. Leave the remaining settings as default, then click “Review + create.” After reviewing your configuration, click “Create” and wait for the deployment to complete. Once it is done, click “Go to resource” to open your new IoT Hub.

With your IoT Hub created, the next step is to add a device. In the IoT Hub resource page, look for the “IoT devices” option under the “Explorers” section in the left-hand menu and click on it. Then, click the “+ New” button at the top to add a new device. Provide a unique device ID, such as your city, and leave the authentication type set to “Symmetric key.” You can keep the auto-generated keys and other settings as they are. Click “Save” to create the device. Once the device is added, click on its name to open its details, and copy the Primary Connection String. This will be how you will connect your physical or simulated device to the IoT Hub. At this point, your IoT Hub is ready to receive data.

With the Azure IoT Hub in place, it is time to setup our device!
Staging your Raspberry Pi
Once you have your hardware, it is time to get everything ready. We need to image our Raspberry Pi, attach sensors, and then install software. We will start with imaging your SD card.
Applying an Image to an SD Card
To image an SD card for a Raspberry Pi, begin by downloading the Raspberry Pi Imager. After installing the software, insert your SD card into your computer using an SD card reader. Launch the Raspberry Pi Imager and click “Choose OS” to select the operating system you want to install. Next, click “Choose Storage” and select your SD card from the list of available drives. Be sure to choose the correct drive, as the process will erase all existing data on the card.

Before you start the imaging process, edit the custom settings for your image. This will allow you to assign a custom host name, user, and password for your device. Also confirm that SSH is enabled under the services tab. These small items will ensure you can access your device without a keyboard or monitor attached. If you prefer to do it that way, that is fine. But if you are like me, you probably have too much stuff on your desk already.

Once your selections are made, click yes with your customized settings to begin the imaging process. The Imager will download the OS image, write it to the SD card, and verify the image. This may take several minutes depending on your system and internet speed. When the process is complete, safely eject the SD card from your computer. You can now insert it into your Raspberry Pi, connect your peripherals, and power it on. The Raspberry Pi will boot into the newly installed operating system, ready for initial setup and use.
Connecting your Sensors
With your image in place, we want to connect our sensors next. If you are using a T-Cobbler, this should be pretty easy for you. However, if you forgo that, you will need to look up a pin reference for your device.
First, we want to connect our DHT-11 sensor:

Next, we will want to connect our BMP280 Pressure Sensor:

Lastly, we need to hook up our DS18B20 Temperature Sensor:

If you decided to forgo the T-Cobbler, you can connect the VCC wire to a 3V3 pin. The DS18B20 sensor works with both 3.3v and 5v.
With our sensors hooked up, we can turn the power on to your Raspberry Pi.
Installing your Software
It may take a few minutes for your Raspberry Pi to come online. Eventually, you connect to it with PuTTY with your hostname, user, and password. Once you are online, you can start running updates and software installs. First thing we need to do is enable I2C:
sudo raspi-config
From here, go to interface options, then I2C, and enable. Next, we need to update a config file:
sudo nano /boot/config.txt
Scroll to the bottom of the file and add “dtoverlay=w1-gpio”. Then use CTRL+X, then Y, then Enter to save the changes. Once saved, reboot your device:
sudo reboot
Once you are back online and signed in, we have a list of commands that need to be run in sequence:
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install -y git cmake build-essential curl libcurl4-openssl-dev libssl-dev uuid-dev
sudo apt-get install -y nodejs npm vim
sudo npm install -y -g npm
sudo npm cache clean -f
sudo npm install -y -g n
sudo n stable
sudo apt-get install -y python3-full
sudo python3 -m pip config set global.break-system-packages true
sudo pip3 install azure-iot-device
sudo pip3 install azure-iot-hub
sudo apt-get install -y i2c-tools build-essential
sudo pip3 install adafruit-circuitpython-bmp280
git clone https://github.com/adafruit/Adafruit_Python_DHT.git
sudo python ~/Adafruit_Python_DHT/setup.py install
cd Adafruit_Python_DHT
sudo python setup.py install
sudo reboot
However, if you do not want to babysit the device, you can run the script I put together in my GitHub Repository for this project. You can move that file across with WinSCP. Once this is complete, it is time to add the python files to send our data to Fabric and Real Time Intelligence!
Deploying the Weather Station Script
There are two python files required to make this script work. The configWeatherStation.py file identifies the device name and connection string. All you have to do is update the values in the sample code below:
#!/user/bin/python
#For use with the WeatherStation.py script
#Paste the connection string for your device here:
DeviceConnectionString = 'Connection String Here'
#Enter your Device ID here:
DeviceName = 'Device Name Here'
Once you have updated configWeatherStation.py, upload it with WeatherStation.py. You can then run the WeatherStation.py file with the following command:
python WeatherStation.py
Once this has started, it should provide sensor data and see the messages starting to accumulate in the Azure IoT Hub page.
Next Steps
Well, that was not very data centric. I know, it is a little annoying to some degree. However, I have found that having a physical device makes it easy to demonstrate capabilities. Real Time Intelligence sounds good, but until you see data being manipulated in real time, it feels fictitious. I saw this in action in a previous life and hope this will help you as well!
On a personal note, I am already enjoying this series as it is quite nostalgic. I did this demonstration about eight years ago with stream analytics and Azure ML Studio. The difference was I got to do it with a good friend and colleague, Greg Hicks. Unfortunately, he passed away last year. While it would be more fun to do this project with him, it does bring back some great memories. I only hope you enjoy following this series as I am while walking down memory lane.

















