边缘代理所需属性中的部署配置为空



正如标题所说,我遇到了一个问题。

描述:

1.我使用DPS与fTPM,Windows平台。

2.在powershell中运行初始化-ioTEdge -dps后, 我在 EdgeAgent 的日志中收到错误:"边缘代理所需属性中的部署配置为空。

寻求帮助和建议。感谢!

这是我将设备注册到 DPS 的代码。

 #region Create a new individualEnrollment config
                rootPage.NotifyUser("nCreating a new individualEnrollment...", NotifyType.StatusMessage);
                Attestation attestation = new TpmAttestation(TpmEndorsementKey);
                IndividualEnrollment individualEnrollment =
                        new IndividualEnrollment(
                                RegistrationId,
                                attestation);
                // The following parameters are optional. Remove them if you don't need them.
                individualEnrollment.DeviceId = OptionalDeviceId;
                individualEnrollment.ProvisioningStatus = ENABLE;
                individualEnrollment.Capabilities = new DeviceCapabilities { IotEdge = true };
                #endregion
                #region Create the individualEnrollment
                rootPage.NotifyUser("nAdding new individualEnrollment...", NotifyType.StatusMessage);
                IndividualEnrollment individualEnrollmentResult =
                    await provisioningServiceClient.CreateOrUpdateIndividualEnrollmentAsync(individualEnrollment).ConfigureAwait(false);
                rootPage.NotifyUser("nIndividualEnrollment created with success.", NotifyType.StatusMessage);
                rootPage.NotifyUser(individualEnrollmentResult.ToString(), NotifyType.StatusMessage);

边缘代理模块日志:

2019-07-18 22:56:41.751 -07:00 [INF] - Edge agent connected to IoT Hub via Amqp_Tcp_Only.
2019-07-18 22:56:42.613 -07:00 [INF] - Obtained Edge agent twin from IoTHub with desired properties version 1 and reported properties version 1.
2019-07-18 22:56:42.641 -07:00 [INF] - Deployment config in edge agent's desired properties is empty.
2019-07-18 22:56:42.642 -07:00 [ERR] - Error refreshing edge agent configuration from twin.
Microsoft.Azure.Devices.Edge.Agent.Core.ConfigSources.ConfigEmptyException: This device has an empty configuration for the edge agent. Please set a deployment manifest.
   at Microsoft.Azure.Devices.Edge.Agent.IoTHub.EdgeAgentConnection.UpdateDeploymentConfig() in C:agent_work4sedge-agentsrcMicrosoft.Azure.Devices.Edge.Agent.IoTHubEdgeAgentConnection.cs:line 232
   at Microsoft.Azure.Devices.Edge.Agent.IoTHub.EdgeAgentConnection.RefreshTwinAsync() in C:agent_work4sedge-agentsrcMicrosoft.Azure.Devices.Edge.Agent.IoTHubEdgeAgentConnection.cs:line 187
2019-07-18 22:56:43.015 -07:00 [INF] - Updated reported properties
在 IoT

中心的门户中,IoT Edge>选择你的 IoT Edge 设备>设置模块>下一个>下一个>提交。

然后边缘代理将获得所需的属性。

这可能是我在以前的版本中没有完成的新步骤。

相关内容

  • 没有找到相关文章

最新更新