A lecture about Azure IoT solutions that I gave in the CodeValue Architecture Next 2018 conference.
The lecture provides information about SaaS and PaaS IoT solutions as well as the smart Edge,
6. About Me
Alon Fliess:
Chief Software Architect & Co-Founder at CodeValue Ltd.
Over 25 years of hands-on experience
Microsoft Regional Director
Microsoft Azure MVP
Renowned speaker at both international and domestic events
7. Cloud Computing
Advanced Mobile
Technologies
UI/UX & Graphic
Design
Cross Platform
Development
Advanced Web
Technologies
ALM & DevOps Software Architecture
IOT & Embedded
Software
Training & Mentoring
Development
Management &
Methodology
About CodeValue
8. Debug like a wizard Quit debugging, spend more time writing brilliant software
Magic Glance / Figure out complex expressionsLINQ Debugging / Know the flow of your LINQ queries
Reveal / Focus on data that actually matterSearch/ Find that needle in a haystack of data
With our Visual Studio extension for C#, follow the road to a bug-free world
oz-code.com | @oz_code
9. Agenda
Introduction
The Simple System
IoT Device Lifecycle
The Modern IoT System
Azure IoT PaaS & SaaS
Azure IoT Hub
Functional, Non-Functional & Constraints
Device Registry & Provisioning Service
Twin, Routing and Jobs
Smart cloud & intelligence edge
Summary
10. IoT - More Than The Core Technology
It is not (just) the technology that makes IoT what it is
It is the
Concepts, perception, commitment and the challenges
Facts that the entire industry is dealing with it nowadays
The IoT Challenge:
vast amount of devices using different hardware and software
technologies, are connected between them and to the cloud
which in turn provides many services, which handle a huge
stream of data and analyze it and extract vital information about
the current state of the system and via extended processing it can
even predict future state
11. IoT System Basic Components
var sensorData = await _bmp180.GetSensorDataAsync(Bmp180.UltraHighResolution);
var messageString = JsonConvert.SerializeObject(sensorData);
var message = new
Microsoft.Azure.Devices.Client.Message(Encoding.ASCII.GetBytes(messageString));
await deviceClient.SendEventAsync(message);
12. PLAN
PROVISION
CONFIGURE
MONITOR
RETIRE
Group devices and control access
according to your organization's
needs
Securely authenticate devices,
on-board for management and
provision for service
Provide updates, configuration & applications
to assign the purpose of each device
Monitor device inventory,
health & security while
providing proactive
remediation of issues
Replace or decommission devices
after failure, upgrade cycle or
service lifetime
IoT Device Lifecycle
13. The Modern IoT System
Most large IoT systems include one or more of the following:
Many different end devices with sensors and actuators
Local gateways
A collection of cloud services that enables:
Registration of end devices
Management of end devices
Controlling of end devices
Different communication protocols that provide reliability and security
Smart edge & device gateway
The ability to collect a vast amount of data in a very high rate
The ability to analyze the stream of information in close to real-time manner
The ability to analyze the current and historical collected information
The ability to show the resulted conclusion and the collected data
15. Solution PortalProvisioning API
Identity & Registry Stores
Stream Event Processor
Analytics/
Machine
Learning
Data Visualization
& Presentation
Device State Store
Gateway/Edge
Azure IoT Services Reference Architecture
Storage
IP capable
devices
Existing IoT
devices
Low power
devices
PresentationDevice and Event Processing
Data
Transport
Devices and
Data Sources
Azure
IoT Hub
Agent
Agent
Agent
16. Azure Time Series
Insights
Azure Machine
Learning
Azure Stream
Analytics
Cosmos DB Azure Data Lake
Azure Data Lake
Analytics
Azure HD Insight
Azure Event Hubs
Microsoft Flow
Azure Logic Apps
Notification Hubs
Azure Websites
Microsoft Power
BI
Azure Active
Directory
Azure IoT Hub
Azure IoT Hub
Device Provisioning
Service
Azure IoT Edge
Azure Monitor
PaaSServices&
DeviceSupport
Edge SupportDevice Support
Azure IoT Device
SDK
Certified Devices
Azure Certified
for IoT
Security Program
for Azure IoT
IoT Services Data & Analytics Services Visualization & Integration Services
PaaSSaaS Microsoft IoT Central
IoT SaaS
Remote Monitoring Predictive Maintenance Connected factory
Windows 10 IoT
Core
Azure IoT Suite
Comprehensive set of capabilities for IoT solutionsSolutionsServices
17. Azure IoT solutions approach
SaaS – Microsoft IoT Central
Fully managed IoT SaaS
No cloud solution development expertise
required
Configurable to your needs
Ideal for straightforward IoT needs
PaaS – Azure IoT Suite
Preconfigured solutions
Deploy in minutes
Accelerate time to value
Ideal for solutions that require ultimate
control
22. Microsoft IoT Central - Simplified predictable pricing
$0.50 USD
Per device, per month
$500 fixed fee per month includes first 100
devices and 1000 MB data traffic
Additional devices $0.50 USD
includes 10 MB data traffic
Additional data traffic $30 per 1 GB
FREE
Trial for 30 days
Includes 10 devices
and 100MB data traffic
24. Azure IoT Suite Remote Monitoring - Basic
Azure IoT Suite solution – PaaS (almost) like a SaaS
Devices
Back end
systems and
processes
Cosmos DB
Web App
Logic AppsIoT Hub
C# simulator
Microservices
Active
Directory
25.
26. Introducing Microsoft Azure IoT Hub
IoT Hub is available as a stand-alone service or as one
of the services used in the new Azure IoT Suite
Azure IoT Hub is designed to connect your devices to
Azure. It supports:
Millions of simultaneously connected devices
Per-device authentication
High throughput data ingestion
Scale device management
Reliable command and control
27. Pick your favorite to create a hub
Azure Portal
https://portal.azure.com
ARM template
https://azure.microsoft.com/en-
us/resources/templates/
Azure CLI
https://github.com/Azure/azure-cli (v2.0
Python)
Powershell
https://docs.microsoft.com/en-
us/powershell/azureps-cmdlets-docs/
IoT Hub
IoT Hub management
29. Azure IoT Hub SDKs
Device-facing
For devices and field gateways
Platforms
Many devices
RTOS (FreeRTOS)
Linux
(Ubuntu, Debian, Fedora, Raspbian, Angstrom)
Windows 7/8/10
ARM mbed
Android
iOS
Device SKD by programming language
For device side development
Azure IoT device SDK for C
Azure IoT device SDK for .NET
Azure IoT device SDK for Java
Azure IoT device SDK for Node.js
Azure IoT device SDK for Python
Service-facing SDK by programming language
For back-ends and cloud gateways
Azure IoT service SDK for .NET
Azure IoT service SDK for Node.js
Azure IoT service SDK for Java
Azure IoT service SDK for Python
Azure IoT Gateway SDK
Infrastructure and modules to create IoT gateway
solutions
Azure IoT Hub REST API
For all the rest…
Advance IoT Hub topics
IoT Hub endpoints
IoT Hub query language for device twins and jobs
Quotas and throttling
IoT Hub MQTT support
36. IoT Hub
Designed for IoT Scale
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Device
Twin
Jobs
Schedule and Broadcast
Device Twin Changes
Set Desired Properties,
Tags, Call Methods
Queries
Query Across
Device Twin State
For Business Logic,
Reporting and
Compliance
37. What’s next now that I have data flowing in?
Learn more: https://aka.ms/azureiotgetstarted
38. Introducing Azure Event Hubs
Event Producers
Azure Event Hub
> 1M Producers
> 1GB/sec
Aggregate
Throughput
Up to 32 partitions
via portal, more on
request
Partitions
Direct
PartitionKey
Hash
Throughput Units (TU):
• 1 ≤ TUs ≤ Partition Count
• TU: 1 MB/s writes, 2 MB/s reads
Consumer
Group(s)
Receivers
AMQP 1.0/HTTPS
Client-side cursors
Offset by Id or Timestamp
Event Processor Host
IEventProcessor
39. IoT Hub
Routing telemetry data
Device
Routing rules (query)
Body
{
"Weather":{
"Temperature":50,
"Time":"01:23:12Z"
}
}
SELECT * FROM Devices
WHERE tags.location = "bldg43"
my-message-type = "alert"
D2C receive endpoint
Event processing
(hot path)
Event processing (hot and cold path)
Service Bus Topics
Service Bus Queues
Event Hub
Storage Blob
Custom endpoints
connectors
Header:
$content-encoding="utf-8"
$content-type =
"application/json"
my-message-type = "alert"
$body.Weather.Temperature > 75
Event Grid
40. IoT Hub High Availability and Disaster Recovery
IoT Hub implements failover mechanisms for DR that require no intervention
from the user
Regional failover with IoT Hub and more:
https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-ha-dr
Functionality RPO
Service availability for registry and communication operations Possible CName loss
Identity data in identity registry 0-5 mins data loss
Device-to-cloud messages All unread messages are lost
Operations monitoring messages All unread messages are lost
Cloud-to-device messages 0-5 mins data loss
Cloud-to-device feedback queue All unread messages are lost
Device twin data 0-5 mins data loss
Parent and device jobs 0-5 mins data loss
41. IoT Hub Monitoring & Alerting
Integrated with Azure Monitor (OMS)
The current IoT Hub Operation Monitoring is deprecated
42. Waves of Innovation
The smart cloud & Intelligent Edge
Cloud
Globally available, unlimited compute resources
IoT
Harnessing signals from sensors and devices, managed
centrally by the cloud
Edge
Intelligence offloaded from the cloud to IoT devices
AI
Breakthrough intelligence capabilities
43. Why the edge?
IoT in the Cloud
Remote monitoring and control
Merging remote data from across multiple IoT devices
Near infinite compute and storage to train machine
learning and other advanced AI tools
IoT on the Edge
Low latency tight control loops require near real-time
response
Public internet inherently unpredictable
Privacy of data and protection of IP
44. Azure IoT Edge
Secure
A Secure connection to the Azure IoT Edge
Collect state and telemetry and monitor security of the
device
Cloud Managed
Enable rich management from Azure
Cross-Platform
Enable Azure IoT Edge on both Windows and Linux
Portable
Enable creating Docker Images that target multiple
architecture
Extensible
Enable seamless deployment of advanced capabilities
modules such as AI, Azure Function, Stream Analytics and
3rd party
Simple processing
filtering, batching, compression
Complex processing
Azure Stream Analytics,
Cognitive Services
46. Hardware for Azure IoT Edge
Ability to run on devices smaller than a Raspberry Pi
128MB memory
Support best in class operating systems such as Windows, and Linux
52. Azure Sphere Device
Azure Sphere MCU
First SoC by MediaTek
ARM Cortex-A for low power
ARM Cortex-M for real time processing
Built-in Wi-Fi
Built-in firewall everywhere
Secure with built-in silicon technology pioneered by Xbox
Azure Sphere Linux based OS
An OS purpose built for security
and agility
Available Q3 of 2018
54. Price & Capabilities
BASIC TIER PRICE PER UNIT
(PER MONTH)
TOTAL NUMBER OF
MESSAGES/DAY PER UNIT
MESSAGE
METER SIZE
MAX # OF
UNITS
B1 $10 400,000 4 KB 200
B2 $50 6,000,000 4 KB 200
B3 $500 300,000,000 4 KB 10
STANDARD TIER PRICE PER UNIT
(PER MONTH)
TOTAL NUMBER OF
MESSAGES/DAY PER UNIT
MESSAGE
METER SIZE
MAX # OF
UNITS
FREE FREE 8,000 0.5 KB 1
S1 $25 400,000 4 KB 200
S2 $250 6,000,000 4 KB 200
S3 $2,500 300,000,000 4 KB 10
Operation throttles & Other Limits:
https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-quotas-throttling
55. Limits, Quota & Throttling
TIER SUSTAINED THROUGHPUT SUSTAINED SEND RATE
B1, S1
Up to 1111 KB/minute per unit
(1.5 GB/day/unit)
Average of 278 messages/minute per unit
(400,000 messages/day per unit)
B2, S2
Up to 16 MB/minute per unit
(22.8 GB/day/unit)
Average of 4,167 messages/minute per unit
(6 million messages/day per unit)
B3, S3
Up to 814 MB/minute per unit
(1144.4 GB/day/unit)
Average of 208,333 messages/minute per unit
(300 million messages/day per unit)
56. Demo - The Water-Tank Boiler System
Based on ESP32 + 2 NTC Thermistors + Current Sensor
Hot water, when needed while saving energy!
Over the air firmware update
57. Demo – a Smart Boiler System
IoT Hub + Routing to ServiceBus Queue + Stream Analytics + Azure Function + PowerBI + Stream Insight
58. Smart Boiler - To-do…
Use Azure IoT edge
Run the Azure Function locally
Run stream analytics locally
Add AI module
Water usage patterns
Save even more energy
Scale to many tenant
Device provisioning portal
Device settings and management portal
59. Azure IoT Summary
IoT system architecture is a bit different then other cloud architecture
A “Pettle” – each device count!
Microsoft provides SaaS and PaaS solutions
Azure IoT Central, Azure IoT Suite, Azure IoT Hub and cloud services
Azure IoT Hub is designed to connect your devices to Azure. It supports:
SDKs, Millions of simultaneously connected devices, Per-device
authentication, High throughput data ingestion, Scale device management
HTTP, MQTT, AMQP communication protocols
Cloud to Device and Device to Cloud messaging
State transfer with device twins
Query language, Job Management, File Upload
Smart cloud & intelligent Edge
60. Resources
Demo code:
https://github.com/alonf/BasicGateController
Setup IoT Hub video: https://youtu.be/vq5AeLlsWx4
My MSDN articles:
Introduction to the Internet of Things – From the Device to Microsoft Azure Cloud
https://blogs.msdn.microsoft.com/microsoft_press/2015/04/27/from-the-mvps-introduction-to-the-
internet-of-things-from-the-device-to-microsoft-azure-cloud/
Efficient IoT With Azure
https://blogs.msdn.microsoft.com/mvpawardprogram/2016/11/15/efficient-iot-with-azure/
Secure Provisioning of IoT device using Azure IoT Hub device SDK
https://blogs.msdn.microsoft.com/mvpawardprogram/2017/03/14/provisioning-of-iot-device/
Thingiverse
http://www.thingiverse.com/thing:2253418
Azure IoT
IoT SDKs - https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-sdks
GitHub - https://github.com/Azure/azure-iot-sdks
Azure IoT Suite - https://azure.microsoft.com/en-us/suites/iot-suite/
Azure IoT Hub - https://azure.microsoft.com/en-us/services/iot-hub/
1868
On 9 December 1868,[7] the first non-electric gas-lit traffic lights were installed outside the Houses of Parliament in London
its operational life was brief. It exploded on 2 January 1869 as a result of a leak in one of the gas lines underneath the pavement[12] and injured[2] the policeman who was operating it
1912
An electric traffic light was developed in 1912 by Laster Wire, a policeman in Salt Lake City, Utah who also used red-green lights
1914
Traffic Signal Company installed a traffic signal system on the corner of East 105th Street and Euclid Avenue in Cleveland, Ohio. It had two colours, red and green, and a buzzer, based on the design of James Hoge, to provide a warning for colour changes. The design by James Hoge[16] allowed police and fire stations to control the signals in case of emergency
1920:
The first three colored light – Detroit (allowed four police officers to better control the intersection)
הרמזור הראשון בישראל הותקן בעיר חיפה, בפינת הרחובות הרצל-בלפור, בשנת 1949
תקופת מהפכת התרבות בסין הוצע להחליף בין האור האדום לירוק, כך שהאור האדום ישמש לנסיעה, מכיוון שהצבע האדום היה צבעה של המהפכה והוא סימל, בעיני השלטון, את הקידמה. ראש ממשלת סין ג'ואו אנלאי הצליח למנוע שינוי זה, מחשש לפגיעה בבטיחות ולתאונות דרכים.
https://youtu.be/4CZc3erc_l4
CodeValue is rooted in the Israeli High-tech ecosystem and expertise
Founded by a team of visionary technical experts and consultants in 2010
A team of 200 experts (over 30 leading architects), and growing…
Built around nurturing talents, hiring experts and developing potentials
Growing through a track record of solving complex technical challenges
Successfully implementing software development processes in companies of all scales
CodeValue is at the leading edge of advanced software development
Community of experts globally recognized by Microsoft, Google and Amazon
Early access to new technologies, hands-on practice at all levels
Decades of “real world” development experience
1 Microsoft MRD, 3 Microsoft MVP, 2 Google GDE & Mentors, AWS certified
CodeValue is rooted in the Israeli High-tech ecosystem and expertise
Founded by a team of visionary technical experts and consultants in 2010
A team of 200 experts (over 30 leading architects), and growing…
Built around nurturing talents, hiring experts and developing potentials
Growing through a track record of solving complex technical challenges
Successfully implementing software development processes in companies of all scales
CodeValue is at the leading edge of advanced software development
Community of experts globally recognized by Microsoft, Google and Amazon
Early access to new technologies, hands-on practice at all levels
Decades of “real world” development experience
1 Microsoft MRD, 3 Microsoft MVP, 2 Google GDE & Mentors, AWS certified
Within each of these five stages, there are several device operator requirements that should be fulfilled to provide a complete solution:
Plan: Enable operators to create a device metadata scheme that enables them to easily and accurately query for, and target a group of devices for bulk management operations.
Provision: Securely provision new devices to IoT Hub and enable operators to immediately discover device capabilities.
Configure: Facilitate bulk configuration changes and firmware updates to devices while maintaining both health and security.
Monitor: Monitor overall device collection health, the status of ongoing operations, and alert operators to issues that might require their attention.
Retire: Replace or decommission devices after a failure, upgrade cycle, or at the end of the service lifetime. Use the device twin to maintain device info if the physical device is being replaced, or archived if being retired.
Highlight PaaS
Microsoft has built a portfolio that supports the needs of all customers, and enables everyone to access the benefits of digital transformation.
Microsoft IoT Central is a fully managed SaaS solution that is best used when you need to get started quickly with minimal IoT experience. If your business is pursuing speed over customization, SaaS models could be the perfect fit for your IoT implementation needs. Organizations with fewer device models, more predictable scenarios, and limited IoT/IT capabilities can now reap the benefits of IoT through a SaaS approach. Those businesses that previously lacked the time, money, and expertise to develop connected products can now get started quickly with Microsoft IoT Central. We are leading the industry in providing a mature SaaS solution that meets common IoT implementation pain points.
Azure IoT Suite is a customizable PaaS solution that is best used when you need a lot of control over your IoT solution. If your business is implementing IoT for connected operations, or have very particular customization requirements for your connected products, you can have the control you need with Azure IoT Suite. Organizations with a large number of devices or device models, and manufacturers seeking connected factory solutions are examples of companies that can create highly customizable IoT solutions tailored to their complex needs.
In addition, Azure IoT Edge provides organization with the capacity to do local processing. When combined with a PaaS or SaaS solution, edge processing can offer faster calculations and reduce the cost of data sent to the cloud.
For the remainder of this presentation, we’ll focus on Microsoft IoT Central, and the unique value that it is bringing by democratizing IoT.
<click>
Microsoft Azure IoT Hub provides capabilities for securely connecting, provisioning, updating and sending commands to devices. IoT Hub enables companies to control millions of IoT assets running on a broad set of operating systems and protocols to jumpstart their Internet of Things projects.
IoT Hub enables companies to:
Establish reliable bi-directional communication with IoT assets, even if they are intermittently connected, so companies can analyze incoming telemetry data and send commands and notifications as needed.
Enhance security of IoT solutions by leveraging per-device authentication to communicate with devices with the appropriate credentials.
Revoke access rights to specific devices, if needed, to maintain the integrity of the system.
The Device Provisioning Service works in a wide variety of scenarios:
Zero-touch provisioning to a single IoT solution without requiring hardcoded IoT Hub connection information in the factory (initial setup).
Automatically configuring devices based on solution-specific needs.
Load balancing devices across multiple hubs.
Connecting devices to their owner’s IoT solution based on sales transaction data (multitenancy).
Connecting devices to a specific IoT solution depending on use-case (solution isolation).
Connecting a device to the IoT hub with the nearest geo-location.
Re-provisioning based on a change in the device, such as a change in ownership or location.
To handle massive amount of devices and to communicate with offline devices, use Jobs:
Jobs encapsulate the execution of device twin updates and direct methods against a set of devices at a schedule time
The job is described as a JSON document
Jobs are initiated by the cloud app and maintained by IoT Hub
Once a job is initiated, querying for jobs enables the cloud app to refresh the status of running jobs
More information
You can route device-to-cloud messages to a custom endpoint based on the message properties
Create a routing rule to send messages to an instance of an Event Hub, a Service Bus Queue and a Service Bus Topic
Use the new Event Grid (Preview)
Message can be routed to multiple custom endpoint if it match multiple conditions
Routing can be done by querying the message header, or message body, using SQL like syntax
$body.message.Weather.Location.State = 'WA'
$body.Weather.HistoricalData[0].Month = 'Feb'
$body.Weather.Temperature = 50 AND $body.message.Weather.IsEnabled
length($body.Weather.Location.State) = 2
$body.Weather.Temperature = 50 AND Status = 'Active'
Azure IoT Edge is:
The evolution of the Azure IoT Gateway SDK
A service that extends cloud capabilities to the edge and distributes intelligence across IoT devices
Open-source and cross-platform support for building custom logic at the edgeAg
Azure IoT Edge provides offline intelligent scenarios
Analytics, Machine Learning
Azure IoT Edge is under public preview and will be available later this year
Microsoft Azure IoT Hub provides capabilities for securely connecting, provisioning, updating and sending commands to devices. IoT Hub enables companies to control millions of IoT assets running on a broad set of operating systems and protocols to jumpstart their Internet of Things projects.
IoT Hub enables companies to:
Establish reliable bi-directional communication with IoT assets, even if they are intermittently connected, so companies can analyze incoming telemetry data and send commands and notifications as needed.
Enhance security of IoT solutions by leveraging per-device authentication to communicate with devices with the appropriate credentials.
Revoke access rights to specific devices, if needed, to maintain the integrity of the system.