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

标签 azure azure-digital-twins

到目前为止的设置: 我创造了空间。在顶层,我拥有物联网中心资源。在其中两个空间中,我将设备和传感器连接到上面。我为温度传感器和 UDF 创建了一个匹配器,类似于 documentation 。我还给UDF分配了权限。为了将数据发送到 IOT 集线器,我还获取了 dotnet sample 的设备连接字符串。

我面临的问题列表:

  1. 当我尝试运行 dotnet sample 时,我可以看到它能够到达 UDF(通过调试检查),但在 UDF 中,它无法访问 documentation 中给出的遥测变量。 。它显示的错误是:

Unexpected exception occurred while processing user-defined function. Please contact support and provide the correlation ID for the request.

  • 我已创建一个端点以将原始遥测数据发送到事件中心。但我想将处理后的数据从UDF发送到cosmos db。是否可以?如果是的话怎么办?
  • 最佳答案

    感谢您提出问题并伸出援手...对于#2,您可以通过在 UDF 中执行通知方法来做到这一点。您可以通过端点调度程序设置到其他端点(例如事件中心、事件网格或服务总线)的导出。您可以通过/endpoint API 设置端点,然后在 UDF 中指定要发送的内容以及进行哪些更改。有关事件和端点的详细信息,您可以在此处查看:https://learn.microsoft.com/en-us/azure/digital-twins/how-to-egress-endpoints

    这里还有一个链接,可了解有关将数字孪生连接到逻辑应用的更多信息:https://learn.microsoft.com/en-us/azure/digital-twins/tutorial-facilities-events这与将数据发送到 Cosmos DB 具有类似的模式。

    至于第一个,我不确定您是否还看到这个。哪个地区?您有可以传递的相关 ID 吗?另外,如果您打开日志并查看 Azure Monitor 中是否有详细信息?

    关于azure - 如何将数据从 UDF 发送到 Azure Digital Twin 中的 Cosmos DB?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55258534/

    相关文章:

    azure - 有没有办法在 Azure DevOps 测试结果选项卡中显示 Cypress 测试结果?

    azure - 使用 Az CLI 创建新的 Azure 容器实例时,无法从私有(private) Azure 容器注册表中提取镜像

    azure-digital-twins - 使用 SensorDataUnitType 创建传感器

    azure-digital-twins - 如何为 Azure Digital Twin Swagger 获取 client_id 和 client_secret?

    Azure IoT Explorer 无法将该设备识别为 IoT 即插即用设备

    Azure KeyVault : How to set access policy in parallel

    azure - 无法运行Azure管道 "A task is missing. The pipeline references a task called '缓存'

    Azure 服务结构 : Unprovision application version

    python - Azure 数字孪生 Python API - 创建了模型孪生,但无法检索它