[英]How to send data from UDF to Cosmos DB in Azure Digital Twin?
Setup till now: I have created spaces. 到目前为止的设置:我已经创建了空间。 At the top level I have the IOT hub resource. 在顶层,我拥有IOT集线器资源。 In two of spaces, I have attached devices to it along with the sensors. 在两个空间中,我已将设备与传感器一起连接到该设备。 I have created a Matcher for the Temperature sensor along with the UDF that is similar to the documentation . 我已经为温度传感器以及与文档类似的UDF创建了Matcher。 I have also assigned permissions to UDF. 我还为UDF分配了权限。 To send data to IOT hub, I have also fetched the device connection string for the dotnet sample 要将数据发送到IOT集线器,我还获取了dotnet示例的设备连接字符串。
List of issues I am facing: 我面临的问题清单:
Unexpected exception occurred while processing user-defined function. 处理用户定义的函数时发生意外的异常。 Please contact support and provide the correlation ID for the request. 请联系支持人员并提供请求的相关ID。
Thanks for the question and reaching out...for #2 you could do this by doing a notify method in your UDF. 感谢您提出问题并与我们联系...对于#2,您可以通过在UDF中执行notify方法来实现。 You can setup egress to other endpoints such as Event Hub, Event Grid or Service Bus via the endpoint dispatcher. 您可以通过终结点分发程序将出口设置到其他终结点,例如事件中心,事件网格或服务总线。 You would setup endpoint via the /endpoint API and then in your UDF you could specify what you want to send out and which changes. 您可以通过/ endpoint API设置终结点,然后在您的UDF中指定要发送的内容和要进行的更改。 For details on the events and endpoints you can see here: https://docs.microsoft.com/en-us/azure/digital-twins/how-to-egress-endpoints 有关事件和端点的详细信息,可以在这里查看: https : //docs.microsoft.com/zh-cn/azure/digital-twins/how-to-egress-endpoints
Here's also here is a link to learn more about this connecting Digital Twins over to Logic Apps: https://docs.microsoft.com/en-us/azure/digital-twins/tutorial-facilities-events which would have a similar pattern to sending data over to Cosmos DB. 这里也是这里的链接,以了解有关将Digital Twins连接到Logic Apps的更多信息: https : //docs.microsoft.com/zh-cn/azure/digital-twins/tutorial-facilities-events具有类似的模式将数据发送到Cosmos DB。
As for the first one I am not sure if you are still seeing this. 至于第一个,我不确定您是否仍然会看到这一点。 Which region? 哪个地区? Do you have a correlation ID that you can pass along? 您有可以传递的关联ID吗? Also if you turn on logs and look in Azure Monitor are there details there? 另外,如果您打开日志并在Azure Monitor中查看,那里是否有详细信息?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.