是否可以使用 .NET 以编程方式在 Azure IoT 中心上创建新设备?在 microsoft.docs 上的所有教程中,设备都是通过 Azure 门户或 Azure CLI 创建的。
如果有的话,能否提供一些有趣的链接?预先感谢您。
最佳答案
有一个关于creating a device identity的教程你可以关注。
相关的API是registryManager.AddDeviceAsync
。
RegistryManager manager = RegistryManager.CreateFromConnectionString(connectionString);
await manager.AddDeviceAsync(new Device(deviceID));
您可以找到C# code sample位于 GitHub 上的 Azure IoT SDK C# 存储库。
关于.net - 创建 Azure IoT 中心设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51437354/