Skip to content

Azure Cloud

Shiva Karthick edited this page Oct 9, 2023 · 13 revisions

Cloud Architecture

image

Device development paths

This article discusses two common device development paths. Each path includes a set of related development options and tasks. General device development: Aligns with modern development practices, targets higher-order languages, and executes on a general-purpose operating system such as Windows or Linux.

If your device is able to run a general-purpose operating system, we recommend following the General device development path. It provides a richer set of development options.

Embedded device development: Describes development targeting resource constrained devices. Often you use a resource-constrained device to reduce per unit costs, power consumption, or device size. These devices have direct control over the hardware platform they execute on.

1.1 Selecting a service

A key step in the development process is selecting a service to connect your devices to. There are two primary Azure IoT service options for connecting and managing devices: IoT Hub, and IoT Central.

Azure IoT Hub. Use Iot Hub to host IoT applications and connect devices. IoT Hub is a platform-as-a-service (PaaS) application that acts as a central message hub for bi-directional communication between IoT applications and connected devices. IoT Hub can scale to support millions of devices. Compared to other Azure IoT services, IoT Hub offers the greatest control and customization over your application design. It also offers the most developer tool options for working with the service, at the cost of some increase in development and management complexity.

Azure IoT Central. IoT Central is designed to simplify the process of working with IoT solutions. You can use it as a proof of concept to evaluate your IoT solutions. IoT Central is a software-as-a-service (SaaS) application that provides a web UI to simplify the tasks of creating applications, and connecting and managing devices. IoT Central uses IoT Hub to create and manage applications, but keeps most details transparent to the user.

1.2 Tools to connect and manage devices

After you have selected hardware and a device SDK to use, you have several options of developer tools. You can use these tools to connect your device to IoT Hub, and manage them. The following table summarizes common tool options.

Azure portal Create an IoT hub with Azure portal Browser-based portal for IoT Hub and devices. Also works with other Azure resources including IoT Central.
Azure IoT Explorer Azure IoT Explorer Can't create IoT hubs. Connects to an existing IoT hub to manage devices. Often used with CLI or Portal.
Azure CLI Create an IoT hub with CLI Command-line interface for creating and managing IoT applications.
Azure PowerShell Create an IoT hub with PowerShell PowerShell interface for creating and managing IoT applications
Azure IoT Tools for VS Code Create an IoT hub with Tools for VS Code VS Code extension for IoT Hub applications.

2. What Azure technologies and services can you use to create IoT solutions? (https://learn.microsoft.com/en-us/azure/iot/iot-services-and-technologies)

2.1 Devices and device SDKs

You can further simplify how you create the embedded code for your devices by following the IoT Plug and Play conventions. IoT Plug and Play enables solution developers to integrate devices with their solutions without writing any embedded code. At the core of IoT Plug and Play, is a device capability model schema that describes device capabilities. Use the device capability model to configure a cloud-based solution such as an IoT Central application.

  • Azure IoT Edge lets you offload parts of your IoT workload from your Azure cloud services to your devices. IoT Edge can reduce latency in your solution, reduce the amount of data your devices exchange with the cloud, and enable off-line scenarios. You can manage IoT Edge devices from IoT Central.

  • Azure Sphere is a secured, high-level application platform with built-in communication and security features for internet-connected devices. It includes a secured microcontroller unit, a custom Linux-based operating system, and a cloud-based security service that provides continuous, renewable security.

2.2 Custom solutions

To build an IoT solution from scratch, use one or more of the following Azure IoT technologies and services:

2.3 Cloud connectivity

The Azure IoT Hub service enables reliable and secure bidirectional communications between millions of IoT devices and a cloud-based solution. Azure IoT Hub Device Provisioning Service is a helper service for IoT Hub. The service provides zero-touch, just-in-time provisioning of devices to the right IoT hub without requiring human intervention. These capabilities enable customers to provision millions of devices in a secure and scalable manner.

IoT Hub is a core component and you can use it to meet IoT implementation challenges such as:

  • High-volume device connectivity and management.
  • High-volume telemetry ingestion.
  • Command and control of devices.
  • Device security enforcement.

2.4 Data and analytics

IoT devices typically generate large amounts of time series data, such as temperature readings from sensors. Azure Data Explorer can connect to an IoT hub, read the telemetry stream from your devices, store that data, and enable you to query and visualize it.

2.5 Actions and notifications

A solution may required automated actions based on device data. For example, you may want to send an email or text message when a device reports a critical condition.

Azure Functions is a serverless compute service that enables you to run code on-demand without having to explicitly provision or manage infrastructure. Use Azure Functions to create event-driven, serverless apps that can run actions in response to conditions identified in telemetry streams.

3. Azure IoT Cloud Architecture

image

  1. IoT systems can ingest device data through the Azure IoT device SDKs, Azure RTOS, Azure Sphere, or Azure IoT Edge.
  2. IoT Hub, Azure IoT Hub Device Provisioning Service (DPS), or Azure Digital Twinse can provide device provisioning, connectivity, and management.
  3. For data storage and analytics: • The hot path can be through Azure Stream Analyticse or Azure HDInsighte. • The warm path can be through Azure Data Explorer e. • The cold path can be through Azure SQL Databasee or Azure Cosmos DB &.
  4. Management and business integration services can include Power Bl, Azure Maps, Search, API Management, Web Apps, Mobile Apps, Dynamics 365, Flow, and Logic Apps. For a detailed PaaS IoT reference architecture and discussion, see Azure IoT reference architecture.

4. Connecting IoT Devices to Azure: IoT Hub and Event Hubs

Azure provides two key services, Azure IoT Hub and Azure Event Hubs, for handling data connectivity and communication in the cloud. While both can ingest large volumes of data with low latency and high reliability, they have distinct purposes.

  1. Azure IoT Hub:

    • Purpose: Designed for connecting IoT devices to Azure cloud.
    • Features: Enables data gathering, business insights, and automation. Supports bi-directional communication for sending commands to devices and cloud intelligence to edge devices. Offers device-level identity for enhanced security.
    • Integration: Used for IoT data flow and works seamlessly with Azure IoT Edge.
    • Recommended for: IoT solutions and maximizing business value from IoT device connections.
  2. Azure Event Hubs:

    • Purpose: Tailored for high-throughput data streaming scenarios, suitable for handling billions of requests daily.
    • Integration: Integrated into various Azure big data and analytics services such as Databricks, Stream Analytics, ADLS, and HDInsight.
    • Additional Features: Includes Event Hubs Capture and Auto-Inflate for scalability and big data application support.
    • Usage in IoT: IoT Hub utilizes Event Hubs for its telemetry data flow, leveraging Event Hubs' robust capabilities.

In summary, both Azure IoT Hub and Azure Event Hubs are designed for massive-scale data ingestion. However, IoT Hub is specialized for IoT-specific requirements and offers rich capabilities for maximizing the value of connecting IoT devices to Azure. Starting with IoT Hub for data ingestion ensures access to comprehensive IoT features as your business and technical needs evolve. For detailed comparisons between IoT Hub and Event Hubs, refer to the provided table for evaluating IoT capabilities.

Reference: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-compare-event-hubs

Azure IoT Hub is a managed service hosted in the cloud that acts as a central message hub for communication between an IoT application and its attached devices. You can connect millions of devices and their backend solutions reliably and securely. Almost any device can be connected to an IoT hub. Several messaging patterns are supported, including device-to-cloud telemetry, uploading files from devices, and request-reply methods to control your devices from the cloud. IoT Hub also supports monitoring to help you track device creation, device connections, and device failures.

You can integrate IoT Hub with other Azure services to build complete, end-to-end solutions. For example, use:

4.2 Act on device data

IoT Hub gives you the ability to unlock the value of your device data with other Azure services so you can shift to predictive problem-solving rather than reactive management. Connect your IoT hub with other Azure services to do machine learning, analytics, and AI to act on real-time data, optimize processing, and gain deeper insights.

4.3 Device identity and authentication

Every IoT hub has an identity registry that stores information about the devices and modules permitted to connect to it. Before a device or module can connect, there must be an entry for that device or module in the IoT hub's identity registry. A device or module authenticates with the IoT hub based on credentials stored in the identity registry.

We support two methods of authentication between the device and the IoT hub. You can use SAS token-based authentication or X.509 certificate authentication.

The SAS token method provides authentication for each call made by the device to IoT Hub by associating the symmetric key to each call. X.509 authentication allows authentication of an IoT device at the physical layer as part of the Transport Layer Security (TLS) standard connection establishment. The choice between the two methods is primarily dictated by how secure the device authentication needs to be, and availability of secure storage on the device (to store the private key securely).

You can set up and provision many devices at a time using the IoT Hub Device Provisioning Service.

4.4 Act on device data

IoT Hub gives you the ability to unlock the value of your device data with other Azure services so you can shift to predictive problem-solving rather than reactive management. Connect your IoT hub with other Azure services to do machine learning, analytics, and AI to act on real-time data, optimize processing, and gain deeper insights.

4.5 Built-in endpoint collects device data by default

A built-in endpoint collects data from your device by default. The data is collected using a request-response pattern over dedicated IoT device endpoints, is available for a maximum duration of seven days, and can be used to take actions on a device. Here is the data accepted by the device endpoint:

  • Send device-to-cloud messages.
  • Receive cloud-to-device messages.
  • Initiate file uploads.
  • Retrieve and update device twin properties.
  • Receive direct method requests.
  • For more information about IoT Hub endpoints, see IoT Hub Dev Guide Endpoints

4.6 Message routing sends data to other endpoints

Data can also be routed to different services for further processing. As the IoT solution scales out, the number of devices, volume of events, variety of events, and different services also varies. A flexible, scalable, consistent, and reliable method to route events is necessary to serve this pattern. Once a message route has been created, data stops flowing to the built-in-endpoint unless a fallback route has been configured. For a tutorial showing multiple uses of message routing, see the Routing Tutorial.

IoT Hub supports setting up custom endpoints for various existing Azure services like Storage containers, Event Hubs, Service Bus queues, Service Bus topics, and Cosmos DB. Once the endpoint has been set up, you can route your IoT data to any of these endpoints to perform downstream data operations.

IoT Hub also integrates with Event Grid, which enables you to fan out data to multiple subscribers. Event Grid is a fully managed event service that enables you to easily manage events across many different Azure services and applications. Made for performance and scale, it simplifies building event-driven applications and serverless architectures. The differences between message routing and using Event Grid are explained in the Message Routing and Event Grid Comparison

4.7 What is an Azure Resource group?

An Azure resource group is a logical container into which Azure resources are deployed and managed.

5. Deploying model

6. To try out an end-to-end IoT solution, check out the IoT Hub quickstarts:

7. Tools

  • Azure IoT Explorer: Cross-platform, GUI-based utility to monitor and manage Azure IoT. If you're using Raspberry Pi as your development platform, we recommend that you install IoT Explorer on another computer. If you don't want to install IoT Explorer, you can use Azure CLI to perform the same steps.

References

Clone this wiki locally