连接到 Azure 物联网中心

Connecting to Azure IoT hub

我正在使用 visual studio 开发一些示例 IoT 应用程序,我需要提供连接字符串,有人可以帮助我获取连接字符串的详细信息。

connectionString = "HostName=;DeviceId=;SharedAccessKey=?;

对于 SharedAccessKey,我已经提供了设备密钥,但它不起作用

要从客户端应用程序连接到 IOT 中心,您可以使用以下命令。

DeviceClient.Create(iotHubUri, new DeviceAuthenticationWithRegistrySymmetricKey("myDevice", deviceKey));

转到您的 Azure 仪表板,打开 IoT 中心边栏选项卡,然后查看顶部的 设备 (然后是设置和删除)。这将调出 Device Explorer 边栏选项卡,单击任何设备以获取连接信息。

或者使用 Device Explorer Windows 应用程序。在“管理”选项卡中,右键单击设备以获取包含复制连接字符串的上下文菜单。

有关 Device Explorer 应用程序的信息,请参阅... GitHub How to use Device Explorer for IoT Hub devices

往下看 1/3 页

Download a pre-built version of the Device Explorer application