流分析出口到Azure函数 [英] Stream Analytics Egress to Azure Functions

查看:82
本文介绍了流分析出口到Azure函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前,Microsoft宣布支持将数据从Azure流分析发送到Azure Functions:

Microsoft announced support for sending data from Azure Stream Analytics to Azure Functions few days back:

我尝试了此操作,但无法将数据发送到Azure Functions.是否有任何指南如何从IoT中心-> Azure流分析-> Azure函数发送数据包?

I tried this but couldn't send data to Azure Functions. Is there any guide how to send data packet from IoT-hub -> Azure Stream Analytics -> Azure Functions?

输出对其他来源很好.这是我的查询:

The output is fine to other sources. This is the query I have:

WITH rpidata AS
(
SELECT 
*, 
DATEADD(Hour, 3, timecreated) AS FITimezone
FROM [rpi]
)
SELECT *
INTO [PowerBI]
FROM rpidata
SELECT *
INTO [storageout]
FROM rpidata
SELECT *
INTO [fnout]
FROM rpidata

我收到的错误消息是:

无法成功将空批次发送到Azure函数.请确保您的函数应用程序名称,函数名称和API密钥正确,并且您的Azure函数可以编译.如果所有这些参数都正确,则此时Azure功能可能暂时可用.请稍后再试.返回了响应函数为500的Azure函数:InternalServerError.它应该以200、202或204响应.

Could not successfully send an empty batch to the Azure Function. Please make sure your function app name, function name, and API key are correct and that your Azure Function compiles. If all of those parameters are correct, Azure Function may be temporarily available at this time. Please try again later. Azure function returned with response code of 500: InternalServerError. It should respond with a 200, 202, or 204.

但是该功能在那里,正在运行,并且在我尝试创建连接时会自动找到.

However the function is there, is running and is found automatically when I try to create the connection.

我应该使用哪种功能输入来接收数据?在我链接的函数名称示例中为httptriggercsharp ... streamjob是否将数据作为json发送?

What kind of Function input I should use to receive the data? I n the example I linked function name is httptriggercsharp... Does streamjob send the data as json?

推荐答案

不确定是否仍需要此功能,但供将来参考:ASA作业会将JSON数组中的数据输出到Azure函数. 像这样的示例ASA查询

Not sure if you still need this, but for future reference: The ASA job will output the data in a JSON array to your Azure function. An example ASA query like this

SELECT
   w.col1 as key1,
   w.col2 as key2,
   System.Timestamp as time
INTO
   azfunction
FROM
   [input] w;

将像这样到达您的函数

[
         {
             "key1":"value1",
             "key2":"value2",
             "time":"2017-09-04T17:51:02.7986986Z"
         },
         {
             "key1":"value3",
             "key2":"value4",
             "time":"2017-09-04T17:51:02.7986986Z"
         }
]

JSON数组将包含多少个元素,取决于您如何在ASA中设置Az Function输出以及事件在ASA中到达的速度.根据您的情况,该数组可能只有一个元素或100个元素.

How many elements the JSON array will contain, depends on how you set up the Az Function output in ASA as well as on how fast events arrive in ASA. The array might only have one element or 100 depending on your scenario.

这篇关于流分析出口到Azure函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆