本文介绍了使用不带流分析的Azure功能将数据从Azure IoTHub存储到SQL数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只有一个设备连接到Iothub,遥测数据小于1k.在这种情况下,Azure Stream Analytics太昂贵了.

I have only one device connecting to Iothub and telemetry data is under 1k. In such situation, Azure Stream Analytics is too expensive.

与Cosmos DB不同,Azure Functions具有其绑定,但具有SQL DB.

Unlike Cosmos DB , Azure Functions has bindings of it , but SQL DB.

如何使用azure函数将数据从Azure Iothub存储到Azure SQL数据库中?

How can I store data from Azure Iothub into Azure SQL Database using azure function?

ps.我正在使用Javascript.

ps. I'm using Javascript.

推荐答案

绝对正确,在这种情况下,Stream Analytics会显得过大.我对您的问题的理解是使用函数"来侦听设备消息并将其存储在SQL数据库中.您需要采取的步骤如下:

Absolutely right, Stream Analytics would be overkill in this situation. My understanding of your questions is to use a Function to listen to device messages and store them in a SQL database. The steps you need to take are as follows:

  1. 创建具有事件中心的Azure功能,该事件中心绑定到IoT中心的默认终结点(链接)
  2. 将SQL连接字符串添加到Function的应用程序设置中(链接)
  3. 编写JavaScript以将SQL运行到数据库(您可能需要安装依赖项作为答案的状态.()

这篇关于使用不带流分析的Azure功能将数据从Azure IoTHub存储到SQL数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 19:07