Table of contents
- Introduction
- Guided Steps
- Step 1: Set up Azure IoT Hub. Create an Azure IoT Hub.
- Step 2: Register a Device. Add a device to the IoT Hub.
- Step 3: Simulate the Device to Send Telemetry Data. Set up a mobile environment to simulate.
- Step 4: Store Telemetry Data in Azure Blob Storage. Set up an Azure Storage Account.
- Step 5: Create a Route in IoT Hub to send data to Blob Storage.
- Conclusion
Introduction
To develop a functional IoT solution with Azure IoT Hub, you can follow these steps:
Configure Azure IoT Hub
Add a device
Emulate the device to transmit telemetry data
Save the telemetry data in Azure Blob Storage
For an in-depth tutorial on these steps, read on!
Guided Steps
Step 1: Set up Azure IoT Hub. Create an Azure IoT Hub.
Sign in to the Azure portal.
Click on "Create a resource".
Search for "IoT Hub" and click "Create".
Fill in the necessary details like subscription, resource group, region, and IoT Hub name.
Choose the pricing and scale tier that fits your needs.
- Review and create the IoT Hub.
- Click on “Go to resource”.
Step 2: Register a Device. Add a device to the IoT Hub.
Within the Azure portal, go to your newly set up IoT Hub. In the "Device Management" section, select "Devices". Choose "Add Device" to register a new device.
Provide a device ID (e.g., Chi-smartphone) and keep the authentication type as a symmetric key.
Save the device. Note down the primary connection string; you will need this for device simulation.
Step 3: Simulate the Device to Send Telemetry Data. Set up a mobile environment to simulate.
Download the "IoT Play and Plug" app on your mobile.
Copy and paste the primary connection string into the app to initiate connection between the iot hub and the mobile app.
Step 4: Store Telemetry Data in Azure Blob Storage. Set up an Azure Storage Account.
In the Azure portal, click on "Create a resource" and search for "Storage account", or click on "Storage account" as shown below.
- Click on “Create”.
Fill in the necessary details.
- Click on “Create”.
Click on “Go to resource”.
- Create a container.
Step 5: Create a Route in IoT Hub to send data to Blob Storage.
In the IoT Hub, go to "Message Routing" under "Messaging".
Click "Add" to create a new route.
Select "Azure Storage" as the endpoint type and configure it with your storage account details.
Provide a name for the route.
Pick a container.
Save the route.
Click “Create+next”.
Upload any file from your connected IOT plug and play app and it should be uploaded successfully on your blob storage account.
Conclusion
By following this guide, you have successfully created a practical IoT solution using Azure IoT Hub. This solution involves setting up an IoT Hub, registering a device, simulating the device to send telemetry data, and storing that data in Azure Blob Storage. This foundational setup demonstrates the core components of an IoT architecture and provides a solid base for further enhancements. You can expand this solution by incorporating features such as data analytics, real-time alerting, or integrating with other Azure services to create a more comprehensive IoT ecosystem.