您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.
快速入门:使用对称密钥向 IoT 中心预配模拟设备Quickstart: Provision a simulated device to IoT Hub with symmetric keys
01/30/2020
本文内容
本快速入门介绍如何在 Windows 开发计算机上创建和运行设备模拟器。In this quickstart, you will learn how to create and run a device simulator on a Windows development machine. 你将配置此模拟设备,以使用对称密钥对设备预配服务 (DPS) 实例进行身份验证,并将此模拟设备分配到 IoT 中心。You will configure this simulated device to use a symmetric key to authenticate with a Device Provisioning Service (DPS) instance and be assigned to an IoT hub. Sample code from the Microsoft Azure IoT SDKs for Java will be used to simulate a boot sequence for the device that initiates provisioning. 将根据 DPS 服务实例的单个注册来识别该设备,然后将其分配到 IoT 中心。The device will be recognized based on an individual enrollment with a DPS service instance and assigned to an IoT hub.
虽然本文演示了使用单个注册进行预配,但你也可以使用注册组。Although this article demonstrates provisioning with an individual enrollment, you can use enrollment groups. 使用注册组时有一些不同之处。There are some differences when using enrollment groups. 例如,必须将派生的设备密钥与设备的唯一注册 ID 一起使用。For example, you must use a derived device key with a unique registration ID for the device. 虽然对称密钥注册组不限于旧设备,但如何使用对称密钥证明预配旧设备提供了注册组示例。Although symmetric key enrollment groups are not limited to legacy devices, How to provision legacy devices using Symmetric key attestation provides an enrollment group example. 有关详细信息,请参阅对称密钥证明的组注册。
如果不熟悉自动预配过程,请查看预配概述。If you're unfamiliar with the process of auto-provisioning, review the provisioning overview.
另外,在继续学习本快速入门之前,请确保已完成通过 Azure 门户设置 IoT 中心设备预配服务中的步骤。Also, make sure you've completed the steps in Set up IoT Hub Device Provisioning Service with the Azure portal before continuing with this quickstart. 本快速入门需要你已创建设备预配服务实例。This quickstart requires you to have already created your Device Provisioning Service instance.
本文面向基于 Windows 的工作站。This article is oriented toward a Windows-based workstation. 但是,你也可以在 Linux 上执行过程。However, you can perform the p