Reader small image

You're reading from  The Azure IoT Handbook

Product typeBook
Published inDec 2023
PublisherPackt
ISBN-139781837633616
Edition1st Edition
Right arrow
Author (1)
Dan Clark
Dan Clark
author image
Dan Clark

Dan Clark is a senior developer and data engineer specializing in Microsoft technologies. He is focused on learning new AI and data technologies and training others on how to best implement those technologies. He has worked as an Azure Technical Trainer (ATT)for Microsoft and has over 25 years of experience as a Microsoft Certified Trainer. Dan has published several books and numerous articles on Microsoft technologies. He is a regular speaker at various developer and database conferences and user group meetings and enjoys interacting with the Microsoft communities.
Read more about Dan Clark

Right arrow

Introducing device twins

Device twins are a way of storing state data of your devices. They are JSON documents that contain desired properties, reported properties, and tags. Device twins are extensively used in IoT to store device metadata in the cloud, report the current state of your devices, synchronize the state of long-running processes, and query device metadata.

For example, you can use a device twin to store configuration settings for each device. This can include things such as sampling intervals, alert thresholds, and communication settings—for instance:

Sampling interval: 10 minutes

High temperature alert threshold: 30°C

Low humidity alert threshold: 20%

The following screenshot shows a sample device twin for a device:

Figure 4.1: Sample device twin

The preceding code is also available on the GitHub repo in the Chapter04 folder.

Tags are set by a backend application or through IoT Hub. They are used to organize and...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
The Azure IoT Handbook
Published in: Dec 2023Publisher: PacktISBN-13: 9781837633616

Author (1)

author image
Dan Clark

Dan Clark is a senior developer and data engineer specializing in Microsoft technologies. He is focused on learning new AI and data technologies and training others on how to best implement those technologies. He has worked as an Azure Technical Trainer (ATT)for Microsoft and has over 25 years of experience as a Microsoft Certified Trainer. Dan has published several books and numerous articles on Microsoft technologies. He is a regular speaker at various developer and database conferences and user group meetings and enjoys interacting with the Microsoft communities.
Read more about Dan Clark