0

在配置文件中键入连接字符串(如官方示例所示:https ://github.com/Azure-Samples/iot-edge-samples/blob/master/js/simple/gw.cloud.config.json# L38 ) 似乎不对。

Edge Runtime ( https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/iot-edge/iot-edge-runtime.md )可能会向模块提供环境变量,但就我而言可以看到没有办法修改它的行为。

4

1 回答 1

0

在第一个文档 ( https://github.com/Azure-Samples/iot-edge-samples/blob/master/js/simple/gw.cloud.config.json#L38 ) 中,它展示了如何自定义 IoT Edge运行时 (gw.[local|cloud].config.json)。你可以gw.cloud.config.json通过替换<IoT Hub device connection string>为实际的 IoT 中心设备连接字符串来更新,以在 IoT Edge 应用程序和 Azure IoT 中心之间建立连接。

在下一个文档(https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/iot-edge/iot-edge-runtime.md)中,您还可以通过执行以下命令来配置 IoT Edge 运行时命令。您将在 中找到连接字符串设置C:\ProgramData\azure-iot-edge\config\config.json

iotedgectl setup --connection-string "{设备连接字符串}" --nopass

于 2018-04-10T03:26:03.017 回答