The Azure IoT Handbook - Dan Clark - E-Book

The Azure IoT Handbook E-Book

Dan Clark

0,0
29,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.
Mehr erfahren.
Beschreibung

With the rise of cloud-based computing, deploying IoT systems has become more cost-effective for businesses. This transformation has led to developers and architects shouldering the responsibility of creating, managing, and securing these systems, even if they are new to the IoT technology. The Azure IoT Handbook is a comprehensive introduction to quickly bring you up to speed in this rapidly evolving landscape.
Starting with the basic building blocks of any IoT system, this book guides you through mobile device management and data collection using an IoT hub. You’ll explore essential tools for system security and monitoring. Following data collection, you’ll delve into real-time data analytics using Azure Stream Analytics and view real-time streaming on a Power BI dashboard. Packed with real-world examples, this book covers common IoT use as well.
By the end of this IoT book, you’ll know how to design and develop IoT solutions leveraging intelligent edge-to-cloud technologies implemented on Azure.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB

Seitenzahl: 252

Veröffentlichungsjahr: 2023

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



The Azure IoT Handbook

Develop IoT solutions using the intelligent edge-to-cloud technologies

Dan Clark

BIRMINGHAM—MUMBAI

The Azure IoT Handbook

Copyright © 2023 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Group Product Manager: Preet Ahuja

Publishing Product Manager: Suwarna Rajput

Book Project Manager: Neil D’mello

Senior Content Development Editor: Adrija Mitra

Technical Editor: Rajat Sharma

Copy Editor: Safis Editing

Proofreader: Safis Editing

Indexer: Pratik Shirodkar

Production Designer: Prashant Ghare

DevRel Marketing Coordinator: Rohan Dobhal

First published: December 2023

Production reference: 1241123

Published by Packt Publishing Ltd.

Grosvenor House

11 St Paul’s Square

Birmingham

B3 1RB, UK

ISBN 978-1-83763-361-6

www.packtpub.com

To my wife, Angie, for being so patient with me during these writing adventures.

– Dan Clark

Contributors

About the author

Dan Clark is a senior business intelligence (BI), data, and programming consultant specializing in Microsoft technologies. Dan is a Microsoft Certified Trainer and past MVP. His current interest is in IoT systems and the potential of the technology. He is focused on learning new technologies and training others on how to best implement them. Dan has published several books and numerous articles on .NET programming, BI development, and now, IoT. He is a regular speaker at various developer and database conferences and user group meetings and enjoys interacting with the Microsoft communities. Previously, Dan was a physics teacher. He is still inspired by the wonder and awe of studying the universe and figuring out why things behave the way they do.

About the reviewers

Balaji M is a Microsoft Azure IoT Specialty-certified IoT engineer who holds a bachelor’s in electronics and communications engineering. He has a significant amount of experience in the end-to-end processes of both the hardware and software sections of IoT. His area of expertise is in consumer electronics and automation. Quite recently, he expanded his horizons by stepping into Industry 4.0. His areas of interest include but are not limited to wireless technologies, safety/integrity of systems, low-power devices, data analytics, and ML on edge.

I would like to thank Packt Publishing for providing me with the opportunity to review this excellent book. I would also like to extend my gratitude to my mom and my friends, who have stood beside me always.

Yatish Patil is an author and Azure IoT analytics technology expert with a passion for building customer success consulting with cloud, IoT, and analytics solutions using Microsoft Azure. He has worked with enterprise customers, enabling them to identify and cultivate IoT analytics opportunities through technology innovation.

He is actively involved in technology consulting and solutioning for customers, defining technology roadmaps, best practices, and processes.

He is an ISB product management alumnus who focuses on customer success, solutions, and product management helping customers achieve business goals. He is also the author of Azure IoT Development Cookbook, which focuses on the Microsoft Azure IoT platform and preconfigured end-to-end solutions.

I’d like to thank my family and friends, who understand the time and commitment it takes to research and brainstorm constantly changing technology and customer demand. Also, thank you to my teammates and colleagues at various stages, who helped me to gain knowledge with their support.

Table of Contents

Preface

Part 1: Capturing Data from Remote Devices

1

An Introduction to the IoT

Technical requirement

What is the IoT?

What are some common IoT use cases?

What are the components of an IoT system?

Understanding the Azure IoT system

Lab – setting up an IoT hub in Azure

Summary

2

Exploring the IoT Hub Service

The features of IoT Hub

Configuring IoT devices

Identity verification

Communicating with IoT devices

Device-to-cloud messaging

Using direct methods

Using a device twin

Managing and monitoring IoT devices

Using the Azure CLI to monitor devices

Setting up Azure Toolkit in Visual Studio Code

Lab – setting up and monitoring IoT devices

Summary

3

Provisioning Devices with the Device Provisioning Service

Device provisioning at scale

Managing device provisioning security concerns

Allocation policies in DPS

Deprovisioning and disenrolling devices

Using the device provisioning SDK

Lab – provisioning devices using DPS

Adding an individual enrollment

Adding group enrollments

Using custom policies for device allocation

Summary

4

Exploring Device Management and Monitoring

Introducing device twins

Querying devices using device twins

Updating device properties

Communicating with devices

Cloud-to-device messaging

Direct method calls

Automated device management

Monitoring metrics and logs

Lab – Automating IoT device management

Lab – Creating and testing an alert

Summary

5

Securing IoT Systems

End-to-end security for IoT

A use case to exemplify how Azure IoT end-to-end security components work together

Microsoft Defender for IoT

Setting up Microsoft Defender for IoT

Microsoft Defender for Cloud

Lab – creating a security alert

Summary

Part 2: Processing the Data

6

Creating Message Routing

Exploring the basics and overall process of message routing

Common use cases for using the built-in endpoint in an IoT hub

Common use cases for using custom endpoints in an IoT hub

Message routing queries

Exploring message enrichment

Lab – using message enrichment and custom endpoints

Summary

7

Exploring Azure Stream Analytics

Stream analytics use cases

Inputs and outputs

Stream Analytics query language

Running and monitoring jobs

Lab – detecting anomalies with ASA

Summary

8

Investigating IoT Data with Azure Data Explorer

What is Azure Data Explorer?

Ingesting streaming data

Visualizing the streaming data

Lab – creating an ADX dashboard

Summary

Further reading

9

Exploring IoT Edge Computing

Azure IoT Edge devices

Deploying an IoT Edge device

Exploring EdgeAgent

Exploring EdgeHub

Computing and storage on the edge

Using an edge device as a gateway

Lab – implementing stream analytics on the edge

Summary

Part 3: Processing the Data

10

Visualizing Streaming Data in Power BI

Technical requirements

Introducing Power BI?

Exploring Power BI dashboard basics

Types of real-time datasets

Pushing data into datasets

Displaying real-time visuals

Lab – Creating a real-time streaming dashboard

Summary

11

Integrating Machine Learning

Understanding ML basics

Creating an ML algorithm in Azure

What are Azure AI and ML services?

Exploring ML on the edge

Combining IoT with ML

Lab – creating an anomaly detection system

Summary

12

Responding to Device Events

Event Grid versus Event Hubs

Understanding Event Grid fundamentals

Event Grid architecture

Event Grid key concepts

Exploring common IoT events

Sending IoT events to Event Grid

Responding to events

Subscribing and responding to IoT Hub events

Lab – monitoring device connection and disconnection with Event Grid

Summary

Index

Other Books You May Enjoy

Preface

Welcome to this guide on setting up an Internet of Things (IoT) solution in Azure. As the IoT continues to transform the way we interact with the world, IoT developers and architects are at the forefront of innovation. This book is crafted with your specific needs in mind, whether you’re a seasoned developer or an architect seeking to navigate the complexities of building and managing IoT solutions in the Azure ecosystem.

With the rise of cloud-based computing, deploying IoT systems has become more cost-effective for businesses. This transformation has led to developers and architects shouldering the responsibility of creating, managing, and securing these systems, even if they are new to the IoT technology. The Azure IoT Handbook is a comprehensive introduction to quickly bring you up to speed in this rapidly evolving landscape.

In the world of IoT, building a complete system that operates seamlessly in the Azure cloud is paramount. Our focus is on guiding you through the process of developing a comprehensive IoT system in Azure, from inception to deployment. This book will provide insights into creating, securing, and managing enterprise-wide IoT systems. Additionally, it will equip you with the essential skills to collect, analyze, and visualize streaming data, ensuring that you can harness the full potential of your IoT solutions.

Whether you are embarking on a new IoT project or enhancing your existing skills, this book is here to serve as your trusted companion on your journey toward mastering IoT in Azure. We hope it empowers you to not only navigate the intricacies of IoT development but also to drive innovation, making a meaningful impact in the rapidly evolving IoT landscape.

Starting with the basic building blocks of any IoT system, this book guides you through mobile device management and data collection using an IoT hub. You’ll explore essential tools for system security and monitoring. Following data collection, you’ll delve into real-time data analytics using Azure Stream Analytics and view real-time streaming on a Power BI dashboard. Packed with real-world examples, this book covers common IoT use cases as well.

By the end of this IoT book, you’ll know how to design and develop IoT solutions, leveraging intelligent edge-to-cloud technologies implemented on Azure.

Who this book is for

Our primary audience for this book consists of IoT developers and architects. If you fall into one of these categories and are eager to gain the knowledge and skills required to implement and manage IoT solutions in Azure, you’re in the right place. To make the most of this guide, you should possess some prior knowledge of programming languages such as C#, Java, or Python, along with a basic understanding of data processing principles.

What this book covers

Chapter 1, An Introduction to the IoT, introduces you to the exciting world of the IoT. This chapter serves as a foundational overview of IoT, explaining its basic concepts and the significance of connecting everyday objects and devices to the internet. It explores the various applications and potential benefits of IoT, setting the stage for a deeper understanding of this transformative technology.

Chapter 2, Exploring the IoT Hub Service, delves into the core component of IoT systems – the Azure IoT Hub service. This chapter provides a comprehensive exploration of IoT Hub, an essential platform to manage and communicate with IoT devices. You will learn about its key features and functionalities and how it enables secure and scalable IoT solutions. This chapter also introduces important concepts such as telemetry and device management within the context of IoT Hub.

Chapter 3, Provisioning Devices with the Device Provisioning Service, focuses on the crucial aspect of provisioning IoT devices securely. You will gain insights into the Device Provisioning Service, an integral part of IoT architecture. This chapter covers the process of registering and onboarding devices, ensuring that they can seamlessly connect to the IoT ecosystem while maintaining robust security protocols. Understanding device provisioning is essential to build reliable and secure IoT systems, making this chapter a vital resource for IoT enthusiasts and professionals.

Chapter 4, Exploring Device Management and Monitoring, delves into the intricacies of managing and monitoring IoT devices effectively. It covers topics such as device life cycle management, remote configuration, and monitoring device health and performance. You will learn how to ensure the reliability and efficiency of IoT deployments, making this chapter a valuable resource for IoT professionals seeking to maintain and optimize their device ecosystems.

Chapter 5, Securing IoT Systems, addresses one of the most critical aspects of IoT implementation – security. This chapter emphasizes the importance of securing IoT networks and devices against various threats and vulnerabilities. You will explore best practices and strategies to safeguard your IoT systems, including authentication, encryption, and access control. With the increasing concern over IoT security, this chapter provides essential knowledge to build and maintain robust, safe IoT solutions.

Chapter 6, Creating Message Routing, focuses on the efficient and intelligent routing of messages within an IoT ecosystem. This chapter explores the concept of message routing and its significance in ensuring that data is transmitted to the right destinations within an IoT network. You will gain insights into designing and configuring message routing rules, enabling you to effectively manage and process the vast amount of data generated by IoT devices. Understanding message routing is crucial to optimize data flow and enable real-time decision-making in IoT applications.

Chapter 7, Exploring Azure Stream Analytics, dives into the world of real-time data processing and analysis within IoT environments. This chapter explores the capabilities of Azure Stream Analytics, a powerful service provided by Microsoft Azure to ingest, process, and extract valuable insights from streaming data generated by IoT devices. You will learn how to set up and configure Stream Analytics jobs, enabling you to harness the power of real-time data for decision-making and actionable insights in IoT applications.

Chapter 8, Investigating IoT Data with Azure Data Explorer, focuses on the exploration and analysis of historical and large datasets in IoT systems. Azure Data Explorer is a powerful data exploration and visualization service. You will learn how to query and analyze IoT data and gain valuable insights into your data. This chapter equips IoT professionals with the tools to make sense of the wealth of data their devices generate.

Chapter 9, Exploring IoT Edge Computing, delves into the concept of edge computing, an essential component in IoT architecture that enables data processing closer to the source, reducing latency and enhancing efficiency. You will explore the principles of IoT edge computing, understand how to deploy and manage edge devices, and learn how to leverage the advantages of edge computing for real-time processing and decision-making in IoT applications. Understanding edge computing is crucial for creating responsive and scalable IoT systems.

Chapter 10, Visualizing Streaming Data in Power BI, introduces you to the power of real-time data visualization and reporting using Power BI. This chapter explores how to connect and visualize streaming data from IoT devices, providing insights into how to create interactive, dynamic dashboards and reports that display real-time updates.

Chapter 11, Integrating Machine Learning, delves into the convergence of IoT and machine learning. It guides you through the process of leveraging machine learning models to gain deeper insights, predictions, and automation within IoT systems. This chapter covers topics such as model integration, training, and deployment, allowing you to understand how to harness the full potential of machine learning in IoT applications.

Chapter 12, Responding to Device Events, focuses on understanding and managing device events in IoT systems. You will learn how to design responsive and automated workflows that can be triggered by specific device events, allowing real-time actions and decision-making.

To get the most out of this book

To make the most of this guide, you should possess some prior knowledge of programming languages such as C#, Java, or Python, along with a basic understanding of data processing principles. Some experience with the Azure portal and Visual Studio Code would also be helpful.

Software/hardware covered in the book

OS requirements

C# and Python

Windows 10 or above

Visual Studio Code

The Azure portal

It is expected that you have access to an Azure subscription. This can be a free version available at https://azure.microsoft.com/en-us/free/. It is important to delete your resources after each lab. This will ensure you have enough spend to make it through all the exercises in this book.

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/The-Azure-IoT-Handbook. This includes chapter code and lab code. If there’s an update to the code, it will be updated in the GitHub repository.

Important Note

Please note that most of the code in the chapters has been written using C#; however, we have also provided the Python version of the source code in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “In Azure, create a resource group called IoTLab-rg.”

A block of code is set as follows:

#r "Newtonsoft.Json" using System.Net; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Primitives; using Newtonsoft.Json;

Any command-line input or output is written as follows:

dotnet run --PrimaryConnectionString <myDevicePrimaryConnectionString>

Bold: Indicates a new term, an important word, or words that you see on screen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Select the Overview page under the Defender for IoT group on the IoT Hub left-side menu.”

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at [email protected] and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you’ve read The Azure IoT Handbook, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere? Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

Scan the QR code or visit the link below

https://packt.link/free-ebook/978-1-83763-361-6

Submit your proof of purchaseThat’s it! We’ll send your free PDF and other benefits to your email directly

Part 1: Capturing Data from Remote Devices

Welcome to The Azure IoT Handbook, where we explore the world of IoT in a straightforward manner. The first part of the book covers the fundamentals of IoT. We then introduce the core concepts of IoT systems on Azure. This includes the IoT Hub service, followed by the Device Provisioning service, which discusses provisioning devices efficiently and at scale. We will then focus on device management, monitoring, and the importance of securing IoT systems. Whether you’re a seasoned IoT professional or a beginner, our goal is to provide you with essential knowledge to navigate the Azure IoT landscape with confidence. Let’s embark on this journey together as we delve deeper into the world of IoT.

This part has the following chapters:

Chapter 1, AnIntroduction to the IoTChapter 2, Exploring the IoT Hub ServiceChapter 3, Provisioning Devices with the Device Provisioning ServiceChapter 4, Exploring Device Management and MonitoringChapter 5, Securing IoT Systems

1

An Introduction to the IoT

The Internet of Things (IoT) is rapidly transforming the way we live, work, and interact with the world around us. It has the potential to revolutionize countless industries, from manufacturing and healthcare to transportation and agriculture. With billions of interconnected devices already in use, and that number projected to grow exponentially in the coming years, understanding and harnessing the power of the IoT is becoming increasingly important. This book aims to provide a comprehensive introduction to the IoT and is arranged to guide you through setting up and securing your devices, routing and analyzing data, and then visualizing and augmenting it. Although there are no prerequisites for this book, it would be beneficial to have some experience with programming and scripting languages.

This chapter introduces you to the IoT. It introduces some common use cases for developing IoT systems and introduces you to the common components of an IoT system. You will understand the benefits of an IoT hub and its role in the IoT system. The chapter ends with a hands-on lab where you will connect a virtual IoT device to an Azure IoT hub and capture the streaming data.

In this chapter, we’re going to cover the following main topics:

What is the IoT?What are some common IoT use cases?What are the components of an IoT system?Lab – setting up an IoT hub in Azure

Technical requirement

In order to complete the lab in this chapter, you will need a subscription to Azure. If you do not have access to one, you can sign up for a free trial subscription at https://azure.microsoft.com/subscription/free. This free trial will give you $200 of Azure credit to spend over the next 30 days. Take some time to explore all the free services you get with your free subscription; they are quite extensive.

What is the IoT?

If you are reading this book, you are probably somewhat aware of what the IoT is and have been tasked with an IoT project. Nonetheless, it is a good idea to look at the common components of IoT systems. The IoT is a network of connected computing devices with embedded sensors that can transfer the sensor data to the cloud for centralized data processing. These devices run the gamut of wearable devices, such as Fitbit, that track your steps and vitals to smart cars and appliances.

Once you begin planning an IoT solution, you will find that it is a complex task. Both the device side and the cloud side involve complicated implementations that provide hundreds of required features, and the security of these devices is of the utmost importance. This is where Azure comes into play. It provides a set of Platform-as-a-Service (PaaS) offerings that make creating IoT systems easier, more reliable, and secure.

Now that we know what the IoT is, let’s look at some use cases before we dive into further details.

What are some common IoT use cases?

While there are some common IoT use cases to consider, this list is getting bigger all the time. People are constantly coming up with exciting new ways to use the IoT to solve problems, and I think we are just scratching the surface of its full potential. Nevertheless, it is helpful to consider the following common use cases to get a feel for the technology:

Agriculture: This domain is finding many ways to use the IoT. For example, smart irrigation is a popular IoT use case for farmers that provides real-time visibility; IoT sensors recognize when environmental factors, such as ground moisture, call for adjusted watering schedules and can pinpoint where water is needed.Predictive maintenance: Predictive maintenance sensors and software help recognize when a piece of equipment is out of date, slowing down, or malfunctioning and needs to be replaced proactively instead of reactively.Remote monitoring: This IoT use case allows companies to monitor sensors that are in dangerous and remote places. This is particularly helpful in industries such as mining and environmental agencies, where specialized equipment is widely distributed.

Now that we have discussed a few use cases, let’s review the common components of an IoT system.

What are the components of an IoT system?

At their core, all IoT systems are composed of things, insights, and actions. Things refers to small computing devices with embedded sensors that send data up to the cloud through a cloud gateway. The cloud gateway offers a central hub in the cloud that provides secure connectivity, telemetry, event ingestion, cloud-to-device communication, and device management functionalities. It routes the streaming data to storage for long-term analysis and to services that can analyze real-time streaming data. Once the data is processed, it is sent to reporting tools, dashboards, and automated workflows that can automatically respond to the conditions and insights garnered from the telemetry data of the devices. The following figure shows a generic IoT system:

Figure 1.1 – Basic structure of a generic IoT system

In addition to the basic components of an IoT system, many IoT solutions include subsystems for provisioning management at scale, end-to-end security, and machine learning. The following figure shows an IoT system architecture with additional subsystems:

Figure 1.2 – Adding optional subsystems to the IoT solution

As shown in the figure, Bulk Device Provisioning allows the provisioning of a large number of devices. Edge devices play an active role in managing access and controlling the flow of information. They can assist in tasks such as filtering, batching, aggregating, and buffering data, as well as translating protocols. Data Transformation refers to the manipulation or aggregation of the raw streaming data. The User Management subsystem allows the capabilities of different users and groups to be specified in the context of the actions they can perform via the applications and on the systems. Machine Learning provides the systems with the ability to perform actions based on the data, such as predictive maintenance and security alerts. In addition to supporting these subsystems, IoT systems should provide the ability to set up system-wide security and end-to-end logging and monitoring, in addition to high availability and disaster recovery for the system.

Now that we have seen the pieces that make up an IoT system, let’s see what the corresponding resources are in Azure.

Understanding the Azure IoT system

The first thing we need for an IoT system is the devices that will collect the data. These devices can be very small, such as 8-bit microcontrollers, all the way up to server-grade devices depending on the implementation requirements. There are a tremendous number of devices on the market to choose from. The key differentiators are cost, power, network access, types of sensors, and the inputs and outputs accepted.

Although not necessary, when using an IoT device on Azure it is beneficial to ensure it is an Azure Certified Device. This guarantees the device supports telemetry that will be compatible with the IoT hub and the Device Provisioning Service (DPS). It will also facilitate cloud-to-device messaging, direct methods, and device-twin updating. Microsoft maintains a catalog of Azure Certified Devices at https://devicecatalog.azure.com.

Organizations that choose Azure Certified Devices for their IoT projects benefit from reduced development time, increased security, and a more streamlined integration process when building and scaling their IoT solutions on the Azure platform. These devices are typically used in a wide range of IoT applications, including industrial automation, smart cities, healthcare, agriculture, and more.

After selecting a device, the next step is to set up an IoT hub on Azure and connect the device to it. Within Azure IoT Hub, numerous features are available to simplify device management and control. These features comprise secure communication channels that enhance data transmission and reception, the automatic resending of device messages to accommodate intermittent connectivity, and selective revocation of access rights for specific devices as required.

In the following hands-on lab, you will learn how to set up a virtual device that will send simulated data to an IoT hub you will create in Azure. Make sure you have the technical requirements in place before you start!

Lab – setting up an IoT hub in Azure

By the end of this lab, you will be able to do the following:

Navigate the Azure portalSet up a resource groupCreate an IoT hubCreate a virtual deviceSend data from the device to the IoT hub

To do this, you will need to perform the following steps:

Before you start the lab, you will need to create a unique ID. We will add this to the ends of your resource names to make them unique. This ID can be whatever you want. I find using my initials and then attaching the month and day I was born works well. So I would use drc0830.Open a Microsoft Edge browser window, and then navigate to the Azure portal (https://portal.azure.com). Sign in with the credentials you used to create the account. You should land on the home page. You can customize the look and feel by selecting the settings icon in the top-right corner:

Figure 1.3 – Selecting the settings icon

On the settings page, select the Appearance + startup views tab. Make sure the Menu behavior option is set to Docked (see Figure 1.4). Also, verify that the startup page is set to Home.

Figure 1.4 – Setting up the look and feel of the portal

Via the left-side menu, go back to the Home page.At the top of the page, you should see a + icon that lets you create a resource. Click on it, and in the search bar that appears, enter Resource group, then select Resource group from the results dropdown: