简体   繁体   English

如何将数据从UDF发送到Azure Digital Twin中的Cosmos DB?

[英]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: 我面临的问题清单:

  1. When I try to run the dotnet sample , I can see that it is able to reach the UDF(checked it via debugging), but in the UDF, it is not able to access the telemetry variable as given in documentation . 当我尝试运行dotnet示例时 ,可以看到它能够到达UDF(通过调试对其进行检查),但是在UDF中,它无法访问文档中给出的遥测变量。 The error it shows is : 它显示的错误是:

Unexpected exception occurred while processing user-defined function. 处理用户定义的函数时发生意外的异常。 Please contact support and provide the correlation ID for the request. 请联系支持人员并提供请求的相关ID。

  1. I have created an endpoint to send Raw Telemetry to Event Hub. 我创建了一个端点,将原始遥测发送到事件中心。 But I want to send the processed data from UDF to cosmos db. 但是我想将处理后的数据从UDF发送到cosmos db。 Is it possible? 可能吗? If yes then how? 如果是,那怎么办?

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.

相关问题 如何将 Azure IoT Central 数据发送到 Azure 数字孪生 - 数据摄取工作流 - How to send Azure IoT Central data to Azure Digital Twin - Data ingestion workflow 如何使用Core(SQL)API从Azure Cosmos Db检索数据 - How to retrieve data from Azure Cosmos Db with Core(SQL) API 如何自动将数据从Cosmos DB传输到Azure SQL数据库? - How to automatically transfer data from Cosmos DB to Azure SQL database? 如何从我的 azure cosmos db 中查询数据? - How can i query data from my azure cosmos db? Azure:将设备孪生报告值发送到 Cosmos 数据库 - Azure: Send device twin reported values to cosmos database 在 Flutter 中从 Azure Cosmos DB 获取数据? - Fetching data from Azure Cosmos DB in Flutter? Azure IOT HUB 数据到 Azure 数字孪生 - 数据引入工作流 - Azure IOT HUB data to Azure Digital Twin - data ingestion workflow Azure 数字双胞胎 - 双胞胎到双胞胎更新 - Azure Digital twins - Twin to Twin update 如何在Azure Cosmos DB数据迁移工具中将数据从SQL迁移到Cosmos Db时分配分区键 - How to Assign partition key while Migrating Data from SQL to Cosmos Db in Azure Cosmos DB Data Migration Tool 将来自 Azure 数字孪生的 modelId 集成到时序见解中 - Integrating modelId from Azure Digital Twin into Time Series Insights
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM