Azure IoT Hub Documentation

Azure IoT Hub Documentation


Overview

What is Azure IoT Hub?


IoT Hub is a managed service, hosted in the cloud, that acts as a central message hub for bi-directional communication between your IoT application and the devices it manages.

IoT Hub supports multiple messaging patterns such as:
  • device-to-cloud telemetry
  • file upload from devices
  • request-reply methods to control your devices from the cloud
IoT Hub monitoring helps you maintain the health of your solution by tracking events such as device creation, device failures, and device connections.


IoT Hub gives you a secure communication channel for your devices to send data,
  • Per-device authentication enables each device to connect securely to IoT Hub and for each device to be managed securely.
  • You have complete control over device access and can control connections at the per-device level.
  • The IoT Hub Device Provisioning Service automatically provisions devices to the right IoT hub when the device first boots up.
  • Multiple authentication types support a variety of device capabilities:
    • SAS token-based authentication to quickly get started with your IoT solution.
    • Individual X.509 certificate authentication for secure, standards-based authentication.
    • X.509 CA authentication for simple, standards-based enrollment.
You can manage your devices connected to IoT Hub:
  • Store, synchronize, and query device metadata and state information for all your devices.
  • Set device state either per-device or based on common characteristics of devices.
  • Automatically respond to a device-reported state change with message routing integration.
Use the Azure IoT device SDK libraries to build applications that run on your devices and interact with IoT Hub,
  • Supported languages
    • C
    • C#
    • Java
    • Python
    • Node.js
  • protocols for connecting devices
    • HTTPS

    • AMQP

    • AMQP over WebSockets

    • MQTT

    • MQTT over WebSockets

Quickstart

Send telemetry from a device to an IoT hub and monitor it with the Azure CLI

IoT Hub is an Azure service that enables you to ingest high volumes of telemetry from your IoT devices into the cloud for storage or processing.

Prerequisites

  • an Azure subscription account
  • the Azure Cloud Shell

Sign in to the Azure portal

Sign in to the Azure portal at https://portal.azure.com.

Launch the Cloud Shell

Select the Cloud Shell button on the top-right menu bar in the Azure portal.

Create an IoT Hub

you use the Azure CLI to create a resource group and an IoT Hub.
  • Run the az group create command to create a resource group.
  • 
    az group create --name MyResourceGroup --location eastus
    
  • Run the az iot hub create command to create an IoT hub.
  • 
    az iot hub create --resource-group MyResourceGroup --name {YourIoTHubName}
    

Create and monitor a device

  • To create a simulated device
  • 
    az iot hub device-identity create --device-id simDevice --hub-name {YourIoTHubName} 
    
  • To monitor a device:
  • 
    az iot hub monitor-events --output table --hub-name {YourIoTHubName}
    
    

Use the CLI to send a message

sends a cloud-to-device message from your IoT hub to the simulated device.




留言

熱門文章