IoT 中樞裝置更新的組態檔
裝置更新代理程式會從裝置上的 du-config.json
檔案取得其設定資訊。 代理程式會讀取這些值,並將其報告給裝置更新服務:
- AzureDeviceUpdateCore:4.ClientMetadata:4.deviceProperties["manufacturer"]
- AzureDeviceUpdateCore:4.ClientMetadata:4.deviceProperties["model"]
- DeviceInformation.manufacturer
- DeviceInformation.model
- connectionData
- connectionType
檔案位置
在使用 Linux OS 的 IoT 裝置上安裝 Debian 代理程式時,請修改 /etc/adu/du-config.json
檔案以更新值。 對於 Yocto 建置系統,請在名為 adu
的分割區或磁碟中,建立名為 /adu/du-config.json
的 json 檔案。
欄位清單
名称 | 描述 |
---|---|
schemaVersion | 對應目前組態檔格式版本的結構描述版本。 |
aduShellTrustedUsers | 可啟動 adu-shell 程式的使用者清單。 請注意,du-shell 是一種訊息代理程式,會以 'root' 身分執行多種更新動作。 裝置更新預設內容更新處理常式會叫用 du-shell,以執行需要進階使用者權限的工作。 舉例來說,apt-get install 或執行特殊權限指令碼都屬於需要此權限的工作。 |
aduc_manufacturer | 由 AzureDeviceUpdateCore:4.ClientMetadata:4 介面回報,用來分類裝置以決定更新部署的目標。 |
aduc_model | 由 AzureDeviceUpdateCore:4.ClientMetadata:4 介面回報,用來分類裝置以決定更新部署的目標。 |
connectionType | 接受的值為 string 或 AIS 。 將裝置手動連線至 IoT 中樞以供測試之用時,請使用 string 。 在生產案例中,使用 IoT 識別服務將裝置連線至 IoT 中樞時,請使用 AIS 。 如需詳細資訊,請參閱了解 IoT 識別服務設定。 |
connectionData | 如果 connectionType = "string",請在此處新增 IoT 裝置的裝置或模組連接字串。 如果 connectionType = "AIS",請將 connectionData 設定為空字串 ("connectionData": "" )。 |
manufacturer | 由裝置更新代理程式回報為 DeviceInformation 介面的一部分。 |
model | 由裝置更新代理程式回報為 DeviceInformation 介面的一部分。 |
範例 "du-config.json" 檔案內容
{
"schemaVersion": "1.1",
"aduShellTrustedUsers": [
"adu",
"do"
],
"manufacturer": <Place your device info manufacturer here>,
"model": <Place your device info model here>,
"agents": [
{
"name": <Place your agent name here>,
"runas": "adu",
"connectionSource": {
"connectionType": "string", //or “AIS”
"connectionData": <Place your Azure IoT device connection string here>
},
"manufacturer": <Place your device property manufacturer here>,
"model": <Place your device property model here>
}
]
}